[ome-devel] Using the GatewayPrx object to copy an Image...

Michael Porter m.porter at dundee.ac.uk
Fri Jul 3 12:33:31 BST 2009


Hi Jerome
 
No, you've not misunderstood anything, there is a problem I think in adding channels using this method. I had the same problem for a while too, and had to get around it by manually getting the image and pixels information of the old image, creating a new image and attaching the necessary info. Once I've done this I can send the new planes.
 
The info you need to gather is...
imageName, channelList, pixelsType, physSizeX, physSizeY, physSizeZ, sizeX, sizeY, sizeZ, sizeT, timeStamp, dimensionOrder, statsInfo(for GlobalMin/Max), sha1.
 
Then you need to create the channel object, logical channel object, populate the logical channels with your emission wavelengths, attach the logical channels to the channel object, the channel object to the pixels, the pixels to the image, then saveAndReturn the newImage.
 
If you want to do it this way I can send you my work-around if you like? I'm using the gateway with matlab, but it should be fairly readable.
 
Michael.
 
 
-- 
Michael Porter
Wellcome Trust Centre for
Gene Regulation and Expression
College of Life Sciences
University of Dundee
Dow Street
Dundee
United Kingdom
DD1 5EH

+44(0)1382 388142
m.porter at dundee.ac.uk 

The University of Dundee is a registered Scottish charity, No: SC015096



>>> Jerome Avondo <jeromeavondo at msn.com> 03/07/2009 11:54 >>>
Hi,

I am trying to do the following, get an Image from the server, make a duplicate of it, and then do some image processing to this duplicate...

However I think there is something I have misunderstood... I'm currently stuck at the make a duplicate of the image...
My code goes as follows,

client omeroclient;
ServiceFactoryPrx sf;
GatewayPrx gw;

//create our omero session
omeroclient = new client(servername, 4063);
sf = omeroclient.createSession(username, password);        
sf.closeOnDestroy();

//create our omero gateway
gw = sf.createGateway();

//get our Image at ID:1
Image img = gw.getImage(1);

//get the Pixels(0) details for this image
Pixels pix = img.getPixels(0);
int x = pix.getSizeX().getValue();
int y = pix.getSizeY().getValue();
int z = pix.getSizeZ().getValue();
int c = pix.getSizeC().getValue();
int t = pix.getSizeT().getValue();
List<Integer> channels = new ArrayList();
for(int i=0; i<c; i++) channels.add(i);

//copy this image and get the new image id
long newImageID = gw.copyImage(img.getId().getValue(), x, y, t, z, channels, "NewImageProcessed");

However the gw.copyImage() method generates a crash, which I have attached as an attachment. Is there something I am missing here? Or misunderstood?

thanks for your help.

J.

Beyond Hotmail - see what else you can do with Windows Live. Find out more. ( http://clk.atdmt.com/UKM/go/134665375/direct/01/ ) 

The University of Dundee is a registered Scottish charity, No: SC015096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20090703/2d9a83a5/attachment.htm 


More information about the ome-devel mailing list