<div dir="ltr"><div>Hi Thomas & everyone,</div><div><br></div><div>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.</div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div>[1] <a href="https://github.com/imagej/imagej-omero">https://github.com/imagej/imagej-omero</a><br><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8px">--</span></div><div><span style="font-size:12.8px">Curtis Rueden</span><br></div><div><span style="font-size:12.8px">LOCI software architect - <a href="https://loci.wisc.edu/software" target="_blank">https://loci.wisc.edu/software</a></span></div><div>ImageJ2 lead, Fiji maintainer - <span style="font-size:12.8px"><a href="https://imagej.net/User:Rueden" target="_blank">https://imagej.net/User:Rueden</a></span></div><div>Did you know ImageJ has a forum? <a href="http://forum.imagej.net/" target="_blank">http://forum.imagej.net/</a></div><div><br></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Tue, May 22, 2018 at 6:54 PM, Thomas Boudier <span dir="ltr"><<a href="mailto:boudier.t@wehi.edu.au" target="_blank">boudier.t@wehi.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div text="#000000" bgcolor="#FFFFFF">
<p>Dear OME developers,</p>
<p>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 :
<br>
</p>
<pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:10.5pt">ImageInt seg = object3D.createSegImage(<span style="color:#0000ff">0</span>, <span style="color:#0000ff">0</span>, <span style="color:#0000ff">0</span>);
<span style="color:#000080;font-weight:bold">byte</span>[][] mask = <span style="color:#000080;font-weight:bold">new byte</span>[seg.<span style="color:#660e7a;font-weight:bold">sizeZ</span>][seg.<span style="color:#660e7a;font-weight:bold">sizeXY</span>];
<span style="color:#000080;font-weight:bold">int </span>offX = seg.<span style="color:#660e7a;font-weight:bold">offsetX</span>;
<span style="color:#000080;font-weight:bold">int </span>offY = seg.<span style="color:#660e7a;font-weight:bold">offsetY</span>;
<span style="color:#000080;font-weight:bold">int </span>offZ = seg.<span style="color:#660e7a;font-weight:bold">offsetZ</span>;

<span style="color:#000080;font-weight:bold">for </span>(<span style="color:#000080;font-weight:bold">int </span>z = <span style="color:#0000ff">0</span>; z < seg.<span style="color:#660e7a;font-weight:bold">sizeZ</span>; z++) {
    <span style="color:#000080;font-weight:bold">byte</span>[] img = mask[z];
    <span style="color:#000080;font-weight:bold">int </span>c = <span style="color:#0000ff">0</span>;
    <span style="color:#000080;font-weight:bold">for </span>(<span style="color:#000080;font-weight:bold">int </span>y = <span style="color:#0000ff">0</span>; y < seg.<span style="color:#660e7a;font-weight:bold">sizeY</span>; y++) {
        <span style="color:#000080;font-weight:bold">for </span>(<span style="color:#000080;font-weight:bold">int </span>x = <span style="color:#0000ff">0</span>; x < seg.<span style="color:#660e7a;font-weight:bold">sizeX</span>; x++) {
            <span style="color:#000080;font-weight:bold">if </span>(seg.getPixel(x, y, z) > <span style="color:#0000ff">0</span>)
                img[c] = (<span style="color:#000080;font-weight:bold">byte</span>) <span style="color:#0000ff">255</span>;
            <span style="color:#000080;font-weight:bold">else
</span><span style="color:#000080;font-weight:bold">                </span>img[c] = (<span style="color:#000080;font-weight:bold">byte</span>) <span style="color:#0000ff">0</span>;
            c++;
        }
    }
}
ROIData data = <span style="color:#000080;font-weight:bold">new </span>ROIData();
data.setImage(image.asImage())<wbr>;
<span style="color:#000080;font-weight:bold">for </span>(<span style="color:#000080;font-weight:bold">int </span>z = <span style="color:#0000ff">0</span>; z < seg.<span style="color:#660e7a;font-weight:bold">sizeZ</span>; z++) {
    MaskData maskData = <span style="color:#000080;font-weight:bold">new </span>MaskData(offX, offY, seg.<span style="color:#660e7a;font-weight:bold">sizeX</span>, seg.<span style="color:#660e7a;font-weight:bold">sizeY</span>, mask[z]);
    maskData.setZ(z + offZ);
    maskData.setT(T);
    maskData.setText(object3D.<wbr>getName() + <span style="color:#008000;font-weight:bold">"_" </span>+ object3D.getValue());
    data.addShapeData(maskData);
}
<span style="color:#808080;font-style:italic">// Save ROI
</span>DataManagerFacility dm = <span style="color:#660e7a;font-weight:bold">gateway</span>.getFacility(<wbr>DataManagerFacility.<span style="color:#000080;font-weight:bold">class</span>);
ROIFacility roifac = <span style="color:#660e7a;font-weight:bold">gateway</span>.getFacility(<wbr>ROIFacility.<span style="color:#000080;font-weight:bold">class</span>);
ROIData roiData = roifac.saveROIs(<span style="color:#660e7a;font-weight:bold">ctx</span>, image.getId(), Arrays.<span style="font-style:italic">asList</span>(data)).iterator(<wbr>).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
</pre>
<pre class="m_-4189061808703441442moz-signature" cols="72">-- 
/*****************************<wbr>******************************<wbr>****/
      Thomas Boudier, Senior Research Officer,
      BioImage Analyst, Dynamic Imaging Centre,
      Walter and Eliza Hall Institute (WEHI), Australia.
/*****************************<wbr>******************************<wbr>***/  
</pre>
<div>
<p style="font-size:8pt;line-height:10pt;font-family:'Arial','Arial',serif">______________________________<wbr>_________________
<br>
<br>
The information in this email is confidential and intended solely for the addressee.<br>
You must not disclose, forward, print or use it without the permission of the sender.<br>
<br>
The Walter and Eliza Hall Institute acknowledges the Wurundjeri people of the Kulin
<br>
Nation as the traditional owners of the land where our campuses are located and <br>
the continuing connection to country and community.<br>
______________________________<wbr>_________________ </p>
</div>
</div>

<br>______________________________<wbr>_________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk">ome-devel@lists.<wbr>openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" rel="noreferrer" target="_blank">http://lists.openmicroscopy.<wbr>org.uk/mailman/listinfo/ome-<wbr>devel</a><br>
<br></blockquote></div><br></div>