CellProfiler / python-bioformats

Read and write life sciences file formats
Other
131 stars 45 forks source link

How to extract metadata? #151

Open vbmade2000 opened 2 years ago

vbmade2000 commented 2 years ago

I am using python-bioformats to extract metadata from the Tif file.

I found a method called getMetadata which returns some Java object (as it says). This returned object has only one public method called addr(). This addr() method returns some number and I don't know how to use that number.

I want to extract all the metadata from a file. Can someone help me here?

FMagnani commented 1 year ago

For me, a method called get_omexml_metadata works well. It's a method of bioformats and its argument is the path for the file. For example, md_string = bioformats.get_omexml_metadata(pathToFile). I then copy-paste md_string into a file with extension .xml which can be opened by a browser.

I did this for a .vsi file, not a .tif, but it's worth to try.