public void setPixelsDimensionOrder(DimensionOrder dimensionOrder, int imageIndex) { // Parents: {u'Image': {u'OME': None}} // DimensionOrder is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getPixels() == null) { o1.setPixels(new Pixels()); } Pixels o2 = o1.getPixels(); o2.setDimensionOrder(dimensionOrder); }
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 void setImageDescription(String description, int imageIndex) { // Parents: {u'OME': None} // Description is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); o1.setDescription(description); }
public void setImageAcquisitionDate(Timestamp acquisitionDate, int imageIndex) { // Parents: {u'OME': None} // AcquisitionDate is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); o1.setAcquisitionDate(acquisitionDate); }
if (!element.hasAttribute("ID") && getID() == null) setID(String.valueOf( element.getAttribute("ID"))); model.addModelObject(getID(), this); setName(String.valueOf( element.getAttribute("Name"))); getChildrenByTagName(element, "AcquisitionDate"); if (AcquisitionDate_nodeList.size() > 1) setAcquisitionDate( Timestamp.valueOf(AcquisitionDate_nodeList.get(0).getTextContent())); getChildrenByTagName(element, "ExperimenterRef"); for (Element ExperimenterRef_element : ExperimenterRef_nodeList) getChildrenByTagName(element, "Description"); if (Description_nodeList.size() > 1) setDescription( String.valueOf(Description_nodeList.get(0).getTextContent())); getChildrenByTagName(element, "ExperimentRef"); for (Element ExperimentRef_element : ExperimentRef_nodeList) getChildrenByTagName(element, "ExperimenterGroupRef");
/** Sets the Map value associated with this imaging environment */ public void setImagingEnvironmentMap(List<MapPair> map, int imageIndex) { OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getImagingEnvironment() == null) { o1.setImagingEnvironment(new ImagingEnvironment()); } ImagingEnvironment o2 = o1.getImagingEnvironment(); o2.setMap(map); }
public int getTiffDataCount(int imageIndex) { // Parents: {u'Pixels': {u'Image': {u'OME': None}}} // TiffData is not a reference return root.getImage(imageIndex).getPixels().sizeOfTiffDataList(); }
public void setObjectiveSettingsCorrectionCollar(Double correctionCollar, int imageIndex) { // Parents: {u'Image': {u'OME': None}} // CorrectionCollar is not a reference OME o0 = root; if (o0.sizeOfImageList() == imageIndex) { o0.addImage(new Image()); } Image o1 = o0.getImage(imageIndex); if (o1.getObjectiveSettings() == null) { o1.setObjectiveSettings(new ObjectiveSettings()); } ObjectiveSettings o2 = o1.getObjectiveSettings(); o2.setCorrectionCollar(correctionCollar); }
populateInstrument(); Image image = new Image(); image.setID("Image:"+index); image.setName("Image Name "+index); image.setDescription("Image Description "+index); if (metadata) { image.setImagingEnvironment(createImageEnvironment()); image.setStageLabel(createStageLabel()); image.setPixels(pixels); return image;
@BeforeClass public void setUp() throws Exception { // Add an Image/Pixels Image image = new Image(); image.setID("Image:0"); Pixels pixels = new Pixels(); pixels.setID("Pixels:0"); image.setPixels(pixels); // Add a Map Annotation List<MapPair> map = new ArrayList<MapPair>(); map.add(new MapPair("a", "1")); map.add(new MapPair("d", "2")); map.add(new MapPair("c", "3")); map.add(new MapPair("b", "4")); map.add(new MapPair("e", "5")); map.add(new MapPair("c", "6")); MapAnnotation mapAnnotation = new MapAnnotation(); mapAnnotation.setID("Annotation:0"); mapAnnotation.setValue(map); StructuredAnnotations structuredAnnotations = new StructuredAnnotations(); structuredAnnotations.addMapAnnotation(mapAnnotation); ome.setStructuredAnnotations(structuredAnnotations ); image.linkAnnotation(mapAnnotation); ome.addImage(image); }
Image image = new Image(); image.setID("Image:" + index); CommentAnnotation commentAnnotation = new CommentAnnotation(); commentAnnotation.setID("Annotation:" + index); commentAnnotation.setValue("Image:" + index + " annotation."); annotations.addCommentAnnotation(commentAnnotation); image.linkAnnotation(commentAnnotation); image.setPixels(pixels); image.linkInstrument(instrument); image.setObjectiveSettings(settings); return image;
@BeforeClass public void setUp() throws Exception { // Add an Image/Pixels Image image = new Image(); image.setID("Image:0"); Pixels pixels = new Pixels(); pixels.setID("Pixels:0"); image.setPixels(pixels); // Add an ImagingEnvironment with an Map ImagingEnvironment imagingEnvironment = new ImagingEnvironment(); List<MapPair> map = new ArrayList<MapPair>(); map.add(new MapPair("a", "1")); map.add(new MapPair("d", "2")); map.add(new MapPair("c", "3")); map.add(new MapPair("b", "4")); map.add(new MapPair("e", "5")); map.add(new MapPair("c", "6")); assertEquals(6, map.size()); imagingEnvironment.setMap(map); image.setImagingEnvironment(imagingEnvironment); ome.addImage(image); }
for (int i=0; i<img.sizeOfLinkedAnnotationList(); i++) { Annotation annotation = img.getLinkedAnnotation(i); if (!(annotation instanceof XMLAnnotation)) { continue;
@Test (groups = {"11-06-i-links"}, dependsOnGroups = {"11-06-i-image", "11-06-i-instrument", "11-06-i-lightsourcelinks", "11-06-i-filterset", "11-06-i-detector"}) public void testImage0Linkage() { Assert.assertNotNull(image0); Assert.assertEquals(0, image0.sizeOfLinkedAnnotationList()); Assert.assertEquals(0, image0.sizeOfLinkedROIList()); Assert.assertEquals(instrument0, image0.getLinkedInstrument()); }
@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()); }
/** * Creates an image with acquisition data. * * @return See above. */ public OME createImageWithAcquisitionData() { populateInstrument(); Image image = createImage(0, true); ObjectiveSettings settings = createObjectiveSettings(0); image.setObjectiveSettings(settings); //Add microbeam Experiment exp = createExperiment(0); ome.addExperiment(exp); MicrobeamManipulation mm = createMicrobeamManipulation(0); exp.addMicrobeamManipulation(mm); image.linkExperiment(exp); image.linkInstrument(instrument); image.linkMicrobeamManipulation(mm); ome.addImage(image); return ome; }
@Test (groups = {"11-06-i-image"}, dependsOnMethods = {"testImage0Name"}) public void testImage0Values() { Assert.assertNotNull(image0); Assert.assertEquals(ref.Image0AcquiredDate, image0.getAcquisitionDate()); Assert.assertEquals(ref.Image0Description, image0.getDescription()); }