monashmicroimaging / podocytes

GNU General Public License v3.0
2 stars 3 forks source link

Retrieve the units for physical pixel size from image metadata #12

Open GenevieveBuckley opened 6 years ago

GenevieveBuckley commented 6 years ago

The metadata retrieved by pims bioformats.py does not include unit information for PixelsPhysicalSizeX, PixelsPhysicalSizeY, PixelsPhysicalSizeZ, etc.

This is likely because that information is contained in the OME XML metadata instead. Maybe we can extend pims to also retrieve this information, similar to the approach taken in lifio.py

import pims
images = pims.open(filename)
images.bundle_axes = 'zyxc'
meta = images.metadata
GenevieveBuckley commented 6 years ago

Upon further investigation pims is looking at the OME metadata, but this is because the loci MetadataRetrieve interface does not contain methods to retrieve the unit information for the physical pixel sizes (eg: getPixelsPhysicalSizeXUnit or similar).

This interface does have the methods getPixelsPhysicalSizeX, getPixelsPhysicalSizeY, getPixelsPhysicalSizeZ, etc., so that's why we can see that information in the pims metadata object.