Login  Register

Re: Segmentation and analysis of silver grains in TEM image

Posted by Gabriel Landini on Apr 08, 2011; 2:33pm
URL: http://imagej.273.s1.nabble.com/Segmentation-and-analysis-of-silver-grains-in-TEM-image-tp3685041p3685044.html

On Friday 08 Apr 2011 14:35:46 you wrote:
> just to give you one more pointer: You can get a top-hat filter by
> Process>Math>Min and then Max, both with the same radius (or other
> way around, first Max, then Min, if your foreground objects have
> lower pixel values than the background as in the sample images).

What is described above is closing and opening in greyscale. One more step
gives you the traditional top hat: subtract from the original the result of
the above.

> Nevertheless, I could not get a decent removal of the fiber
> background with any of these.

I attached the result of:

1. Applied gaussian blur of size 1
2. Greyscale black top hat by reconstruction (see below, following Soille's
book)
3. Stretched the greyscale so the result can be seen

Step 2 is the following (and requires the Morphology collection installed)

// GreyBlackTopHatByReconstruction
// G. Landini at bham. ac. uk.
// 1/Oct/2010
setBatchMode(true);
a=getTitle();
run("Duplicate...", "title=_seed");
run("Maximum...", "radius=2");
run("Invert");
selectWindow(a);
run("Invert");
run("GreyscaleReconstruct ", "mask="+a+" seed=_seed create");
selectWindow(a);
run("Invert");
selectWindow("Reconstructed");
run("Invert");
rename("BlackTopHatReconstructed");
imageCalculator("Subtract", "BlackTopHatReconstructed",a);
setBatchMode(false);
//------

Cheers

Gabriel


BlackTopHatReconstructed.png (78K) Download Attachment