Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { p.add(new MapPair(((Element) child).getAttribute("K"), child.getTextContent()));
Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { p.add(new MapPair(((Element) child).getAttribute("K"), child.getTextContent()));
Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { p.add(new MapPair(((Element) child).getAttribute("K"), child.getTextContent()));
Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { p.add(new MapPair(((Element) child).getAttribute("K"), child.getTextContent()));
@Override public String dumpXML() { // insert resolution data as an annotation // TODO: doesn't allow for updating resolutions if (!written) { int annIndex = 0; try { annIndex = getMapAnnotationCount(); } catch (NullPointerException e) { // just means there are no other map annotations } for (int i=0; i<resolutions.size(); i++) { List<MapPair> resAnnotation = new ArrayList<MapPair>(); for (int r=1; r<resolutions.get(i).size(); r++) { resAnnotation.add( new MapPair(String.valueOf(r), resolutions.get(i).get(r).toString())); } String mapId = "Annotation:Resolution:" + i; setMapAnnotationID(mapId, annIndex); setMapAnnotationNamespace(NAMESPACE, annIndex); setMapAnnotationValue(resAnnotation, annIndex); annIndex++; } written = true; } return super.dumpXML(); }
@Override public String dumpXML() { // insert resolution data as an annotation // TODO: doesn't allow for updating resolutions if (!written) { int annIndex = 0; try { annIndex = getMapAnnotationCount(); } catch (NullPointerException e) { // just means there are no other map annotations } for (int i=0; i<resolutions.size(); i++) { List<MapPair> resAnnotation = new ArrayList<MapPair>(); for (int r=1; r<resolutions.get(i).size(); r++) { resAnnotation.add( new MapPair(String.valueOf(r), resolutions.get(i).get(r).toString())); } String mapId = "Annotation:Resolution:" + i; setMapAnnotationID(mapId, annIndex); setMapAnnotationNamespace(NAMESPACE, annIndex); setMapAnnotationValue(resAnnotation, annIndex); annIndex++; } written = true; } return super.dumpXML(); }
Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { p.add(new MapPair(((Element) child).getAttribute("K"), child.getTextContent()));
Node child = children.item(i); if (child.getNodeType() == Node.ELEMENT_NODE) { p.add(new MapPair(((Element) child).getAttribute("K"), child.getTextContent()));
@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); }
@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); }
geSource.setID("LightSource:0"); List<MapPair> dataMap = new ArrayList<MapPair>(); dataMap.add(new MapPair("a", "1")); dataMap.add(new MapPair("d", "2")); dataMap.add(new MapPair("c", "3")); dataMap.add(new MapPair("b", "4")); dataMap.add(new MapPair("e", "5")); dataMap.add(new MapPair("c", "6")); assertEquals(6, dataMap.size()); geSource.setMap(dataMap);
List<MapPair> mapValue = new ArrayList<MapPair>(); for (int keyNum=0; keyNum<10; keyNum++) { mapValue.add(new MapPair("keyS" + imageIndex + "N" + keyNum, "val" + (keyNum+1)*(annotationCount+1)));
List<MapPair> mapValue = new ArrayList<MapPair>(); for (int keyNum=0; keyNum<10; keyNum++) { mapValue.add(new MapPair("keyS" + imageIndex + "N" + keyNum, "val" + (keyNum+1)*(annotationCount+1)));