Search in sources :

Example 11 with PositiveInteger

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());
}
Also used : PositiveInteger(ome.xml.model.primitives.PositiveInteger) Test(org.testng.annotations.Test)

Example 12 with PositiveInteger

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());
}
Also used : PositiveInteger(ome.xml.model.primitives.PositiveInteger) TiffWriter(loci.formats.out.TiffWriter) Test(org.testng.annotations.Test)

Example 13 with PositiveInteger

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());
}
Also used : PositiveInteger(ome.xml.model.primitives.PositiveInteger) TiffWriter(loci.formats.out.TiffWriter) Test(org.testng.annotations.Test)

Example 14 with PositiveInteger

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);
}
Also used : PositiveInteger(ome.xml.model.primitives.PositiveInteger) TiffWriterMock(loci.formats.utests.tiff.TiffWriterMock) Test(org.testng.annotations.Test)

Example 15 with PositiveInteger

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);
}
Also used : PositiveInteger(ome.xml.model.primitives.PositiveInteger) ServiceFactory(loci.common.services.ServiceFactory) OMEXMLService(loci.formats.services.OMEXMLService) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

PositiveInteger (ome.xml.model.primitives.PositiveInteger)42 NonNegativeInteger (ome.xml.model.primitives.NonNegativeInteger)17 FormatException (loci.formats.FormatException)16 ServiceFactory (loci.common.services.ServiceFactory)14 OMEXMLService (loci.formats.services.OMEXMLService)14 Location (loci.common.Location)13 CoreMetadata (loci.formats.CoreMetadata)13 MetadataStore (loci.formats.meta.MetadataStore)13 ServiceException (loci.common.services.ServiceException)11 Time (ome.units.quantity.Time)11 ArrayList (java.util.ArrayList)10 Length (ome.units.quantity.Length)10 IOException (java.io.IOException)9 DependencyException (loci.common.services.DependencyException)9 Image (ome.xml.model.Image)7 Timestamp (ome.xml.model.primitives.Timestamp)7 OMEXMLMetadata (loci.formats.ome.OMEXMLMetadata)6 EnumerationException (ome.xml.model.enums.EnumerationException)6 RandomAccessInputStream (loci.common.RandomAccessInputStream)5 TiffWriter (loci.formats.out.TiffWriter)5