Login  Register

Re: extracting pixels value from an image

Posted by David Webster on Jan 14, 2010; 5:56pm
URL: http://imagej.273.s1.nabble.com/extracting-pixels-value-from-an-image-tp3689482p3689483.html

Rona,

Hmm! Someone asked a question like this a few weeks ago. I don't know about
existing plugins, but you can convert the code below to a macro. Do
Plugins/New/Macro, paste the code into the macro edit window, and then run
it using Macro/Run Macro.

David

for(x=0;x<getWidth();x++)
{
 for(y=0;y<getHeight();y++)
 {
  value = getPixel(x,y);
  print(x,y,value);
 }
}

On Thu, Jan 14, 2010 at 6:14 AM, rona baron <[hidden email]> wrote:

> Hi all,
>
> I used the thershold command to classify and count cells on my image. Then
> I
> converted it into binary image (so all the objectes are set to 1...)
> I would like to have a list with the pixels location and its intensity (1
> or
> 0).
> How do I do it?
>
> Thanks
> Rona
>