/** * Returns the image number in the original dataset that corresponds to the * given image number. * * @param no is an image number greater than or equal to 0 and less than * getImageCount() * @return the corresponding image number in the original (unmerged) data. */ public int getOriginalIndex(int no) throws FormatException, IOException { int imageCount = getImageCount(); int originalCount = reader.getImageCount(); if (imageCount == originalCount) return no; int[] coords = getZCTCoords(no); return reader.getIndex(coords[0], coords[1], coords[2]); }
/** * Returns the image number in the original dataset that corresponds to the * given image number. * * @param no is an image number greater than or equal to 0 and less than * getImageCount() * @return the corresponding image number in the original (unmerged) data. */ public int getOriginalIndex(int no) throws FormatException, IOException { int imageCount = getImageCount(); int originalCount = reader.getImageCount(); if (imageCount == originalCount) return no; int[] coords = getZCTCoords(no); return reader.getIndex(coords[0], coords[1], coords[2]); }
@Override public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.assertId(getCurrentFile(), true, 2); if (!canMerge()) return super.openBytes(no, buf, x, y, w, h); int sizeC = getSizeC(); int[] nos = getZCTCoords(no); int z = nos[0], t = nos[2]; for (int c=0; c<sizeC; c++) { byte[] b = reader.openBytes(reader.getIndex(z, c, t), x, y, w, h); System.arraycopy(b, 0, buf, c * b.length, b.length); } return buf; }
@Override public byte[] openBytes(int no, byte[] buf, int x, int y, int w, int h) throws FormatException, IOException { FormatTools.assertId(getCurrentFile(), true, 2); if (!canMerge()) return super.openBytes(no, buf, x, y, w, h); int sizeC = getSizeC(); int[] nos = getZCTCoords(no); int z = nos[0], t = nos[2]; for (int c=0; c<sizeC; c++) { byte[] b = reader.openBytes(reader.getIndex(z, c, t), x, y, w, h); System.arraycopy(b, 0, buf, c * b.length, b.length); } return buf; }
if (merge) pos = new ChannelMerger(reader).getZCTCoords(sliceIndex); int[] cachePos = FormatTools.rasterToPosition(len, sliceIndex); ImageProcessor ip = null;
if (merge) pos = new ChannelMerger(reader).getZCTCoords(sliceIndex); int[] cachePos = FormatTools.rasterToPosition(len, sliceIndex); ImageProcessor ip = null;