Hi,
Is there a way to read metada using bioformat api from python script ? Should I go through pyhton-bioformat library from cell profiler ???
Thanks
Philippe
>>> import javabridge as jv
>>> import bioformats as bf
>>> from xml.etree import ElementTree as et
>>> jv.start_vm(class_path=bf.JARS, max_heap_size='8G')
>>> md = bf.get_omexml_metadata('CFPNEAT01_R3D.dv')
>>> mdroot = et.fromstring(md.encode('utf-8'))
>>> len(mdroot)
3
>>> for a in mdroot[1]:
... print((a.tag, a.attrib))
...
('{http://www.openmicroscopy.org/Schemas/OME/2013-06}AcquisitionDate', {})
('{http://www.openmicroscopy.org/Schemas/OME/2013-06}InstrumentRef', {'ID': 'Instrument:0'})
('{http://www.openmicroscopy.org/Schemas/OME/2013-06}ObjectiveSettings', {'ID': 'Objective:12404'})
('{http://www.openmicroscopy.org/Schemas/OME/2013-06}Pixels', {'SizeT': '1', 'DimensionOrder': 'XYZCT', 'PhysicalSizeY': '0.1269800066947937', 'PhysicalSizeX': '0.1269800066947937', 'PhysicalSizeZ': '0.20000000298023224', 'SizeX': '512', 'SizeY': '512', 'SizeZ': '29', 'BigEndian': 'false', 'Interleaved': 'false', 'SizeC': '2', 'Type': 'uint16', 'ID': 'Pixels:0', 'SignificantBits': '16'})
>>> jv.kill_vm()
pip install python-bioformats
Return to User Discussion [Legacy]
Users browsing this forum: No registered users and 1 guest