Pixel by pixel intensity in a circular ROI
Posted by Runa Hamid on
URL: http://imagej.273.s1.nabble.com/Pixel-by-pixel-intensity-in-a-circular-ROI-tp3692394.html
Dear image J users,
I need to use a macro for a circular ROI to obtain pixel by pixel
intensities in that ROI (ROI have 497 total pixels). I got a below appended
macro for a rectangular ROI from one of the image J users earlier. I would
be greatly thankful if any one can help me to convert this macro to obtain
values for circular ROI. I do not know programming at all.
w= getWidth() ; h = getHeight();
getSelectionBounds(xmin, ymin, selwidth, selheight);
run("Create Mask");
m=newArray(w*h);
for(x=0;x<w;x++){
for(y=0;y<h;y++){
m[y*w+x]=getPixel(x,y);
}
}
close(); //close mask
for(x=xmin;(x<=xmin+selwidth);x++){
for(y=ymin;(y<=ymin+selheight);y++){
if (m[y*w+x]!=0) print (x,y,getPixel(x,y));
}
}
Thanks In advance
Runa