Please help me with Image processing using "water algorithm"

2 views (last 30 days)
Hey Guys:
I am a researcher in cancer research. I am quite new to Matlab actually. Recently I found a Nature paper described a so-called "water algorithm" to segment images. This method is perfect for my purpose (segment focal adhesions of cancer cells). Unfortunately, the authors give nothing but the interpretation of "water algorithm". Therefore, I'd like to ask you guys to help me out creating the codes base on this algorithm. I know its not easy, but if I'd do it myself, its gonna take ages.
The "water algorithm" is implemented for 2-D and 3-D images for any desired pixel connectivity, but was applied here in 2-D with 4-neighbors connectivity (i.e. each pixel has 4 touching neighbors: up, down, right and left; all the other diagonal pixels are not considered connected).
The protocol of "water algorithm" is:
1. The image is smoothed with a boxcar average;
2. The image is subtracted background;
3. Pixels below a user defined threshold are set to zero, typically 5% of the maximum intensity are set to zero;
4. The remaining pixels are then sorted by brightness to form a descending list. Isolation of individual focal adhesions (FA: is the part of cells adhesion to plate) are accomplished with the following set of rules while going through the list:
Case 1: If the selected pixel has no neighbouring pixels assigned to a FA, assign the
pixel to a new FA.
Case 2:Case 2: If the selected pixel has neighbouring pixels assigned to a single FA, assign
the pixel to that FA.
Case 3:Case 3: If the selected pixel has neighbouring pixels assigned to multiple FAs,
merge the connected FAs to one new FA if the size of at least one of the connected FAs is
less than a critical size for merger (merger size). If mergers do not occur, assign the pixel to the
brightest neighbouring FA.
Typical parameters are found to be 25 pixels for the length scale of the box filter and 9-
12 pixels for a minimum merger size. Setting a minimum area of 3-5 pixels removed
falsely identified FAs.
I enclose the images of original and the mask after applying "water algorithm".
Thanks very very very much guys!!!, appreciated~!
  2 Comments
satya kothapalli
satya kothapalli on 8 Jan 2018
Edited: Walter Roberson on 8 Jan 2018
HI Youtao,
Thank you for a detailed description of your question. I wonder if you find the solution to this particular question. If so, can you please share here...

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 18 Apr 2018

Steps 1 and 2 are done using conv2() or imfilter().

kernel = [1,1,1; 1, -8, 1; 1,1,1]/9;
filteredImage = conv2(double(grayImage), kernel, 'same');

Step 3 is just something like

mask = filteredImage > 0.95 * max(filteredImage(:));

Step 4 is just the connected components labeling algorithm, done by bwlabel().

labeledImage = bwlabel(mask);

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!