We're Hiring!

How to convert metadata ROI info to actual pixels?

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.

How to convert metadata ROI info to actual pixels?

Postby jmfrank » Tue Jun 19, 2018 5:31 am

Hi there - hope this is the right place to ask...

I've recorded some FRAP data using a Zeiss LSM confocal, with a few ROI's in each image. I can successfully read the ROI info in the metadata from the .lsm file in MATLAB using the bfreader / getMetadataStore commands.

ROIs in the OME format are specified by values like x-position / y-position / radius / width / height / polygon points (depending on the ROI shape).

However, I'm looking for a definitive and general method for getting the actual pixels that are part of each ROI. I can write my own script for doing so, but it seems like the Zeiss LSM might be using specific rules about whether a pixel is inside a boundary. I.e. is the real-world xyz coordinate of a pixel defined by it's center or a corner of the pixel.

Is there an existing definition of how OME determines whether pixels are within an ROI? If so, how to I access this definition. Ideally, I'm looking for a solution that would work for using MATLAB, but if I can access the source code to any existing tool that would still be helpful.

Thanks!
jmfrank
 
Posts: 4
Joined: Sun Jun 17, 2018 2:08 am

Re: How to convert metadata ROI info to actual pixels?

Postby mtbc » Tue Jun 19, 2018 10:26 am

This is a fine place to ask. The implementations of https://downloads.openmicroscopy.org/la ... tCallback- are probably your best bet; the subclasses' source is all available at https://github.com/openmicroscopy/openmicroscopy in components/blitz/src/ and MATLAB allows relatively easy interoperation with Java.

I don't believe that we formally define how to interpret the abstract ROI model shapes (inclusivity of edges, etc.) but the above smart shape code appears to check if a tiny block at each pixel probably intersects with the shape: for example, a 2-wide 2-high rectangle at (0, 0) is considered to have (0, 0), (1, 0), (0, 1), (1, 1) within it. Be warned that when interchanging ROIs with other tools the interpretation may change, e.g., I wonder how some ImageJ analysis plugins may regard shape edges imported from OMERO.

Cheers,
Mark
User avatar
mtbc
Team Member
 
Posts: 282
Joined: Tue Oct 23, 2012 10:59 am
Location: Dundee, Scotland


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 0 guests