public String getChannelAnnotationRef(int imageIndex, int channelIndex, int annotationRefIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // AnnotationRef is reference and occurs more than once return root.getImage(imageIndex).getPixels().getChannel(channelIndex).getLinkedAnnotation(annotationRefIndex).getID(); }
public String getChannelAnnotationRef(int imageIndex, int channelIndex, int annotationRefIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // AnnotationRef is reference and occurs more than once return root.getImage(imageIndex).getPixels().getChannel(channelIndex).getLinkedAnnotation(annotationRefIndex).getID(); }
@Test public void testValidXMLAnnotation() throws EnumerationException { assertNotNull(ome); assertEquals(1, ome.sizeOfImageList()); Image image = ome.getImage(0); Pixels pixels = image.getPixels(); assertNotNull(pixels); assertEquals(3, pixels.sizeOfChannelList()); Channel channel = pixels.getChannel(0); assertEquals(1, channel.sizeOfLinkedAnnotationList()); Annotation annotation = channel.getLinkedAnnotation(0); assertEquals(XMLAnnotation.class, annotation.getClass()); String annotationValue = ((XMLAnnotation) annotation).getValue(); // normalize line endings if the test is run on Windows annotationValue = annotationValue.replaceAll("\r\n", "\n"); assertEquals("<TestData>\n <key>foo</key>\n\t\t\t\t\t<value>bar</value>\n </TestData>", annotationValue); }
@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()); }