Login  Register

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

Posted by No Name-4 on Apr 13, 2006; 8:35pm
URL: http://imagej.273.s1.nabble.com/brightness-value-of-every-single-pixel-according-to-XY-coordinates-of-the-image-tp3703083p3703085.html

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