/** * Returns the pixel intensity value of the pixel at a given offset within * the backing buffer. This method takes into account bytes per pixel. So * the number of offsets is equal to the buffer size / * <code>bytesPerPixel</code>. * * @param offset The relative offset (taking into account the number of * bytes per pixel) within the backing buffer. * @return The intensity value. */ public double getPixelValue(int offset) { return data.getPixelValue(offset); }
public void handle(int x, int y) { // we won't use pixels outside of the image if (x < 0 || y < 0 || x >= sizeX || y >= sizeY) return; stats.pointsCount[w]++; double value = pd.getPixelValue(sizeX * y + x); stats.min[w] = Math.min(value, stats.min[w]); stats.max[w] = Math.max(value, stats.max[w]); stats.sum[w] += value; sumOfSquares[w] += value * value; } });
stackValue = ctx.from.getPixelValue(currentPlaneStart + i); if (stackValue > projectedValue)
stackValue = ctx.from.getPixelValue(currentPlaneStart + i); projectedValue += stackValue; projectedPlaneCount++;
min = Math.min(min, px.getPixelValue(i)); max = Math.max(max, px.getPixelValue(i));
public double get(PixelBuffer buf, int x, int y, int z, int c, int t) { ome.util.PixelData pd = null; try { pd = buf.getRow(y, z, c, t); return pd.getPixelValue(x); } catch (IOException e) { throw new ResourceError("IOException: " + e); } catch (DimensionsOutOfBoundsException e) { throw new ApiUsageException("DimensionsOutOfBounds: " + e); } catch (IndexOutOfBoundsException iobe) { throw new ValidationException("IndexOutOfBounds: " + iobe); } finally { if (pd != null) { pd.dispose(); } } }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#getColDirect(Integer, Integer, Integer, Integer, byte[]) */ public byte[] getColDirect(Integer x, Integer z, Integer c, Integer t, byte[] buffer) throws IOException, DimensionsOutOfBoundsException { PixelData plane = getPlane(z, c, t); Integer sizeY = getSizeY(); Integer sizeX = getSizeX(); ByteBuffer buf = ByteBuffer.wrap(buffer); PixelData column = new PixelData(pixels.getPixelsType().getValue(), buf); int offset; double value; for (int i = 0; i < sizeY; i++) { offset = (i * sizeX) + x; value = plane.getPixelValue(offset); column.setPixelValue(i, value); } plane.dispose(); return buffer; }
/** * Implemented as specified by {@link PixelBuffer} I/F. * @see PixelBuffer#getCol(Integer, Integer, Integer, Integer) */ public PixelData getCol(Integer x, Integer z, Integer c, Integer t) throws IOException, DimensionsOutOfBoundsException { //Dimension check in plane. PixelData plane = getPlane(z, c, t); Integer sizeY = getSizeY(); Integer sizeX = getSizeX(); Integer colSize = getColSize(); ByteBuffer buf = ByteBuffer.wrap(new byte[colSize]); PixelData column = new PixelData(pixels.getPixelsType().getValue(), buf); int offset; double value; for (int i = 0; i < sizeY; i++) { offset = (i * sizeX) + x; value = plane.getPixelValue(offset); column.setPixelValue(i, value); } plane.dispose(); return column; }
for (int j = 0; j < width; j++) { offset = (i+y)*getSizeX()+x+j; region.setPixelValue(i*width+j, plane.getPixelValue(offset)); for (int j = 0; j < width; j = j+stride) { offset = (i+y)*getSizeX()+x+j; region.setPixelValue(k*w+l, plane.getPixelValue(offset)); l++;
int pxy = i / imgWidth; if (pxx >= x && pxx < (x + w) && pxy >= y && pxy < (y + h)) { int bin = (int) ((px.getPixelValue(i) - min) / binRange);