[ome-users] Small C++ client
Bernhard Holländer
bernhard.voigt at gmail.com
Thu May 7 20:43:05 BST 2009
Hi Mario,
I know this is a little bit too late but maybe you're still working on
your client. What I do to get the raw pixel data looks similar to
this:
// session from client::createSession
omero::api::RawPixelStorePrx store = session->createRawPixelStore();
// assuming you have retrieved the PixelIPtr using the Gateway
store->setPixelsId(pixels_->getId()->getValue(), false);
// get a x-y plane, z,t,c boundaries from PixelsI::getSizeC/T/Z
Ice::ByteSeq data = store->getPlane(0, 0, 0); // z,c,t
// data is acutally a std::vector<unsigned char>
Now you would need to reinterprete this raw data:
1. get byte width, is signed, is float from the PixelsI object
-> this tells you how to interpret the bytes
e.g byte width = 2, unsigned, not flaot -> unsigned short
2. cast items to target type e.g unsigned short: cast every two items
to unsigned short
2a. depending on your platform you need to swap the endianess of the
raw bytes, because they are always returned as big-endian (how to swap
depends on the byte width)
3. turn 1-d vector in 2-d plane, with the the information from
PixelsI::getSizeX/Y
Even if it comes late, I hope that it helps!
Best wishes! Bernhard
On Tue, Apr 21, 2009 at 3:00 PM, Mario Valle <mvalle at cscs.ch> wrote:
> Dear all,
> here is my first, small C++ client.
> It is still missing the true image data retrieval, but I hope this is not
> complex.
> Suggestions, corrections and comments are welcome.
> Ciao!
> mario
>
> --
> Ing. Mario Valle
> Data Analysis and Visualization Group |
> http://www.cscs.ch/~mvalle
> Swiss National Supercomputing Centre (CSCS) | Tel: +41 (91) 610.82.60
> v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
>
>
> _______________________________________________
> ome-users mailing list
> ome-users at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users
>
>
More information about the ome-users
mailing list