ImageStack.getVoxel() with RGB image

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ImageStack.getVoxel() with RGB image

IJperson
Hi everyone.

 

I have an RGB stack and I would like to get colour values out. I notice that
ImageStack.getVoxel()  returns a bit masked number for RGB images: &0xffff

 

Is this just returning the alpha and one colour channel? Whats the easiest
way to get a full RGB colour voxel out of a stack ?

 

Thanks in advance!!

Andrew

 
Reply | Threaded
Open this post in threaded view
|

Re: ImageStack.getVoxel() with RGB image

Barry DeZonia
It looks like you've run into a bug. For now you can work around it by
using:

stack.getProcessor(z).get(x,y)

This will return an int. Assuming it is color rgb data that int can be
decoded:

a = (theInt >> 24) & 0xff
r = (theInt >> 16) & 0xff
g = (theInt >> 8) & 0xff
b = theInt & 0xff

On Tue, Feb 28, 2012 at 7:14 AM, Andrew French <[hidden email]>wrote:

> Hi everyone.
>
>
>
> I have an RGB stack and I would like to get colour values out. I notice
> that
> ImageStack.getVoxel()  returns a bit masked number for RGB images: &0xffff
>
>
>
> Is this just returning the alpha and one colour channel? Whats the easiest
> way to get a full RGB colour voxel out of a stack ?
>
>
>
> Thanks in advance!!
>
> Andrew
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: ImageStack.getVoxel() with RGB image

dscho
In reply to this post by IJperson
Hi Andrew,

On Tue, 28 Feb 2012, Andrew French wrote:

> I have an RGB stack and I would like to get colour values out. I notice
> that ImageStack.getVoxel()  returns a bit masked number for RGB images:
> &0xffff
>
> Is this just returning the alpha and one colour channel? Whats the
> easiest way to get a full RGB colour voxel out of a stack ?

See
http://groups.google.com/group/fiji-users/browse_thread/thread/267b84b7e055b8b1#

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: ImageStack.getVoxel() with RGB image

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by IJperson
On Feb 28, 2012, at 8:14 AM, Andrew French wrote:

> Hi everyone.
>
> I have an RGB stack and I would like to get colour values out. I notice that
> ImageStack.getVoxel()  returns a bit masked number for RGB images: &0xffff
>
> Is this just returning the alpha and one colour channel? Whats the easiest
> way to get a full RGB colour voxel out of a stack?

This bug is fixed the ImageJ 1.46h daily build, and ImageStack.getVoxel() is no longer marked as "experimental".

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: ImageStack.getVoxel() with RGB image

IJperson
Many thanks, this now works as expected!
Andrew

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Rasband, Wayne (NIH/NIMH) [E]
Sent: 28 February 2012 21:15
To: [hidden email]
Subject: Re: ImageStack.getVoxel() with RGB image

On Feb 28, 2012, at 8:14 AM, Andrew French wrote:

> Hi everyone.
>
> I have an RGB stack and I would like to get colour values out. I
> notice that
> ImageStack.getVoxel()  returns a bit masked number for RGB images:
> &0xffff
>
> Is this just returning the alpha and one colour channel? Whats the
> easiest way to get a full RGB colour voxel out of a stack?

This bug is fixed the ImageJ 1.46h daily build, and ImageStack.getVoxel() is
no longer marked as "experimental".

-wayne