Adjustments to Watershed Segmentation?

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

Adjustments to Watershed Segmentation?

Mitch B
Hello all,

I'm attempting to use ImageJ's watershed segmentation process to separate sand grains in scanned images of several thin sections for automated grain counts.  The default algorithm tends to over-segment grains, resulting in counts that are about twice as high as they should be.  I've read in a paper outlining a similar process in MatLab which indicates that partial watershed segmentation results in more accurate divisions of grains, but I have not been able to figure out how to adjust the process in ImageJ.

Does anyone here know how I might do this?
Reply | Threaded
Open this post in threaded view
|

Re: Adjustments to Watershed Segmentation?

Gabriel Landini
On Monday 07 May 2012 22:00:58 [hidden email] wrote:
> I'm attempting to use ImageJ's watershed segmentation process to separate
> sand grains in scanned images of several thin sections for automated grain
> counts.  The default algorithm tends to over-segment grains, resulting in
> counts that are about twice as high as they should be.  I've read in a paper
> outlining a similar process in MatLab which indicates that partial
> watershed segmentation results in more accurate divisions of grains, but I
> have not been able to figure out how to adjust the process in ImageJ.

What you used is called "watershed separation" and can't be tweaked other than
opening or closing the origina to change the number of basins in a somewhat
coarse way.

The real watershed that is applied to gresycale images and that you can tweak
is something different and it has been implemented for IJ by Daniel Sage at
EPFL:

http://bigwww.epfl.ch/sage/soft/watershed/

To see how this works, you might want to read Luc Vincent's papers on this,
available in the net.

Cheers
G
Reply | Threaded
Open this post in threaded view
|

Re: Adjustments to Watershed Segmentation?

karo03
One possibility to control watershed segmentation is the deletion of "unwanted" minima rspw. maxima. Gabriel Landini's plugins/macros "HMinima/Maxima Transform" do this, unluckily only in 2d.

There is a (large) academic software package for mathematical morphology Pink with very nice implementations in 2D/3D of divers watersheds http://pinkhq.com/ . This is open C++ source. Although there is some skill necessary to build (and to use) it. Actually I have only used isolated binaries built on my machine (Mac/ VM Win), not the also proposed Python interface.

Regards
Karsten

Am 08.05.2012 um 10:56 schrieb Gabriel Landini:

> On Monday 07 May 2012 22:00:58 [hidden email] wrote:
>> I'm attempting to use ImageJ's watershed segmentation process to separate
>> sand grains in scanned images of several thin sections for automated grain
>> counts.  The default algorithm tends to over-segment grains, resulting in
>> counts that are about twice as high as they should be.  I've read in a paper
>> outlining a similar process in MatLab which indicates that partial
>> watershed segmentation results in more accurate divisions of grains, but I
>> have not been able to figure out how to adjust the process in ImageJ.
>
> What you used is called "watershed separation" and can't be tweaked other than
> opening or closing the origina to change the number of basins in a somewhat
> coarse way.
>
> The real watershed that is applied to gresycale images and that you can tweak
> is something different and it has been implemented for IJ by Daniel Sage at
> EPFL:
>
> http://bigwww.epfl.ch/sage/soft/watershed/
>
> To see how this works, you might want to read Luc Vincent's papers on this,
> available in the net.
>
> Cheers
> G

Karsten
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Adjustments to Watershed Segmentation?

Michael Schmid
Hi Mitch & everyone,

in principle, you can create an Euclidian distance map (EDM) with Process>Binary>Distance Map (select float EDM in the binary options) and do watershed segmentation on it.  The ImageJ built-in 'Find Maxima' can do watershed segmentation this with variable sensitivity (tolerance); set the lower threshold to 1, limit to 'above threshold' and use 'segmented particles' as output.

Unless you want a rather coarse segmentation this approach won't be as good as the built-in watershed segmentation because the built-in watershed accounts for the finite pixel size:  If the maximum of the EDM would fall in the middle of two pixels, the actual maximum would be higher than any pixel value.

The API of ij.plugin.filter.MaximumFinder.java has a flag for this: 'boolean isEDM' in MaximumFinder.findMaxima.

So what I consider the best solution would be to write a plugin that creates an EDM and then calls MaximumFinder.findMaxima with the desired sensitivity (tolerance).  At the moment I can't promise that I find time to do it, but I might try.

Michael
________________________________________________________________
On May 8, 2012, at 11:24, Karsten wrote:

> One possibility to control watershed segmentation is the deletion of "unwanted" minima rspw. maxima. Gabriel Landini's plugins/macros "HMinima/Maxima Transform" do this, unluckily only in 2d.
>
> There is a (large) academic software package for mathematical morphology Pink with very nice implementations in 2D/3D of divers watersheds http://pinkhq.com/ . This is open C++ source. Although there is some skill necessary to build (and to use) it. Actually I have only used isolated binaries built on my machine (Mac/ VM Win), not the also proposed Python interface.
>
> Regards
> Karsten
>
> Am 08.05.2012 um 10:56 schrieb Gabriel Landini:
>
>> On Monday 07 May 2012 22:00:58 [hidden email] wrote:
>>> I'm attempting to use ImageJ's watershed segmentation process to separate
>>> sand grains in scanned images of several thin sections for automated grain
>>> counts.  The default algorithm tends to over-segment grains, resulting in
>>> counts that are about twice as high as they should be.  I've read in a paper
>>> outlining a similar process in MatLab which indicates that partial
>>> watershed segmentation results in more accurate divisions of grains, but I
>>> have not been able to figure out how to adjust the process in ImageJ.
>>
>> What you used is called "watershed separation" and can't be tweaked other than
>> opening or closing the origina to change the number of basins in a somewhat
>> coarse way.
>>
>> The real watershed that is applied to gresycale images and that you can tweak
>> is something different and it has been implemented for IJ by Daniel Sage at
>> EPFL:
>>
>> http://bigwww.epfl.ch/sage/soft/watershed/
>>
>> To see how this works, you might want to read Luc Vincent's papers on this,
>> available in the net.
>>
>> Cheers
>> G
>
> Karsten
> [hidden email]