brightness value of every single pixel according to XY coordinates of the image

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

brightness value of every single pixel according to XY coordinates of the image

Jarek Grodek
Hello,

I'm still looking for a plugin which returns the brightness value of each
single pixel in the picture according to the XY coordinates. I'd like to
extract this data to Excel and calculate later. Does anyone knows
something about it? is it available as plugin or just a simple macro?
thanks in advance.

greetings,

Jarek Grodek
Reply | Threaded
Open this post in threaded view
|

Re: brightness value of every single pixel according to XY coordinates of the image

No Name-4
Jarek,

I believe that Wayne sent this macro last week (4/7/2006). FYI, I found
the macro handy myself and I modified it somewhat to also return log
tranformed values for linear OD measurements (Beer-Lambert) as well as
allowing thresholding to eliminate low value pixels. Here it is:

requires("1.35g");
//f = File.open(""); // prompt for file name

ImageName=getTitle();

Dialog.create("Pixel Values Params");
Dialog.addNumber("Thresh:", 240);
Dialog.show();
Thresh = Dialog.getNumber();

count=0;
sumlogs=0;
sumpix=0;
avelogs=0;
avepix=0;
for (y=0; y<getHeight; y++) {
        showProgress(y, getHeight);
        for (x=0; x<getWidth; x++) {
                if
                (getPixel(x,y)<Thresh)
                {
                logpix=log(getPixel(x,y)/255)*-1;
                sumlogs=sumlogs+logpix;
                sumpix=sumpix+getPixel(x,y);
                count++;
                print(x+"\t"+y+"\t"+getPixel(x,y)+"\t\t"+logpix);
                }
        }
}

avelogs=sumlogs/count;
avepix=sumpix/count;
logavepix=log(avepix/255)*-1;
print(ImageName+"\n"+"Thresh:"+Thresh+"\n"+"Ave of
logs:"+avelogs+"\n"+"Ave of pixels:"+avepix+"\n"+"Log of
AvePix:"+logavepix+"\n\n");

Jim Deeds





Jarek Grodek <[hidden email]>
Sent by: ImageJ Interest Group <[hidden email]>
04/13/2006 07:48 AM
Please respond to ImageJ Interest Group

 
        To:     [hidden email]
        cc:     (bcc: James Deeds/PH/Novartis)
        Subject:        brightness value of every single pixel according to XY coordinates of the
image


Hello,

I'm still looking for a plugin which returns the brightness value of each
single pixel in the picture according to the XY coordinates. I'd like to
extract this data to Excel and calculate later. Does anyone knows
something about it? is it available as plugin or just a simple macro?
thanks in advance.

greetings,

Jarek Grodek
Reply | Threaded
Open this post in threaded view
|

Re: brightness value of every single pixel according to XY coordinates of the image

J.S. Greg
In reply to this post by Jarek Grodek
 Hi,

You can also use the "Save as Text" from the file menu.
This will make a tab-deliminated text file which will open in an excel spreadsheet with the brightness value of each pixel in each cell.

One thing to remember though, Excel can only take 256 columns of data (though 65536 rows), so if you image is wider than 256 pixels across, you'll have to split it up or use somehing else.

Jenny


> From:: [hidden email]
> To: [hidden email]
> Subject: Re: brightness value of every single pixel according to XY coordinates of the image
> Date: Thu, 13 Apr 2006 15:35:06 -0400

> Jarek,
>
> I believe that Wayne sent this macro last week (4/7/2006). FYI, I found
> the macro handy myself and I modified it somewhat to also return log
> tranformed values for linear OD measurements (Beer-Lambert) as well as
> allowing thresholding to eliminate low value pixels. Here it is:
>
> requires("1.35g");
> //f = File.open(""); // prompt for file name
>
> ImageName=getTitle();
>
> Dialog.create("Pixel Values Params");
> Dialog.addNumber("Thresh:", 240);
> Dialog.show();
> Thresh = Dialog.getNumber();
>
> count=0;
> sumlogs=0;
> sumpix=0;
> avelogs=0;
> avepix=0;
> for (y=0; y<getheight; y++  {
>         showProgress y, getHeight ;
>         for  x=0; x<getWidth; x++  {
>                 if
>                  getPixel x,y <Thresh
>                 {
>                 logpix=log getPixel x,y /255 *-1;
>                 sumlogs=sumlogs+logpix;
>                 sumpix=sumpix+getPixel x,y ;
>                 count++;
>                 print x+"\t"+y+"\t"+getPixel x,y +"\t\t"+logpix ;
>                 }
>         }
> }
>
> avelogs=sumlogs/count;
> avepix=sumpix/count;
> logavepix=log avepix/255 *-1;
> print ImageName+"\n"+"Thresh:"+Thresh+"\n"+"Ave of
> logs:"+avelogs+"\n"+"Ave of pixels:"+avepix+"\n"+"Log of
> AvePix:"+logavepix+"\n\n" ;
>
> Jim Deeds
>
>
>
>
>
> Jarek Grodek <[hidden email]>
> Sent by: ImageJ Interest Group <[hidden email]>
> 04/13/2006 07:48 AM
> Please respond to ImageJ Interest Group
>
>  
>         To:     [hidden email]
>         cc:     (bcc: James Deeds/PH/Novartis)
>         Subject:        brightness value of every single pixel according to
> XY coordinates of the
> image
>
>
> Hello,
>
> I'm still looking for a plugin which returns the brightness value of each
> single pixel in the picture according to the XY coordinates. I'd like to
> extract this data to Excel and calculate later. Does anyone knows
> something about it? is it available as plugin or just a simple macro?
> thanks in advance.
>
> greetings,
>
> Jarek Grodek
Lycos iQ - show what you knoW: iq.lycos.co.uk