Search in sources :

Example 1 with UUID

use of ome.xml.model.UUID in project bioformats by openmicroscopy.

the class InOutCurrentTest method testValidTiffDataNode.

@Test(dependsOnMethods = { "testValidPixelsNode" })
public void testValidTiffDataNode() {
    TiffData tiffData = ome.getImage(0).getPixels().getTiffData(0);
    UUID uuid = tiffData.getUUID();
    assertEquals(TIFF_DATA_UUID, uuid.getValue());
}
Also used : TiffData(ome.xml.model.TiffData) UUID(ome.xml.model.UUID) Test(org.testng.annotations.Test)

Example 2 with UUID

use of ome.xml.model.UUID in project bioformats by openmicroscopy.

the class ObjectBasedOMEModelMock method makeImage.

private Image makeImage() {
    // Create <Image/>
    Image image = new Image();
    image.setID(InOutCurrentTest.IMAGE_ID);
    ListAnnotation listAnnotation = new ListAnnotation();
    listAnnotation.setID(InOutCurrentTest.IMAGE_LIST_ANNOTATION_ID);
    listAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    annotations.addListAnnotation(listAnnotation);
    BooleanAnnotation annotation = new BooleanAnnotation();
    annotation.setID(InOutCurrentTest.IMAGE_ANNOTATION_ID);
    annotation.setValue(InOutCurrentTest.IMAGE_ANNOTATION_VALUE);
    annotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
    listAnnotation.linkAnnotation(annotation);
    image.linkAnnotation(listAnnotation);
    annotations.addBooleanAnnotation(annotation);
    // Create <Pixels/>
    Pixels pixels = new Pixels();
    pixels.setID(InOutCurrentTest.PIXELS_ID);
    pixels.setSizeX(new PositiveInteger(InOutCurrentTest.SIZE_X));
    pixels.setSizeY(new PositiveInteger(InOutCurrentTest.SIZE_Y));
    pixels.setSizeZ(new PositiveInteger(InOutCurrentTest.SIZE_Z));
    pixels.setSizeC(new PositiveInteger(InOutCurrentTest.SIZE_C));
    pixels.setSizeT(new PositiveInteger(InOutCurrentTest.SIZE_T));
    pixels.setDimensionOrder(InOutCurrentTest.DIMENSION_ORDER);
    pixels.setType(InOutCurrentTest.PIXEL_TYPE);
    // Create <TiffData/>
    TiffData tiffData = new TiffData();
    // Create <UUID/>
    UUID uuid = new UUID();
    uuid.setValue(InOutCurrentTest.TIFF_DATA_UUID);
    tiffData.setUUID(uuid);
    pixels.addTiffData(tiffData);
    // Create <Channel/> under <Pixels/>
    for (int i = 0; i < InOutCurrentTest.SIZE_C; i++) {
        Channel channel = new Channel();
        channel.setID("Channel:" + i);
        if (i == 0) {
            XMLAnnotation channelAnnotation = new XMLAnnotation();
            channelAnnotation.setID(InOutCurrentTest.CHANNEL_ANNOTATION_ID);
            channelAnnotation.setValue(InOutCurrentTest.CHANNEL_ANNOTATION_VALUE);
            channelAnnotation.setNamespace(InOutCurrentTest.GENERAL_ANNOTATION_NAMESPACE);
            channel.linkAnnotation(channelAnnotation);
            annotations.addXMLAnnotation(channelAnnotation);
        }
        pixels.addChannel(channel);
    }
    // Put <Pixels/> under <Image/>
    image.setPixels(pixels);
    return image;
}
Also used : BooleanAnnotation(ome.xml.model.BooleanAnnotation) PositiveInteger(ome.xml.model.primitives.PositiveInteger) TiffData(ome.xml.model.TiffData) Channel(ome.xml.model.Channel) ListAnnotation(ome.xml.model.ListAnnotation) XMLAnnotation(ome.xml.model.XMLAnnotation) Image(ome.xml.model.Image) UUID(ome.xml.model.UUID) Pixels(ome.xml.model.Pixels)

Aggregations

TiffData (ome.xml.model.TiffData)2 UUID (ome.xml.model.UUID)2 BooleanAnnotation (ome.xml.model.BooleanAnnotation)1 Channel (ome.xml.model.Channel)1 Image (ome.xml.model.Image)1 ListAnnotation (ome.xml.model.ListAnnotation)1 Pixels (ome.xml.model.Pixels)1 XMLAnnotation (ome.xml.model.XMLAnnotation)1 PositiveInteger (ome.xml.model.primitives.PositiveInteger)1 Test (org.testng.annotations.Test)1