[ome-devel] parse ROIs in Reader class
Christoph Sommer
christoph.sommer at imba.oeaw.ac.at
Wed Jun 25 18:27:23 BST 2014
Hi all,
I am currently trying to read segmentations from the cellh5 format. The
image data in there is 5D.
My aim is to populate the ROI manager of ImageJ with the correct
segmentation per channel, time and z-slice.
Here's a minimal example for just one artificial ROI, that should create
a PolyLine for T == 5, C==2, and Z == 1 and - importantly - only display
the ROI, when I navigate to the according C, Z, T position in the
hyperstack viewer. However, the ROI is displayed on all slices. I tried
checking "Associate Show all ROIs with slices" without success.
> int roiIndex = 0;
> int shapeIndex = 0;
> String polylineID = MetadataTools.createLSID("Shape", roiIndex,
> shapeIndex);
> store.setPolygonID(polylineID, roiIndex, shapeIndex);
> store.setPolygonPoints("10,10 200,10 200,300 10,200", roiIndex,
> shapeIndex);
> String roiID = MetadataTools.createLSID("ROI", roiIndex, shapeIndex);
> store.setPolygonTheT(new NonNegativeInteger(5), roiIndex, shapeIndex);
> store.setPolygonTheC(new NonNegativeInteger(2), roiIndex, shapeIndex);
> store.setPolygonTheZ(new NonNegativeInteger(1), roiIndex, shapeIndex);
> store.setPolygonLocked(true, roiIndex, shapeIndex);
> store.setROIID(roiID, roiIndex);
> store.setImageROIRef(roiID, 0, roiIndex);
Unfortunately, when I open it in Fiji as hyperstack, the ROI is not
aware of its C,Z,T. If I set it manually using "Properties..." from the
ROI Manager it works...
Cheers,
Christoph
More information about the ome-devel
mailing list