public void createRoot() { root = new OMEXMLMetadataRoot(); model = new OMEModelImpl(); }
public void createRoot() { root = new OMEXMLMetadataRoot(); model = new OMEModelImpl(); }
/** * Constructs an OME root node. <b>NOTE:</b> This method is mostly here to * ensure type safety of return values as instances of service dependency * classes should not leak out of the interface. * @param xml String of XML to create the root node from. * @return An ome.xml.model.OMEModelObject subclass root node. * @throws IOException If there is an error reading from the string. * @throws SAXException If there is an error parsing the XML. * @throws ParserConfigurationException If there is an error preparing the * parsing infrastructure. */ private OMEXMLMetadataRoot createRoot(String xml) throws ServiceException { try { OMEModel model = new OMEModelImpl(); OMEXMLMetadataRoot ome = new OMEXMLMetadataRoot(XMLTools.parseDOM(xml).getDocumentElement(), model); model.resolveReferences(); return ome; } catch (Exception e) { throw new ServiceException(e); } }
/** * Constructs an OME root node. <b>NOTE:</b> This method is mostly here to * ensure type safety of return values as instances of service dependency * classes should not leak out of the interface. * @param xml String of XML to create the root node from. * @return An ome.xml.model.OMEModelObject subclass root node. * @throws IOException If there is an error reading from the string. * @throws SAXException If there is an error parsing the XML. * @throws ParserConfigurationException If there is an error preparing the * parsing infrastructure. */ private OMEXMLMetadataRoot createRoot(String xml) throws ServiceException { try { OMEModel model = new OMEModelImpl(); OMEXMLMetadataRoot ome = new OMEXMLMetadataRoot(XMLTools.parseDOM(xml).getDocumentElement(), model); model.resolveReferences(); return ome; } catch (Exception e) { throw new ServiceException(e); } }
@Test public void testValidOMENode() throws EnumerationException { model = new OMEModelImpl(); // Read string XML in as a DOM tree and parse into the object hierarchy ome = new OMEXMLMetadataRoot(document.getDocumentElement(), model); model.resolveReferences(); assertNotNull(ome); assertEquals(1, ome.sizeOfImageList()); }
private int populateSPW(MetadataStore store, int screens, int plates, int rows, int cols, int fields, int acqs, boolean withMicrobeam) { final XMLMockObjects xml = new XMLMockObjects(); OME ome = null; if (screens==0) { ome = xml.createPopulatedPlate(plates, rows, cols, fields, acqs, withMicrobeam); } else { ome = xml.createPopulatedScreen(screens, plates, rows, cols, fields, acqs, withMicrobeam); } if (withMicrobeam) roiCount = roiCount + plates;; getOmeXmlMetadata().setRoot(new OMEXMLMetadataRoot(ome)); // copy populated SPW metadata into destination MetadataStore getOmeXmlService().convertMetadata(omeXmlMetadata, store); domains = new String[] {FormatTools.HCS_DOMAIN}; return ome.sizeOfImageList(); }
private int populateSPW(MetadataStore store, int screens, int plates, int rows, int cols, int fields, int acqs, boolean withMicrobeam) { final XMLMockObjects xml = new XMLMockObjects(); OME ome = null; if (screens==0) { ome = xml.createPopulatedPlate(plates, rows, cols, fields, acqs, withMicrobeam); } else { ome = xml.createPopulatedScreen(screens, plates, rows, cols, fields, acqs, withMicrobeam); } if (withMicrobeam) roiCount = roiCount + plates;; getOmeXmlMetadata().setRoot(new OMEXMLMetadataRoot(ome)); // copy populated SPW metadata into destination MetadataStore getOmeXmlService().convertMetadata(omeXmlMetadata, store); domains = new String[] {FormatTools.HCS_DOMAIN}; return ome.sizeOfImageList(); }
List<Image> images = root.copyImageList(); OMEXMLMetadataRoot convertRoot = new OMEXMLMetadataRoot(); convertRoot.addInstrument(instrument); for (int i=0; i<core.size()/images.size(); i++) {
List<Image> images = root.copyImageList(); OMEXMLMetadataRoot convertRoot = new OMEXMLMetadataRoot(); convertRoot.addInstrument(instrument); for (int i=0; i<core.size()/images.size(); i++) {
@BeforeClass public void setUp() throws Exception { metadata = new OMEXMLMetadataImpl(); OMEXMLMetadataRoot ome = new OMEXMLMetadataRoot(); Instrument instrument = new Instrument(); instrument.addLightSource(new Arc()); instrument.addLightSource(new Filament()); instrument.addLightSource(new Laser()); instrument.addLightSource(new LightEmittingDiode()); ome.addInstrument(instrument); metadata.setRoot(ome); }
public ObjectBasedOMEModelMock() { ome = new OMEXMLMetadataRoot(); annotations = new StructuredAnnotations(); ome.addImage(makeImage()); ome.addPlate(makePlate()); ome.addInstrument(makeInstrument()); ome.addROI(makeROI()); ome.setStructuredAnnotations(annotations); }