@Override public int getSizeX() { return reader.getSizeX(); }
@Override public int getSizeX() { return reader.getSizeX() * tileX; }
@Override public int getSizeX() { return reader.getSizeX() * tileX; }
@Override public int getSizeX() { return reader.getSizeX(); }
public int getSizeX() { return reader.getSizeX(); }
protected static int getWidth(IFormatReader r, String path, int series) throws FormatException, IOException { r.setSeries(series); return r.getSizeX(); }
protected static int getWidth(IFormatReader r, String path, int series) throws FormatException, IOException { r.setSeries(series); return r.getSizeX(); }
@Override public int getSizeX() { return getReader().getSizeX(); }
@Override public int getSizeX() { return getReader().getSizeX(); }
public static void checkBufferSize(IFormatReader r, int len) throws FormatException { checkBufferSize(r, len, r.getSizeX(), r.getSizeY()); }
public static void checkBufferSize(IFormatReader r, int len) throws FormatException { checkBufferSize(r, len, r.getSizeX(), r.getSizeY()); }
/** Returns the size in bytes of a single plane. */ public static int getPlaneSize(IFormatReader r) { return getPlaneSize(r, r.getSizeX(), r.getSizeY()); }
/** Checks that the given tile size is valid for the given reader. */ public static void checkTileSize(IFormatReader r, int x, int y, int w, int h) throws FormatException { int width = r.getSizeX(); int height = r.getSizeY(); if (x < 0 || y < 0 || w < 0 || h < 0 || (x + w) > width || (y + h) > height) { throw new FormatException("Invalid tile size: x=" + x + ", y=" + y + ", w=" + w + ", h=" + h); } }
/** Checks that the given tile size is valid for the given reader. */ public static void checkTileSize(IFormatReader r, int x, int y, int w, int h) throws FormatException { int width = r.getSizeX(); int height = r.getSizeY(); if (x < 0 || y < 0 || w < 0 || h < 0 || (x + w) > width || (y + h) > height) { throw new FormatException("Invalid tile size: x=" + x + ", y=" + y + ", w=" + w + ", h=" + h); } }
/** Returns the size in bytes of a single plane. */ public static int getPlaneSize(IFormatReader r) { return getPlaneSize(r, r.getSizeX(), r.getSizeY()); }
@Override public int getSizeX() { FormatTools.assertId(getCurrentFile(), true, 2); return noStitch ? reader.getSizeX() : core.get(getCoreIndex()).sizeX; }
@Override public int getSizeX() { FormatTools.assertId(getCurrentFile(), true, 2); return noStitch ? reader.getSizeX() : core.get(getCoreIndex()).sizeX; }
public void checkImage() throws FormatException, IOException { IFormatReader r = new ImageReader(); r.setId(outFile.getAbsolutePath()); assertEquals(r.getSizeX(), 512); r.close(); }
@Test public void testSubResolutionCount() { int seriesCount = reader.getSeriesCount(); assertTrue(seriesCount > 0); for (int series=0; series<seriesCount; series++) { reader.setSeries(series); int resolutionCount = reader.getResolutionCount(); assertTrue(resolutionCount > 0); for (int resolution=0; resolution<resolutionCount; resolution++) { reader.setResolution(resolution); assertTrue(reader.getSizeX() > 0); assertTrue(reader.getSizeY() > 0); } } }
@Test public void testMultiplePyramidsMultiplePlanes() throws FormatException, IOException { int[] dims = new int[] {8, 10}; writePyramid(files[8].getAbsolutePath(), dims, dims, 2, 0, false, true); IFormatReader reader = getReader(8); try { assertEquals(reader.getSeriesCount(), 2); for (int s=0; s<reader.getSeriesCount(); s++) { reader.setSeries(s); assertEquals(reader.getResolutionCount(), RESOLUTION_COUNT); assertEquals(reader.getSizeX(), dims[s]); assertEquals(reader.getSizeY(), dims[s]); assertEquals(reader.getSizeZ(), 2); } assertTrue(checkPixels(reader)); } finally { reader.close(); } }