@Override public byte[] openBytes(int no, byte[] buf) throws FormatException, IOException { return openBytes(no, buf, 0, 0, getSizeX(), getSizeY()); }
@Override public byte[] openBytes(int no, byte[] buf) throws FormatException, IOException { return openBytes(no, buf, 0, 0, getSizeX(), getSizeY()); }
@Override public byte[] openBytes(int no) throws FormatException, IOException { return openBytes(no, 0, 0, getSizeX(), getSizeY()); }
@Override public byte[] openBytes(int no) throws FormatException, IOException { return openBytes(no, 0, 0, getSizeX(), getSizeY()); }
@Override public byte[] openBytes(int no, int x, int y, int w, int h) throws FormatException, IOException { int bpp = FormatTools.getBytesPerPixel(getPixelType()); int ch = getRGBChannelCount(); byte[] buf = DataTools.allocate(w, h, ch, bpp); return openBytes(no, buf, x, y, w, h); }
@Override public byte[] openBytes(int no, int x, int y, int w, int h) throws FormatException, IOException { int bpp = FormatTools.getBytesPerPixel(getPixelType()); int ch = getRGBChannelCount(); byte[] buf = DataTools.allocate(w, h, ch, bpp); return openBytes(no, buf, x, y, w, h); }
private static void checkPlanes(FileStitcher fs, Integer[] dims) throws IOException, FormatException { List<Set<Integer>>idxSets = new ArrayList<Set<Integer>>(); for (int k = 0; k < 5; k++) { idxSets.add(new HashSet<Integer>()); } int[] specialPixels; for (int i = 0; i < fs.getImageCount(); i++) { specialPixels = FakeReader.readSpecialPixels(fs.openBytes(i)); for (int k = 0; k < 5; k++) { idxSets.get(k).add(specialPixels[k]); } } assertEquals(idxSets.get(0), new HashSet(range(1))); // S assertEquals(idxSets.get(1), new HashSet(range(dims[0] * dims[1] * dims[2]))); // no. assertEquals(idxSets.get(2), new HashSet(range(dims[0]))); // Z assertEquals(idxSets.get(3), new HashSet(range(dims[2]))); // C assertEquals(idxSets.get(4), new HashSet(range(dims[1]))); // T }