Do note that the terminology here is slightly tricky. OMEXMLReader refers to reading data from an OME-XML file; OMEXMLService/OMEXMLMetadata refers to using objects from the ome.xml.model package (http://downloads.openmicroscopy.org/bio ... mmary.html) to store metadata in a format-independent manner, for querying or when exporting a file to a different format.
well, that clears up a misconception.
in the end, I think, I'm going to deal with my problem in a similar fashion this reader deals with it:
https://github.com/openmicroscopy/bioformats/blob/v5.1.2/components/formats-gpl/src/loci/formats/in/OperettaReader.java by subclassing from FormatReader and overrriding the relevant sections.
I'm going to extract the individual file location from the meta-data (XML) and read the tiff data via the tiff reader. That way I get my desired group behavior and one file extraction logic over the indices (dimensions).
There is only one piece of advice that would be useful: Aiming at accessing OME XML for the purpose of meta-info extraction I struggle to get through the encapsulation used:
- Code: Select all
OMEXMLMetadataRoot root = (OMEXMLMetadataRoot) reader.getMetadataStoreRoot();
so working with the OMEXMLMetadataRoot my way from the root upwards to then iterate over some elements (TiffData e.g.) is not exactly elegant (using array out of bounds to know the end) since I could not find convenient getters to do so (and array length). Did I miss a method to get to the elements by name?
I suppose, alternatively, I could abandon the idea in favor of a more custom solution (since I plan to extend from FormatReader) to do it in a fashion the above mentioned reader does (and writing my own handler for the xml):
- Code: Select all
String xmlData = DataTools.readFile(id);
OperettaHandler handler = new OperettaHandler();
XMLTools.parseXML(xmlData, handler);
ArrayList<Plane> planeList = handler.getPlanes();
....