We're Hiring!

Missing getValue() method for OME metadata import in Matlab

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

Missing getValue() method for OME metadata import in Matlab

Postby Ajaxel » Mon Apr 20, 2015 8:14 am

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
Ajaxel
 
Posts: 14
Joined: Mon Apr 22, 2013 8:33 pm

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

Postby sbesson » Mon Apr 20, 2015 9:46 am

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
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

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

Postby Ajaxel » Mon Apr 20, 2015 10:11 am

Good work, thanks!
Ajaxel
 
Posts: 14
Joined: Mon Apr 22, 2013 8:33 pm

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

Postby Ajaxel » Mon Apr 20, 2015 10:18 am

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
Ajaxel
 
Posts: 14
Joined: Mon Apr 22, 2013 8:33 pm

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

Postby sbesson » Mon Apr 20, 2015 10:33 am

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
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest