[ome-users] How to use the Rendering Engine to zoom and tile an image

Matthias Baldauf matthias.baldauf at umit.at
Tue Aug 14 08:54:34 BST 2012


Hello All,

I am writing a Java web-client for OMERO.server and currently focus on the OMERO Rendering Engine. Therefore, I studied the OMERO Java examples page (http://trac.openmicroscopy.org.uk/ome/wiki/OmeroJava). I tried different approaches, but I did not figure out how to zoom in/out the image and how to use the new tiling feature of the Rendering Engine. Below, I added a code snipped how I use the Rendering Engine. May I ask you to provide me an example code for zooming and using the tiling feature?

Thank you very much in advance for your answer!

Regards,
Matthias


--------------------------------
PixelsData pixels = image.getDefaultPixels();
long pixelsId = pixels.getId();

RenderingEnginePrx proxy = entryUnencrypted.createRenderingEngine();

proxy.lookupPixels(pixelsId);
if (!(proxy.lookupRenderingDef(pixelsId))) {
    proxy.resetDefaults();
    proxy.lookupRenderingDef(pixelsId);
}

proxy.load();            

PlaneDef pDef = new PlaneDef();
pDef.z = 0;
pDef.t = 0;
pDef.slice = 0;

// Get a certain region of the original image
pDef.region = new RegionDef(xpos, ypos, width, height);

byte[] compressed = proxy.renderCompressed(pDef);            
ByteArrayInputStream stream = new ByteArrayInputStream(compressed);

proxy.close();
--------------------------------




More information about the ome-users mailing list