<div dir="ltr">Hi Alex,<div><br></div><div><div>> I'm trying to create an ImageStack object from raw image data</div><div>> retrieved from an OMERO server via the java API.</div><div><br></div><div>Did you try enabling the OMERO-5.0 update site, and using the File > Import > OMERO... plugin? It gives you back an ImagePlus of any OMERO image of your choosing.<br></div><div><br></div><div>Documentation and code at:</div><div>* <a href="https://github.com/imagej/imagej-omero" target="_blank">https://github.com/imagej/imagej-omero</a></div><div><br></div><div>And see also:</div><div>* <a href="https://github.com/scifio/scifio-omero" target="_blank">https://github.com/scifio/scifio-omero</a></div><div><br></div><div>If you need to do this in a script, here is a quick and dirty one:</div><div><br></div><div><div><div><span class="" style="white-space:pre"> </span>// @DatasetIOService dio</div><div><span class="" style="white-space:pre"> </span>// @String host</div><div><span class="" style="white-space:pre"> </span>// @int port</div><div><span class="" style="white-space:pre"> </span>// @String user</div><div><span class="" style="white-space:pre"> </span>// @String password</div><div><span class="" style="white-space:pre"> </span>// @int(label="Image ID") imageID</div><div><span class="" style="white-space:pre"> </span>// @OUTPUT net.imagej.Dataset image</div><div><span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre"> </span>uri = "omero:server=" + host +</div><div><span class="" style="white-space:pre"> </span>"&port=" + port +</div><div><span class="" style="white-space:pre"> </span>"&user=" + user +</div><div><span class="" style="white-space:pre"> </span>"&password=" + password +</div><div><span class="" style="white-space:pre"> </span>"&imageID=" + imageID</div><div><span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre"> </span>config = new io.scif.config.SCIFIOConfig()</div><div><span class="" style="white-space:pre"> </span>config.imgOpenerSetImgModes(io.scif.config.SCIFIOConfig.ImgMode.CELL)</div><div><span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre"> </span>image = dio.open(uri, config)</div></div></div><div><br></div><div>A couple of notes:</div><div><br></div><div>1) The type of the "image" that comes back is a Dataset, which is the primary ImageJ2 data structure. It is implicitly converted to an ij.ImagePlus (the primary ImageJ1 data structure) and displayed, by the module execution framework. Happy to answer any questions about this if you need clarification.</div><div><br></div><div>2) The plaintext password password is temporary; there is work planned to eliminate that need.</div><div><br></div><div>In short: this sort of thing is precisely what the ImageJ-OMERO project (<a href="https://github.com/imagej/imagej-omero">https://github.com/imagej/imagej-omero</a>) intends to accomplish in a general way. Please take a look and let us know what you think.</div><div><br></div><div>Regards,</div><div>Curtis</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 17, 2015 at 1:06 PM, Alex Rigano <span dir="ltr"><<a href="mailto:alex.rigano@umassmed.edu" target="_blank">alex.rigano@umassmed.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi there,<br>
<br>
I'm trying to create an ImageStack object from raw image data retrieved from an OMERO server via the java API.<br>
My current strategy is to get each frame of the image as a byte array and transform it in a int array.<br>
Then create a FloatProcessor for each frame and add it to the ImageStack.<br>
<br>
The problem I'm experiencing is that if I execute the same analysis procedure in imageJ and in my application I obtain different results.<br>
So I'm trying to understand if the approach I use to create ImageStack is correct.<br>
<br>
I realized that you probably already did that for the OMERO.insight plugin for ImageJ.<br>
Would it be possible for you to let me know what is the strategy you used?<br>
<br>
Thanks<br>
Have a great day<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Alessandro Rigano<br>
Application and Database Developer II<br>
Program in Molecular Medicine<br>
University of Massachusetts Medical School<br>
373 Plantation Street, Biotech II, Suite 114<br>
Worcester, MA, 01605<br>
<br>
_______________________________________________<br>
ome-devel mailing list<br>
<a href="mailto:ome-devel@lists.openmicroscopy.org.uk" target="_blank">ome-devel@lists.openmicroscopy.org.uk</a><br>
<a href="http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel" target="_blank">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel</a><br>
</font></span></blockquote></div><br></div>