@RolesAllowed("user") public synchronized Map<Integer, double[]> findMinMax(int[] channels) { Map<Integer, double[]> result = new HashMap<Integer, double[]>(); if (requiresPixelsPyramid()) return result; try { for (int ch : channels) { Channel channel = pixelsInstance.getChannel(ch); if (channel == null) continue; int z = buffer.getSizeZ() > 1 ? (buffer.getSizeZ() - 1) / 2 : 0; int t = buffer.getSizeT() > 1 ? (buffer.getSizeT() - 1) / 2 : 0; PixelData px = buffer.getPlane(z, ch, t); double[] minmax = determineHistogramMinMax(px, channel, false); result.put(ch, minmax); } } catch (IOException e) { handleException(e); } return result; }
/** * 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()));