Page 1 of 1

Missing getValue() method for OME metadata import in Matlab

PostPosted: Mon Apr 20, 2015 8:14 am
by Ajaxel
Hello,
the following code from http://www.openmicroscopy.org/site/supp ... b-dev.html
gives error due to missing getValue method:

Code: Select all
data = bfopen('/path/to/data/file');
omeMeta = data{1, 4};

voxelSizeX = omeMeta.getPixelsPhysicalSizeX(0).getValue(); % in µm
voxelSizeY = omeMeta.getPixelsPhysicalSizeY(0).getValue(); % in µm
voxelSizeZ = omeMeta.getPixelsPhysicalSizeZ(0).getValue(); % in µm



tested with bioformats_package.jar 5.1.0

Re: Missing getValue() method for OME metadata import in Mat

PostPosted: Mon Apr 20, 2015 9:46 am
by sbesson
Hi,

you are absolutely correct, the MATLAB documentation had not been updated as part of 5.1.0 to cover the new methods to retrieve physical pixel size with the new units. A Pull Request had been opened to fix the documentation but we did not update it. The documentation has just been re-released live with this change so the MATLAB documentation page should be up-to-date now.

Thanks for notifying us and let us know if you anything is unclear or not working.

Best,
Sebastien

Re: Missing getValue() method for OME metadata import in Mat

PostPosted: Mon Apr 20, 2015 10:11 am
by Ajaxel
Good work, thanks!

Re: Missing getValue() method for OME metadata import in Mat

PostPosted: Mon Apr 20, 2015 10:18 am
by Ajaxel
ohh, one other thing:
the class returned with the .value(ome.units.UNITS.MICROM) method is java.lang.Double.
I guess it should be converted to matlab double?

Best regards,
Ilya

Re: Missing getValue() method for OME metadata import in Mat

PostPosted: Mon Apr 20, 2015 10:33 am
by sbesson
Hi Ilya,

yes absolutely, you should be able to use conversion methods like `doubleValue` e.g.

Code: Select all
pixelSixeX = physicalSizeX.value(ome.units.UNITS.NM).doubleValue();


This is definitely worth adding to the code snippets.

Thanks,
Sebastien