Hi,
I'm trying to use bfconvert to convert my LSM files into OME-XML. Unfortunately, all the data I need is not present in the XML. During my experiment I apply electrical stimulation (marked by events in LSM) and sometimes pause acquisition, so it is necessary for me to retrieve data about events and timestamps from the LSM file. In my python code, that I've been using so far, it's relatively easy for me to read the data at OffsetEvenList and OffsetTimeStamps locations in the LSM. I see that in OMEXMLMetadata class I might be able to access timestamp information, but how to go about finding event info? The strange thing is that showinf command actually displays all the event data, but I'm not sure how to access it.
All of the metadata that you see with the showinf command will be preserved if you convert the file to OME-TIFF, but if there is no corresponding place for it in the OME-XML schema it will be stored in the XMLAnnotation elements under the top-level StructuredAnnotations element. For example, if you see this key/value pair in the output from showinf:
- Code: Select all
Recording #1 Special Scan Mode: FocusStep
then the corresponding piece of OME-XML would be:
- Code: Select all
<XMLAnnotation ID="Annotation:0">
<Value>
<OriginalMetadata xmlns="openmicroscopy.org/OriginalMetadata">
<Key>Recording #1 Special Scan Mode</Key>
<Value>FocusStep</Value>
</OriginalMetadata>
</Value>
</XMLAnnotation>
Note that you may need to update to the latest trunk build of Bio-Formats in order for the metadata to be preserved correctly, as there was a (recently fixed) bug that prevented some of the metadata from being stored in XMLAnnotations.
You can retrieve all of the XMLAnnotations from an OMEXMLMetadata object as follows:
- Code: Select all
//metadata is an instance of MetadataRetrieve (e.g. OMEXMLMetadata)
int numAnnotations = metadata.getXMLAnnotationCount();
for (int i=0; i<numAnnotations; i++) {
String xml = metadata.getXMLAnnotationValue(i);
}
You can then parse the 'xml' Strings to find the key and value.
Hopefully that helps, but please do let us know if you have any further questions.
Regards,
-Melissa