use of ome.xml.model.primitives.PositiveInteger in project bioformats by openmicroscopy.
the class OMETiffWriterTest method testGetPlaneCount.
@Test
public void testGetPlaneCount() throws IOException, FormatException {
writer.setMetadataRetrieve(metadata);
writer.setSeries(0);
assertEquals(WriterUtilities.SIZE_T * WriterUtilities.SIZE_Z * WriterUtilities.SIZE_C, writer.getPlaneCount());
metadata.setPixelsSizeC(new PositiveInteger(4), 0);
metadata.setPixelsType(PixelType.INT16, 0);
writer.setMetadataRetrieve(metadata);
assertEquals(WriterUtilities.SIZE_T * WriterUtilities.SIZE_Z * 4, writer.getPlaneCount());
}
use of ome.xml.model.primitives.PositiveInteger in project bioformats by openmicroscopy.
the class TiffWriterTest method testGetTileSizeY.
@Test
public void testGetTileSizeY() throws IOException, FormatException {
writer.setMetadataRetrieve(metadata);
assertEquals(WriterUtilities.SIZE_Y, writer.getTileSizeY());
writer.close();
writer = new TiffWriter();
metadata.setPixelsSizeY(new PositiveInteger(100), 0);
writer.setMetadataRetrieve(metadata);
assertEquals(100, writer.getTileSizeY());
}
use of ome.xml.model.primitives.PositiveInteger in project bioformats by openmicroscopy.
the class TiffWriterTest method testGetTileSizeX.
@Test
public void testGetTileSizeX() throws IOException, FormatException {
writer.setMetadataRetrieve(metadata);
assertEquals(WriterUtilities.SIZE_X, writer.getTileSizeX());
writer.close();
writer = new TiffWriter();
metadata.setPixelsSizeX(new PositiveInteger(100), 0);
writer.setMetadataRetrieve(metadata);
assertEquals(100, writer.getTileSizeX());
}
use of ome.xml.model.primitives.PositiveInteger in project bioformats by openmicroscopy.
the class TiffWriterTest method testSetBigTiffAutomatic.
@Test
public void testSetBigTiffAutomatic() throws IOException, FormatException {
// Test that no exception is thrown when bigTiff is set automatically due to size
metadata.setPixelsSizeT(new PositiveInteger(1000), 0);
writer.setMetadataRetrieve(metadata);
((TiffWriterMock) writer).createOutputBuffer(true);
long length = 4294967296L;
((TiffWriterMock) writer).setBufferLength(length);
writer.setId("test.tiff");
writer.saveBytes(0, buf, ifd);
}
use of ome.xml.model.primitives.PositiveInteger in project bioformats by openmicroscopy.
the class OMETiffWriterLargeImageWidthTest method setUp.
@BeforeClass
public void setUp() throws Exception {
target = File.createTempFile("OMETiffWriterTest", ".ome.tiff");
ServiceFactory sf = new ServiceFactory();
OMEXMLService service = sf.getInstance(OMEXMLService.class);
ms = service.createOMEXMLMetadata();
ms.setImageID("Image:1", 0);
ms.setPixelsID("Pixels:1", 0);
ms.setPixelsDimensionOrder(DimensionOrder.XYZCT, 0);
ms.setPixelsSizeX(new PositiveInteger(SIZE_X), 0);
ms.setPixelsSizeY(new PositiveInteger(SIZE_Y), 0);
ms.setPixelsSizeZ(new PositiveInteger(SIZE_Z), 0);
ms.setPixelsSizeC(new PositiveInteger(SIZE_C), 0);
ms.setPixelsSizeT(new PositiveInteger(SIZE_T), 0);
ms.setPixelsType(PixelType.UINT8, 0);
ms.setPixelsBinDataBigEndian(true, 0, 0);
ms.setChannelID("Channel:1", 0, 0);
ms.setChannelSamplesPerPixel(new PositiveInteger(1), 0, 0);
}
Aggregations