Login  Register

Re: brightness values in every single pixel (x,y coordinates included)

Posted by Wayne Rasband on Apr 07, 2006; 3:53pm
URL: http://imagej.273.s1.nabble.com/brightness-values-in-every-single-pixel-x-y-coordinates-included-tp3703172p3703173.html

> I'm sure that someone already mentioned this idea before, but what I'm
> looking for is macro or plugin which returns brightness value of every
> single pixel of image, according to its XY coordinates in form of the
> list, ie. X| Y|     Bright.  Value (0-255)|
>                1| 1|     0|
>                1| 2|     1|
>
> etc. etc..
>
> I'd like to export this data to Excel sheet for further analysis.
> Does anybody has any clue about solution of this question?

Here is a macro that does this:

   requires("1.35g");
   f = File.open(""); // prompt for file name
   for (y=0; y<getHeight; y++) {
       showProgress(y, getHeight);
       for (x=0; x<getWidth; x++) {
           print(f, x+"\t"+y+"\t"+getPixel(x,y));
       }
   }

-wayne