use of ome.xml.model.OME in project bioformats by openmicroscopy.
the class ImagingEnvironmentMapTest method testGenericExcitationSourceValid.
@Test
public void testGenericExcitationSourceValid() 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();
}
use of ome.xml.model.OME in project bioformats by openmicroscopy.
the class PrintROIs method printROI.
/**
* Print all of the shapes associated with the specified ROI.
*/
public static void printROI(IMetadata omexml, int roi) {
String roiID = omexml.getROIID(roi);
System.out.println("ROI #" + roi + " (ID = " + roiID + ")");
System.out.println(" Name = " + omexml.getROIName(roi));
int shapeCount = omexml.getShapeCount(roi);
System.out.println(" Number of shapes = " + shapeCount);
// Note that it is not possible to retrieve the shape's type
// from the IMetadata object; you must use the underlying model
// objects to determine the shape type.
OME root = (OME) omexml.getRoot();
Union allShapes = root.getROI(roi).getUnion();
for (int shape = 0; shape < shapeCount; shape++) {
Shape shapeObject = allShapes.getShape(shape);
printShape(shapeObject);
}
}
use of ome.xml.model.OME in project bioformats by openmicroscopy.
the class BackReferenceTest method testPlateWellReferences.
@Test
public void testPlateWellReferences() {
metadata.setPlateID("Plate:0", 0);
metadata.setWellID("Well:0:0", 0, 0);
OME root = (OME) metadata.getRoot();
Plate plate = root.getPlate(0);
Well well = plate.getWell(0);
assertNotNull(plate);
assertNotNull(well);
assertEquals(plate, well.getPlate());
}
use of ome.xml.model.OME in project bioformats by openmicroscopy.
the class FakeReader method populateSPW.
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();
}
Aggregations