Login  Register

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

Posted by Lucas, Falk /BDF HAM on Sep 05, 2006; 10:08am
URL: http://imagej.273.s1.nabble.com/ip-getPixel-returns-index-not-value-tp3701630p3701636.html

Hi,

it looks like your Image is not a grayscale image scince you get three numbers for the value, there should be only one.

Falk

-----Ursprüngliche Nachricht-----
Von: ImageJ Interest Group [mailto:[hidden email]] Im Auftrag von Tony Shepherd
Gesendet: Montag, 4. September 2006 19:41
An: [hidden email]
Betreff: ip.getPixel returns 'index' not 'value'

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)

_____________________  Confidentiality  _____________________

This electronic transmission is strictly confidential and intended
solely for the addressee.  It may contain information which is covered
by legal, professional or other privilege.  If you are not the intended
addressee, you must not disclose, copy or take any action in reliance
of this transmission.  If you have received this transmission in error,
please notify us and delete the received data as soon as possible.

This footnote also confirms that this email message has been swept
for the presence of computer viruses.
_______________________________________________________