Login  Register

Re: declump those buggers

Posted by Crowell Elizabeth on Mar 22, 2011; 6:21pm
URL: http://imagej.273.s1.nabble.com/declump-those-buggers-tp3685220p3685224.html

Hello Matthias,

I routinely have to count cells in low magnification wide-field images
and have tried many different methods to segment these images.  The best
one I have developed so far has an error rate below 1% for my image
sets!!!  Maybe it will be worth trying for your images, since they look
very similar to mine.  I cannot test the method on a jpg image; I need
raw, uncompressed images for that.

The key is using the watershed step, which separates those clumps, and a
square root function to reduce differences in intensity from one nucleus
to the other.

No method will ever be *perfect*, of course.  But counting nuclei is so
tedious and boring that it would be a waste to do it by hand.  If you
get an error below 10% it most likely won't affect the statistical
significance of your results (that depends on how many cells you are
going to count and what else you need to measure).  So don't give up
hope for segmenting your images!

Here is my method, which is normally incorporated into a
BatchProcessFolders-based macro:

        selectImage("orig");
        run("Duplicate...", "title=dup");  // I just make a copy of the
image to subtract background later...
        selectImage("dup");
        run("Gaussian Blur...", "sigma=60");  // This blurred image
represents the background.
        imageCalculator("Subtract create", "orig", "dup");   // Subtract
the background...
        rename("DAPIimg");
        selectImage("orig");
        close();
        selectImage("dup");
        close();  
        run("8-bit");
        run("Gaussian Blur...", "sigma=4");
        run("Remove Outliers...", "radius=10 threshold=0
which=Bright");  // Removes those dotty nucleoli
        run("Square Root");   // Reduces intensity differences so
thresholding works better.
        setAutoThreshold("Triangle dark");  // The actual segmentation step.
        run("Convert to Mask");
        run("Watershed");     // Separate the nuclei that are close
together.
        run("Analyze Particles...", "size=914-5889 circularity=0.67-1.00
show=Nothing summarize add");  // Filter...
        dlength = roiManager("count");
        if (dlength>0) {
            // If some cells were detected, save count and continue...
            selectWindow("Summary");
            save(dest+File.separator+number+"_cellcount.txt");  // You
have to modify this line for your filenames.
            selectWindow("Summary");
            run("Close");
            roiManager("reset");
            run("Clear Results");
            selectImage("DAPIimg");
            close();
        } else {
            roiManager("reset");  // If no cells were detected, close
everything and print out the name of the image.
            run("Clear Results");
            if (isOpen("Summary")) {
                selectWindow("Summary");
                run("Close");
            }
            print("Warning: image "+path+" was determined to be empty.");
            selectImage("DAPIimg");
            close();
        }


Please let me know if it is not clear how to test this code on your images.
Kind Regards,

Elizabeth Crowell




Matthias Kirsch a écrit :

> dear all,
>
> I am struggling with automatic image analysis. One of the first stumbling
> point seems to be segmenting DAPI-stained nuclei in fluorescence images. If
> this is not working reliably, the whole point of processing large numbers of
> images is obsolete. Attached are examples of such clumps (there are many
> more). If segmentation cannot separate them, it would be helpful to have at
> least some way of eliminating false results by just clicking on them, or
> even better, have all identified particles presented in a graph with freely
> chosen measurement as parameters as axes. Then one could click on the
> individual points in the graph and see the corresponding cell in the image
> and then decide whether to keep or discaed it. This should also work the
> other way round, i.e. click on a cell in the image and see the corresponding
> point in the graph. Similarily, it would be most helpful to be able do
> somethig like gating in FACS, i.e. set limits to certain parameters and see,
> which cells fulill them.
>
> I know that this is asking a lot, but I think providing this kind of
> routines in an easy to use plugin would make ImageJ even more attractive and
> competitive than it already is. Of course this applies only for
> 'Non-Cracks'.
>
> Any help would be welcome. Further questions alnosr guaranteed.
>
> Cheers
>
> P.S.: Can only insert jpeg images
> Matthias http://imagej.588099.n2.nabble.com/file/n6193826/RGB_%28blue%29.jpg 
>
> --
> View this message in context: http://imagej.588099.n2.nabble.com/declump-those-buggers-tp6193826p6193826.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>  


--

Elizabeth CROWELL

----------------------------------------------------------------------
Membrane Traffic and Cell Division Research Group
Institut Pasteur
28 rue du Dr Roux
75015 PARIS, France

Tel :  01.44.38.94.07
Fax : 01.45.68.89.54
----------------------------------------------------------------------