Login  Register

Analyze Particles Issue?

Posted by Ankur Ramani on Jul 17, 2006; 3:00pm
URL: http://imagej.273.s1.nabble.com/Analyze-Particles-Issue-tp3702049.html

Hello,

    I am having this problem with this macro I wrote. It works on stacks
of images and the purpose is to track cells as they migrate through a
gel through using the centroid. I am using the inbuilt Analyze particle
function to get my centroids; however, for some reason it is not picking
up all the thresholded objects, and seems to be only picking up ones
near the edges of the image. I am using a minimum area defined by the
user to limit the amount of cells shown. Also if anyone has any
suggestions for how to get ImageJ to define an object as the same object
in each slice (there are many cells in each picture which is a problem)
though I am still stuck on trying to get this part to work correctly.




Here is my code:

function Analyze_Stack()
{
    selectWindow("Reconstructed");
    run("Median...", "radius=1");  
    run("Set Scale...", "distance=1300 known=860 pixel=1 unit=microns
global");
    run("Set Measurements...", "area centroid display redirect=None
decimal=3");
O=1;
t=0;
for(n=1;n<=nSlices;n++)
{
        setSlice(n);
        O=1;
        while(O!=2)
        {
        min_area=newArray(20);
        if(t==0&&n==1)
            fin_area=getNumber("Minimum Area?: ", 100);
        else
          if(n==1)
            fin_area=getNumber("Minimum Area? (Previous was
"+min_area[t-1]+"):", 100);
       
        run("Analyze Particles...", "size="+fin_area+"-Infinity
circularity=0.00-1.00 show=Outlines display include record");
        t++;
        min_area[t]=fin_area;
        if(n==1)
        {
        O=getNumber("Redo Analysis? (1 for yes, 2 for no)", 1);
        }
        else
        O=2;

        if(O==1)
            {
            run("Close");
            selectWindow("Reconstructed");
            }
        else
            {
            saveAs("Jpeg");
            saveAs("Measurements");
            }
        }
    }
}