Page 1 of 1

Adding ROIs programmatically locally

PostPosted: Mon Aug 21, 2017 6:15 pm
by icaoberg
Hi Team
I have a collection of local OME.TIFFs and a collection of segmentations for each image in the first dataset. I would like to add ROIs to the OME.TIFF without connecting to an OMERO instance.

If this is not possible, then what is the appropriate workflow? In the past we had built a script that adds the ROI after the OME.TIFF has been uploaded

https://github.com/icaoberg/omepslid/bl ... _2dhela.py
https://github.com/icaoberg/omepslid/bl ... _3dhela.py

but again, we want to do it locally.

Re: Adding ROIs programmatically locally

PostPosted: Wed Aug 23, 2017 8:32 am
by bramalingam
Hi,

Thank you for sharing your code.

What you are looking for is a python implementation of the bio-formats ome-tiff Formatwriter. The CellProfiler team has written and maintained the following code,
https://github.com/CellProfiler/python- ... er.py#L456

The above code uses the python java bridge and the extension of logic used in the following java implementation should solve your problem,
https://github.com/openmicroscopy/biofo ... .java#L467

To highlight an example,
An implementation example for populating rectangle ROI’s in the metadata store can be found in the following lines,
https://github.com/openmicroscopy/biofo ... #L790-L793

Please take a look at the documentation for the MetadataStore class to get detailed information on the methods that are available,
http://static.javadoc.io/org.openmicros ... Store.html

Hope that helps.

Best,
Balaji