/** Sets the Map value associated with this annotation */ public void setMapAnnotationValue(List<MapPair> value, int mapAnnotationIndex) { OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfMapAnnotationList() == mapAnnotationIndex) { o1.addMapAnnotation(new MapAnnotation()); } MapAnnotation o2 = o1.getMapAnnotation(mapAnnotationIndex); o2.setValue(value); }
/** Sets the Map value associated with this annotation */ public void setMapAnnotationValue(List<MapPair> value, int mapAnnotationIndex) { OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfMapAnnotationList() == mapAnnotationIndex) { o1.addMapAnnotation(new MapAnnotation()); } MapAnnotation o2 = o1.getMapAnnotation(mapAnnotationIndex); o2.setValue(value); }
public void setListAnnotationDescription(String description, int listAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Description is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfListAnnotationList() == listAnnotationIndex) { o1.addListAnnotation(new ListAnnotation()); } ListAnnotation o2 = o1.getListAnnotation(listAnnotationIndex); o2.setDescription(description); }
public void setLongAnnotationAnnotator(String annotator, int longAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Annotator is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfLongAnnotationList() == longAnnotationIndex) { o1.addLongAnnotation(new LongAnnotation()); } LongAnnotation o2 = o1.getLongAnnotation(longAnnotationIndex); o2.setAnnotator(annotator); }
public void setLongAnnotationNamespace(String namespace, int longAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Namespace is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfLongAnnotationList() == longAnnotationIndex) { o1.addLongAnnotation(new LongAnnotation()); } LongAnnotation o2 = o1.getLongAnnotation(longAnnotationIndex); o2.setNamespace(namespace); }
public void setXMLAnnotationDescription(String description, int XMLAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Description is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfXMLAnnotationList() == XMLAnnotationIndex) { o1.addXMLAnnotation(new XMLAnnotation()); } XMLAnnotation o2 = o1.getXMLAnnotation(XMLAnnotationIndex); o2.setDescription(description); }
public void setBooleanAnnotationDescription(String description, int booleanAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Description is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfBooleanAnnotationList() == booleanAnnotationIndex) { o1.addBooleanAnnotation(new BooleanAnnotation()); } BooleanAnnotation o2 = o1.getBooleanAnnotation(booleanAnnotationIndex); o2.setDescription(description); }
public void setBooleanAnnotationNamespace(String namespace, int booleanAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Namespace is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfBooleanAnnotationList() == booleanAnnotationIndex) { o1.addBooleanAnnotation(new BooleanAnnotation()); } BooleanAnnotation o2 = o1.getBooleanAnnotation(booleanAnnotationIndex); o2.setNamespace(namespace); }
public void setCommentAnnotationAnnotator(String annotator, int commentAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Annotator is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfCommentAnnotationList() == commentAnnotationIndex) { o1.addCommentAnnotation(new CommentAnnotation()); } CommentAnnotation o2 = o1.getCommentAnnotation(commentAnnotationIndex); o2.setAnnotator(annotator); }
public void setFileAnnotationDescription(String description, int fileAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Description is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfFileAnnotationList() == fileAnnotationIndex) { o1.addFileAnnotation(new FileAnnotation()); } FileAnnotation o2 = o1.getFileAnnotation(fileAnnotationIndex); o2.setDescription(description); }
public void setMapAnnotationDescription(String description, int mapAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Description is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfMapAnnotationList() == mapAnnotationIndex) { o1.addMapAnnotation(new MapAnnotation()); } MapAnnotation o2 = o1.getMapAnnotation(mapAnnotationIndex); o2.setDescription(description); }
public void setTagAnnotationAnnotator(String annotator, int tagAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Annotator is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfTagAnnotationList() == tagAnnotationIndex) { o1.addTagAnnotation(new TagAnnotation()); } TagAnnotation o2 = o1.getTagAnnotation(tagAnnotationIndex); o2.setAnnotator(annotator); }
public void setTermAnnotationDescription(String description, int termAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Description is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfTermAnnotationList() == termAnnotationIndex) { o1.addTermAnnotation(new TermAnnotation()); } TermAnnotation o2 = o1.getTermAnnotation(termAnnotationIndex); o2.setDescription(description); }
public void setTagAnnotationAnnotator(String annotator, int tagAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Annotator is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfTagAnnotationList() == tagAnnotationIndex) { o1.addTagAnnotation(new TagAnnotation()); } TagAnnotation o2 = o1.getTagAnnotation(tagAnnotationIndex); o2.setAnnotator(annotator); }
public void setTermAnnotationValue(String value, int termAnnotationIndex) { // Parents: {u'StructuredAnnotations': {u'OME': None}} // Value is not a reference OME o0 = root; if (o0.getStructuredAnnotations() == null) { o0.setStructuredAnnotations(new StructuredAnnotations()); } StructuredAnnotations o1 = o0.getStructuredAnnotations(); if (o1.sizeOfTermAnnotationList() == termAnnotationIndex) { o1.addTermAnnotation(new TermAnnotation()); } TermAnnotation o2 = o1.getTermAnnotation(termAnnotationIndex); o2.setValue(value); }
@Test (groups = {"11-06-u-annotation"}, dependsOnMethods = {"testOmeNode"}) public void testAnnotations() { Assert.assertNotNull(ome); annotations = ome.getStructuredAnnotations(); Assert.assertEquals(2, annotations.sizeOfXMLAnnotationList()); Assert.assertEquals(0, annotations.sizeOfBooleanAnnotationList()); Assert.assertEquals(0, annotations.sizeOfCommentAnnotationList()); Assert.assertEquals(0, annotations.sizeOfDoubleAnnotationList()); Assert.assertEquals(0, annotations.sizeOfFileAnnotationList()); Assert.assertEquals(0, annotations.sizeOfListAnnotationList()); Assert.assertEquals(0, annotations.sizeOfLongAnnotationList()); Assert.assertEquals(0, annotations.sizeOfTagAnnotationList()); Assert.assertEquals(0, annotations.sizeOfTermAnnotationList()); Assert.assertEquals(0, annotations.sizeOfTimestampAnnotationList()); }
@Test public void testOmeNode() { Assert.assertNotNull(ome); Assert.assertEquals(1, ome.sizeOfDatasetList()); Assert.assertEquals(5, ome.sizeOfExperimenterGroupList()); Assert.assertEquals(7, ome.sizeOfExperimenterList()); Assert.assertEquals(1, ome.sizeOfImageList()); Assert.assertEquals(1, ome.sizeOfInstrumentList()); Assert.assertEquals(2, ome.sizeOfPlateList()); Assert.assertEquals(1, ome.sizeOfProjectList()); Assert.assertEquals(5, ome.sizeOfROIList()); Assert.assertEquals(4, ome.sizeOfScreenList()); Assert.assertNull(ome.getCreator()); Assert.assertNull(ome.getUUID()); Assert.assertNotNull(ome.getStructuredAnnotations()); }
@Test public void testOmeNode() { Assert.assertNotNull(ome); Assert.assertEquals(0, ome.sizeOfDatasetList()); Assert.assertEquals(0, ome.sizeOfExperimenterGroupList()); Assert.assertEquals(0, ome.sizeOfExperimenterList()); Assert.assertEquals(1, ome.sizeOfImageList()); Assert.assertEquals(1, ome.sizeOfInstrumentList()); Assert.assertEquals(0, ome.sizeOfPlateList()); Assert.assertEquals(0, ome.sizeOfProjectList()); Assert.assertEquals(0, ome.sizeOfROIList()); Assert.assertEquals(0, ome.sizeOfScreenList()); Assert.assertNull(ome.getCreator()); Assert.assertNull(ome.getUUID()); Assert.assertNull(ome.getStructuredAnnotations()); }
@Test public void testOriginalMetadata() throws ServiceException { OMEXMLMetadata metadata = service.createOMEXMLMetadata(); service.populateOriginalMetadata(metadata, "testKey", "testValue"); Hashtable metadataTable = service.getOriginalMetadata(metadata); assertEquals(metadataTable.size(), 1); assertTrue("testValue".equals(metadataTable.get("testKey"))); OME root = (OME) metadata.getRoot(); StructuredAnnotations annotations = root.getStructuredAnnotations(); assertEquals(annotations.sizeOfXMLAnnotationList(), 1); XMLAnnotation xmlAnn = annotations.getXMLAnnotation(0); String txt = "<OriginalMetadata><Key>testKey</Key><Value>testValue</Value></OriginalMetadata>"; assertEquals(txt, xmlAnn.getValue()); OriginalMetadataAnnotation omAnn = (OriginalMetadataAnnotation) xmlAnn; assertEquals("testValue", omAnn.getValueForKey()); }
@Test public void validateUpgrade() throws ServiceException { assertEquals(1, ome.sizeOfImageList()); // StringAnnotation --> CommentAnnotation StructuredAnnotations structuredAnnotations = ome.getStructuredAnnotations(); assertNotNull(structuredAnnotations); assertEquals(1, structuredAnnotations.sizeOfCommentAnnotationList()); CommentAnnotation commentAnnotation = structuredAnnotations.getCommentAnnotation(0); assertEquals("StringAnnotation:0", commentAnnotation.getID()); assertEquals("Transform", commentAnnotation.getNamespace()); assertEquals("Foobar", commentAnnotation.getValue()); }