Summing up pixel values along concentric annuli

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

Summing up pixel values along concentric annuli

Mary
Dear All,

Is there a way to have concentric annuli of a given spacing drawn on a star
and sum up the pixel values along each annulus? I don't want the sum of
pixels enclosed by each annulus but rather the sum of pixel values along the
circumference of each. I installed the Oval_Profile.java plugin and it works
fine but I am not sure if EquiCircumference is doing what I want it to do
(even if it does, I can't specify the spacing between the annuli).

I greatly appreciate your help in advance,
Maryam



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Summing up pixel values along concentric annuli

Bram van den Broek
Hi Maryam,

Just saw your message. Here's a small macro that does the job. It requires a (multi)point selection in the center of your star(s). The measured outputs appear in the Results window (with 'RawIntDen' being the sum of all pixels in the ring selection).
Note that this method is not sub-pixel accurate. Also, the macro will fail if the ring touches the edge of the image.

---------------------------------
#@ Integer (label = "Maximum ring diameter (pixels)", style = "spinner", value=100) max_diameter
#@ Integer (label = "Width of the ring selection (pixels)", style = "spinner", value=1) width
#@ Integer (label = "Spacing between consecutive ring selections", style = "spinner", value=2) spacing

if(selectionType!=10) exit("Create a (multi)point selection first");
run("Set Measurements...", "area mean standard min perimeter integrated median redirect=None decimal=3");
run("Clear Results");

roiManager("Add"); //Add the selection to the ROI manager
getSelectionCoordinates(xpoints, ypoints);
for(n=0;n<xpoints.length;n++) {
        for(i=1;i<max_diameter/spacing;i++) {
                makeOval(xpoints[n]-(i*spacing/2),ypoints[n]-(i*spacing/2),i*spacing,i*spacing);
                run("Make Band...", "band="+width);
                run("Measure");
        }
}
roiManager("Select", roiManager("count")-1); //Select and delete the selection in the ROI manager
roiManager("Delete");
run("Restore Selection");
-------------------------------------

I hope this helps you out.
Best regards,
Bram

------
Bram van den Broek
Advanced Microscopy and Image Analysis
BioImaging Facility / Cell Biology
The Netherlands Cancer Institute





________________________________________
From: Mary <[hidden email]>
Sent: Friday, May 25, 2018 4:53 AM
To: [hidden email]
Subject: Summing up pixel values along concentric annuli

Dear All,

Is there a way to have concentric annuli of a given spacing drawn on a star
and sum up the pixel values along each annulus? I don't want the sum of
pixels enclosed by each annulus but rather the sum of pixel values along the
circumference of each. I installed the Oval_Profile.java plugin and it works
fine but I am not sure if EquiCircumference is doing what I want it to do
(even if it does, I can't specify the spacing between the annuli).

I greatly appreciate your help in advance,
Maryam



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html