Login  Register

Re: ip.getPixel returns 'index' not 'value'

Posted by Wayne Rasband on Sep 05, 2006; 8:16pm
URL: http://imagej.273.s1.nabble.com/ip-getPixel-returns-index-not-value-tp3701630p3701634.html

Convert the image to one with the standard grayscale LUT by selecting
Image>Type>8-bit. This should work even if "8-bit" is already checked
in the Type menu.

-wayne

On Sep 4, 2006, at 1:41 PM, Tony Shepherd wrote:

> I'm using a greyscale image. When I place the mouse pointer over a
> homogenous part of the image, the ImageJ toolbar tells me the
> following:
>
> x=99, y=130, index=8, value=192,192,192.
>
> In my program I use int greyvalue = ip.getPixelValue(x,y);
>
> where x and y are defined inside the same algorithm.
>
> For the same homogenous region as above (eg x=99, y=130) I expect to
> get
> greyvalue = 192.
> I get greyvalue = 8.
>
> I suspect that I'm using a LUT without knowing it (or wanting it).
>
> Is there a function that returns 'value' instead of 'index' (eg the
> value in
> the red channel, since this is the same as the value in the green and
> blue
> channels)
>