[ome-devel] How to use masks for Rois ?

Curtis Rueden ctrueden at wisc.edu
Wed May 23 21:37:55 BST 2018


Hi Thomas & everyone,

Relatedly, I'd like to draw your attention to the ImageJ-OMERO project [1].
It now supports upload/download of ImgLib2-style ROIs (part of the
imglib2-roi since 0.5.0 released in February) to/from OMERO; a new release
of ImageJ-OMERO is forthcoming, and we will be presenting it during the OME
Users conference in Dundee next week.

Regards,
Curtis

[1] https://github.com/imagej/imagej-omero


--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Tue, May 22, 2018 at 6:54 PM, Thomas Boudier <boudier.t at wehi.edu.au>
wrote:

> Dear OME developers,
>
> I am trying to write some java code to create kinda 3D Rois, but I am not
> sure how to create MaskData, this is my code :
>
> ImageInt seg = object3D.createSegImage(0, 0, 0);byte[][] mask = new byte[seg.sizeZ][seg.sizeXY];int offX = seg.offsetX;int offY = seg.offsetY;int offZ = seg.offsetZ;
> for (int z = 0; z < seg.sizeZ; z++) {
>     byte[] img = mask[z];
>     int c = 0;
>     for (int y = 0; y < seg.sizeY; y++) {
>         for (int x = 0; x < seg.sizeX; x++) {
>             if (seg.getPixel(x, y, z) > 0)
>                 img[c] = (byte) 255;
>             else                img[c] = (byte) 0;
>             c++;
>         }
>     }
> }
> ROIData data = new ROIData();
> data.setImage(image.asImage());for (int z = 0; z < seg.sizeZ; z++) {
>     MaskData maskData = new MaskData(offX, offY, seg.sizeX, seg.sizeY, mask[z]);
>     maskData.setZ(z + offZ);
>     maskData.setT(T);
>     maskData.setText(object3D.getName() + "_" + object3D.getValue());
>     data.addShapeData(maskData);
> }// Save ROIDataManagerFacility dm = gateway.getFacility(DataManagerFacility.class);
> ROIFacility roifac = gateway.getFacility(ROIFacility.class);
> ROIData roiData = roifac.saveROIs(ctx, image.getId(), Arrays.asList(data)).iterator().next();
>
> Actually I am not sure how such Mask Roi should display inside OMERO, it seems I can only see the bounding box but not the actual mask.
>
> Thanks for any hints.
>
> Best,
>
> Thomas
>
> --
> /***************************************************************/
>       Thomas Boudier, Senior Research Officer,
>       BioImage Analyst, Dynamic Imaging Centre,
>       Walter and Eliza Hall Institute (WEHI), Australia.
> /**************************************************************/
>
> _______________________________________________
>
> The information in this email is confidential and intended solely for the
> addressee.
> You must not disclose, forward, print or use it without the permission of
> the sender.
>
> The Walter and Eliza Hall Institute acknowledges the Wurundjeri people of
> the Kulin
> Nation as the traditional owners of the land where our campuses are
> located and
> the continuing connection to country and community.
> _______________________________________________
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20180523/89688b4c/attachment.html>


More information about the ome-devel mailing list