from idr import connection conn = connection('idr.openmicroscopy.org', 'public', 'public') # %matplotlib inline imageId = 1229801 # Pixels and Channels will be loaded automatically as needed image = conn.getObject("Image", imageId) roi_service = conn.getRoiService() result = roi_service.findByImage(imageId, None) roi = result.rois roi_image = roi.getImage() # UnloadedEntityException: Object unloaded:object #0 (::omero::model::Image) roi_shape = roi.getPrimaryShape() roi_points = roi_shape.getPoints() string_points = roi_points.getValue()
Using the idr-py package in python I have been extract images from the IDR succesfully. As far as I understand idr-py is a wrapper for the omero blitz-gateway to the IDR (please correct me if I’ve wrong). Now, firstly I’m struggling to find much decent documentation on using the idr-py api and the blitzgateway documentation either I can’t find or it’s slim (if anyone could help with that I’d grateful).
With this in mind I can’t seem to pull ROIs off of the IDR in a sensible format, see code above). Following the obvious trail of get functions, getImage on an ROI object fails
# UnloadedEntityException: Object unloaded:object #0 (::omero::model::Image)
Using getPrimary shape leads down a trail where you get a coordinate pair string, I’m happy to parse this and make my own ROI masks from it, but it feels like I’ve gone the wrong way if this is what i’ll end up doing.
Any advice welcome on how to properly extract ROIs from IDR images.