[ome-devel] Getting an image out of OMERO

Jost Gundelach omero at gundelacht.de
Fri Jul 4 15:58:56 BST 2008


Hi Jean-Marie,
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.

Thanks for your help,
Jost Gundelach

--
Jost Gundealch, Dipl.-Inform.
c.a.r.u.s. IT AG
Phone: (040) 5 14 35-0, intl.: +49.40.5 14 35-0



Jean-marie Burel schrieb:
> Hi Matthias
>
> in order to retrieve the correct data 
> you need the pixels ID related to the image not the image ID.
>
> then depending on what you want to do 
> you can
> 1. use the thumbnail service to retrieve compressed data
> 2. use the rendering engine to get compressed or uncompressed data.
> 3. use the RawPixelsStore to retrieve the raw data
>
>
> 1. go to the OmeroImageServiceImpl in env/data
> private ServiceFactory          entry;
> ThumbnailStore service = entry.createThumbnailService();
>
> if (!(service.setPixelsId(pixelsID))) { *
>  service.resetDefaults();
>  service.setPixelsId(pixelsID);
> }
> byte[] array = service.getThumbnail(new Integer(sizeX),  new Integer(sizeY));
>
> where sizeX = maxWidth, sizeY= maxHeight for example.
>
>
> The thumbnail store provides other useful methods, see Java doc.
> If you use set of images you should use the method related to collection
> in that case the code marked with * is not required.
>
>
> 2.
> RenderingEngine re = entry.createRenderingEngine();
> re.setCompressionLevel(compression); //optional only for compressed data
> service.lookupPixels(pixelsID);
> needDefault(pixelsID, service);
> if (!(re.lookupRenderingDef(pixelsID))) {
> re.resetDefaults();
> re.lookupRenderingDef(pixelsID);
> 			}
> re.load();
>
> uncompressed
> int[] buf = re.renderAsPackedInt(pDef);
> compressed
> byte[] values = re.renderCompressed(pDef);
>
> where pDef is planeDef indicating the plane to retrieve
> e.g.
> PlaneDef pDef = new PlaneDef(PlaneDef.XY, getDefaultT());
> pDef.setZ(getDefaultZ());
>
>
> 3. to retrieve a plane for example.
> RawPixelsStore service =entry.createRawPixelsStore();
> service.setPixelsId(pixelsID);
> byte[] array = service.getPlane(z, c, t);
>
>
> 2 is the approach for the Viewer
> 1 when we browse thumbnails.
>
>
> Hope it helps
> I can point to the classes or packages if you need
>
> Cheers
>
> Jmarie
>
> The University of Dundee is a registered Scottish charity, No: SC015096
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>
>   



More information about the ome-devel mailing list