public String getImageAnnotationRef(int imageIndex, int annotationRefIndex) { // Parents: {u'OME': None} // AnnotationRef is reference and occurs more than once return root.getImage(imageIndex).getLinkedAnnotation(annotationRefIndex).getID(); }
public String getImageAnnotationRef(int imageIndex, int annotationRefIndex) { // Parents: {u'OME': None} // AnnotationRef is reference and occurs more than once return root.getImage(imageIndex).getLinkedAnnotation(annotationRefIndex).getID(); }
Annotation annotation = img.getLinkedAnnotation(i); if (!(annotation instanceof XMLAnnotation)) { continue;
Annotation annotation = img.getLinkedAnnotation(i); if (!(annotation instanceof XMLAnnotation)) { continue;
Annotation annotation = img.getLinkedAnnotation(i); if (!(annotation instanceof XMLAnnotation)) { continue;
Annotation annotation = img.getLinkedAnnotation(i); if (!(annotation instanceof XMLAnnotation)) { continue;
String xmlID = meta.getXMLAnnotationID(idx); for (int link=0; link<image.sizeOfLinkedAnnotationList(); link++) { if (xmlID.equals(image.getLinkedAnnotation(link).getID()))
String xmlID = meta.getXMLAnnotationID(idx); for (int link=0; link<image.sizeOfLinkedAnnotationList(); link++) { if (xmlID.equals(image.getLinkedAnnotation(link).getID()))
@Test public void testMapAnnotationValueContent() throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder parser = factory.newDocumentBuilder(); Document document = parser.newDocument(); // Produce a valid OME DOM element hierarchy Element root = ome.asXMLElement(document); SPWModelMock.postProcess(root, document, false); OMEModel model = new OMEModelImpl(); ome = new OME(document.getDocumentElement(), model); model.resolveReferences(); assertNotNull(ome); assertEquals(ome.getImage(0).getPixels().getID(), "Pixels:0"); assertNotNull(ome.getImage(0).getLinkedAnnotation(0)); MapAnnotation mapAnnotation = (MapAnnotation) ome.getImage(0).getLinkedAnnotation(0); List<MapPair> dataMap = mapAnnotation.getValue(); assertEquals(6, dataMap.size()); assertEquals("a", dataMap.get(0).getName()); assertEquals("1", dataMap.get(0).getValue()); assertEquals("d", dataMap.get(1).getName()); assertEquals("2", dataMap.get(1).getValue()); assertEquals("c", dataMap.get(2).getName()); assertEquals("3", dataMap.get(2).getValue()); assertEquals("b", dataMap.get(3).getName()); assertEquals("4", dataMap.get(3).getValue()); assertEquals("e", dataMap.get(4).getName()); assertEquals("5", dataMap.get(4).getValue()); assertEquals("c", dataMap.get(5).getName()); assertEquals("6", dataMap.get(5).getValue()); }
@Test(dependsOnMethods={"testValidImageNode"}) public void testValidImageAnnotation() { Annotation n = ome.getImage(0).getLinkedAnnotation(0); assertNotNull(n); assertEquals(ListAnnotation.class, n.getClass()); ListAnnotation l = (ListAnnotation) n; assertEquals(l.getID(), IMAGE_LIST_ANNOTATION_ID); assertEquals(l.getNamespace(), GENERAL_ANNOTATION_NAMESPACE); Annotation n2 = l.getLinkedAnnotation(0); assertEquals(BooleanAnnotation.class, n2.getClass()); BooleanAnnotation b = (BooleanAnnotation) n2; assertEquals(b.getValue(), IMAGE_ANNOTATION_VALUE); assertEquals(b.getNamespace(), GENERAL_ANNOTATION_NAMESPACE); assertEquals(b.getID(), IMAGE_ANNOTATION_ID); }