/** * Sets the codomain interval i.e. a sub-interval of [0, 255]. * * @param start * The lower bound of the interval. * @param end * The upper bound of the interval. */ public void setCodomainInterval(int start, int end) { CodomainChain c; for (int i = 0; i < getPixels().getSizeC(); i++) { c = getCodomainChain(i); c.setInterval(start, end); } /* * RenderingDef rd = getRenderingDef(); QuantumDef qd = * rd.getQuantization(), newQd; newQd = new QuantumDef(); * newQd.setBitResolution(qd.getBitResolution()); * newQd.setCdStart(Integer.valueOf(start)); * newQd.setCdEnd(Integer.valueOf(end)); rd.setQuantization(newQd); */ RenderingDef rd = getRenderingDef(); QuantumDef qd = rd.getQuantization(); qd.setCdStart(Integer.valueOf(start)); qd.setCdEnd(Integer.valueOf(end)); //need to rebuild the look up table updateQuantumManager(); }
/** * Iterates over every tile in a given pixel buffer based on the * over arching dimensions and a requested maximum tile width and height. * @param iteration Invoker to call for each tile. * @param pixelBuffer Pixel buffer which is backing the pixel data. * @param tileWidth <b>Maximum</b> width of the tile requested. The tile * request itself will be smaller than the original tile width requested if * <code>x + tileWidth > sizeX</code>. * @param tileHeight <b>Maximum</b> height of the tile requested. The tile * request itself will be smaller if <code>y + tileHeight > sizeY</code>. * @throws FailedTileLoopException if the tile loop was aborted; exception bears completed tile count * @return The total number of tiles iterated over. */ public static int forEachTile(TileLoopIteration iteration, PixelBuffer pixelBuffer, int tileWidth, int tileHeight) throws FailedTileLoopException { int sizeX = pixelBuffer.getSizeX(); int sizeY = pixelBuffer.getSizeY(); int sizeZ = pixelBuffer.getSizeZ(); int sizeC = pixelBuffer.getSizeC(); int sizeT = pixelBuffer.getSizeT(); return forEachTile(iteration, sizeX, sizeY, sizeZ, sizeC, sizeT, tileWidth, tileHeight); }
source.getSizeZ() * source.getSizeC() * source.getSizeT() * (Math.ceil(source.getSizeX() / tileSize.getWidth())) * (Math.ceil(source.getSizeY() / tileSize.getHeight()));