Search in sources :

Example 11 with Annotation

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

the class InOutCurrentTest method testValidPlateAnnotation.

@Test(dependsOnMethods = { "testValidPlateNode" })
public void testValidPlateAnnotation() {
    Annotation n = ome.getPlate(0).getLinkedAnnotation(0);
    assertNotNull(n);
    assertEquals(PLATE_ANNOTATION_ID, n.getID());
    assertEquals(n.getNamespace(), GENERAL_ANNOTATION_NAMESPACE);
    assertTrue(n instanceof TimestampAnnotation);
    TimestampAnnotation timestamp = (TimestampAnnotation) n;
    assertEquals(timestamp.getValue(), PLATE_ANNOTATION_VALUE);
}
Also used : TimestampAnnotation(ome.xml.model.TimestampAnnotation) ListAnnotation(ome.xml.model.ListAnnotation) CommentAnnotation(ome.xml.model.CommentAnnotation) Annotation(ome.xml.model.Annotation) LongAnnotation(ome.xml.model.LongAnnotation) TimestampAnnotation(ome.xml.model.TimestampAnnotation) XMLAnnotation(ome.xml.model.XMLAnnotation) BooleanAnnotation(ome.xml.model.BooleanAnnotation) Test(org.testng.annotations.Test)

Example 12 with Annotation

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

the class InOutCurrentTest method testValidLaserAnnotation.

@Test(dependsOnMethods = { "testValidLaserMetadata" }, enabled = false)
public void testValidLaserAnnotation() {
    Annotation n = ome.getInstrument(0).getLightSource(0).getLinkedAnnotation(0);
    assertNotNull(n);
    assertEquals(LIGHTSOURCE_LASER_ANNOTATION_ID, n.getID());
    assertEquals(n.getNamespace(), GENERAL_ANNOTATION_NAMESPACE);
    assertTrue(n instanceof CommentAnnotation);
    CommentAnnotation string = (CommentAnnotation) n;
    assertEquals(LIGHTSOURCE_LASER_ANNOTATION_VALUE, string.getValue());
}
Also used : CommentAnnotation(ome.xml.model.CommentAnnotation) ListAnnotation(ome.xml.model.ListAnnotation) CommentAnnotation(ome.xml.model.CommentAnnotation) Annotation(ome.xml.model.Annotation) LongAnnotation(ome.xml.model.LongAnnotation) TimestampAnnotation(ome.xml.model.TimestampAnnotation) XMLAnnotation(ome.xml.model.XMLAnnotation) BooleanAnnotation(ome.xml.model.BooleanAnnotation) Test(org.testng.annotations.Test)

Example 13 with Annotation

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

the class InOutCurrentTest method testValidObjectiveAnnotation.

@Test(dependsOnMethods = { "testValidObjectiveNode" })
public void testValidObjectiveAnnotation() {
    Annotation n = ome.getInstrument(0).getObjective(0).getLinkedAnnotation(0);
    assertNotNull(n);
    assertEquals(OBJECTIVE_ANNOTATION_ID, n.getID());
    assertEquals(n.getNamespace(), GENERAL_ANNOTATION_NAMESPACE);
    assertTrue(n instanceof CommentAnnotation);
    CommentAnnotation string = (CommentAnnotation) n;
    assertEquals(OBJECTIVE_ANNOTATION_VALUE, string.getValue());
}
Also used : CommentAnnotation(ome.xml.model.CommentAnnotation) ListAnnotation(ome.xml.model.ListAnnotation) CommentAnnotation(ome.xml.model.CommentAnnotation) Annotation(ome.xml.model.Annotation) LongAnnotation(ome.xml.model.LongAnnotation) TimestampAnnotation(ome.xml.model.TimestampAnnotation) XMLAnnotation(ome.xml.model.XMLAnnotation) BooleanAnnotation(ome.xml.model.BooleanAnnotation) Test(org.testng.annotations.Test)

Example 14 with Annotation

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

the class InOutCurrentTest method testValidEmissionFilterAnnotation.

@Test(dependsOnMethods = { "testValidEmissionFilterNode" })
public void testValidEmissionFilterAnnotation() {
    Annotation n = ome.getInstrument(0).getFilter(0).getLinkedAnnotation(0);
    assertNotNull(n);
    assertEquals(EM_FILTER_ANNOTATION_ID, n.getID());
    assertEquals(n.getNamespace(), GENERAL_ANNOTATION_NAMESPACE);
    assertTrue(n instanceof CommentAnnotation);
    CommentAnnotation string = (CommentAnnotation) n;
    assertEquals(EM_FILTER_ANNOTATION_VALUE, string.getValue());
}
Also used : CommentAnnotation(ome.xml.model.CommentAnnotation) ListAnnotation(ome.xml.model.ListAnnotation) CommentAnnotation(ome.xml.model.CommentAnnotation) Annotation(ome.xml.model.Annotation) LongAnnotation(ome.xml.model.LongAnnotation) TimestampAnnotation(ome.xml.model.TimestampAnnotation) XMLAnnotation(ome.xml.model.XMLAnnotation) BooleanAnnotation(ome.xml.model.BooleanAnnotation) Test(org.testng.annotations.Test)

Example 15 with Annotation

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

the class InOutCurrentTest method testValidChannelAnnotation.

@Test(dependsOnMethods = { "testValidChannelNode" })
public void testValidChannelAnnotation() {
    Channel c = ome.getImage(0).getPixels().getChannel(0);
    Annotation n = c.getLinkedAnnotation(0);
    assertNotNull(n);
    assertTrue(n instanceof XMLAnnotation);
    assertEquals(CHANNEL_ANNOTATION_ID, n.getID());
    assertEquals(n.getNamespace(), GENERAL_ANNOTATION_NAMESPACE);
    assertEquals(CHANNEL_ANNOTATION_VALUE, ((XMLAnnotation) n).getValue());
}
Also used : Channel(ome.xml.model.Channel) XMLAnnotation(ome.xml.model.XMLAnnotation) ListAnnotation(ome.xml.model.ListAnnotation) CommentAnnotation(ome.xml.model.CommentAnnotation) Annotation(ome.xml.model.Annotation) LongAnnotation(ome.xml.model.LongAnnotation) TimestampAnnotation(ome.xml.model.TimestampAnnotation) XMLAnnotation(ome.xml.model.XMLAnnotation) BooleanAnnotation(ome.xml.model.BooleanAnnotation) Test(org.testng.annotations.Test)

Aggregations

Annotation (ome.xml.model.Annotation)17 XMLAnnotation (ome.xml.model.XMLAnnotation)17 Test (org.testng.annotations.Test)15 BooleanAnnotation (ome.xml.model.BooleanAnnotation)14 CommentAnnotation (ome.xml.model.CommentAnnotation)14 ListAnnotation (ome.xml.model.ListAnnotation)14 LongAnnotation (ome.xml.model.LongAnnotation)14 TimestampAnnotation (ome.xml.model.TimestampAnnotation)14 Image (ome.xml.model.Image)3 IOException (java.io.IOException)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)2 ModuloAnnotation (loci.formats.meta.ModuloAnnotation)2 OriginalMetadataAnnotation (loci.formats.meta.OriginalMetadataAnnotation)2 OMEXMLMetadataRoot (ome.xml.meta.OMEXMLMetadataRoot)2 Channel (ome.xml.model.Channel)2 Document (org.w3c.dom.Document)2 Node (org.w3c.dom.Node)2 NodeList (org.w3c.dom.NodeList)2 SAXException (org.xml.sax.SAXException)2 TransformerConfigurationException (javax.xml.transform.TransformerConfigurationException)1