@Test(dependsOnMethods = {"testMetadataLevel"}) public void testMetadataLevelEquivilentDimensions() { assertEquals(wrapper.getSeriesCount(), minimalWrapper.getSeriesCount()); for (int i = 0; i < minimalWrapper.getSeriesCount(); i++) { wrapper.setSeries(i); minimalWrapper.setSeries(i); assertEquals(wrapper.getSizeX(), minimalWrapper.getSizeX()); assertEquals(wrapper.getSizeY(), minimalWrapper.getSizeY()); assertEquals(wrapper.getSizeZ(), minimalWrapper.getSizeZ()); assertEquals(wrapper.getSizeC(), minimalWrapper.getSizeC()); assertEquals(wrapper.getSizeT(), minimalWrapper.getSizeT()); assertEquals(wrapper.getPixelType(), minimalWrapper.getPixelType()); assertEquals(wrapper.isLittleEndian(), minimalWrapper.isLittleEndian()); } }
@Test(dependsOnMethods = {"testMetadataLevel"}) public void testEquivilentBlockRetrievalPlaneData() throws FormatException, IOException { String fileName = wrapper.getCurrentFile(); int sizeX = wrapper.getSizeX(); int sizeY = wrapper.getSizeY(); int sizeZ = wrapper.getSizeZ(); int sizeC = wrapper.getSizeC(); int sizeT = wrapper.getSizeT(); int bytesPerPixel = wrapper.getBitsPerPixel() / 8; int planeSize = sizeX * sizeY * bytesPerPixel; byte[] planar = new byte[planeSize]; byte[] block = new byte[planeSize]; int planeNumber = 0; String planarDigest; String blockDigest; for (int t = 0; t < sizeT; t++) { for (int c = 0; c < sizeC; c++) { for (int z = 0; z < sizeZ; z++) { planeNumber = wrapper.getIndex(z, c, t); wrapper.openPlane2D(fileName, planeNumber, planar); planarDigest = sha1(planar); wrapper.openPlane2D(fileName, planeNumber, block, 0, 0, sizeX, sizeY); blockDigest = sha1(block); assertEquals(planarDigest, blockDigest); } } } }