[ome-devel] Getting an image out of OMERO
Chris Allan
callan at blackcat.ca
Fri Jul 4 17:17:08 BST 2008
On 4 Jul 2008, at 15:58, Jost Gundelach wrote:
> Hi Jean-Marie,
Hi Jost.
>
> using the 3. example I get the raw data, with wich I can not do much,
> because I have to render it into the final ImageBuffer. Using the 2.
> example I get the RGB coded ImageBuffer (copied from
> org.openmicroscopy.shoola.util.image.geom.Factory.createImage), which
> works fine. But I need for each channel a monochrome ImageBuffer of
> type
> TYPE_BYTE_GRAY or TYPE_USHORT_GRAY depending of the bit resolution.
What you ideally want here is to use ome.util.ImageUtil to make a
buffered image from the rendering engine's packed integer format, this
is the fastest way to get a buffered image we've found in Java and
requires *no* data copies:
PlaneDef planeDef = new PlaneDef(PlaneDef.XY, 0);
int[] buf = renderingEngine.renderAsPackedInt(planeDef);
BufferedImage i = ome.util.ImageUtil.createBufferedImage(buf, 512, 512);
The code for ImageUtil can be seen here:
http://svn.openmicroscopy.org.uk/svn/omero/trunk/components/model/src/ome/util/ImageUtil.java
I don't see how you can do what you want with the raw data as it has
not been rendered to the device space yet.
> Thanks for your help,
> Jost Gundelach
Let me know if this doesn't help Jost.
Ciao.
-Chris
More information about the ome-devel
mailing list