Thursday, September 23, 2010

Applying Erosion and Dilation: Physics Greater than Biology

From the previous exercise, we can now use it for practical application. What can we do if we have an image of normal cells with some cancer cells mixed in it? Can we isolate the cancer cells? Lets try.

First, we can use paper punch outs as regular cells. Like normal human cells, these paper punch outs appear as non-nucleated cells, where the cell is relatively constant in terms of color. Now, from this image of purely regular cells, we find an average radius of these regular cells and their standard deviation. From this data, we can create a strel that can remove the regular cells from an image of a mixture of regular cells and cancer cells. So, let us begin.

First, we need to binarize the image to be able to apply properly the morphological operations. So, the first step of cleaning the image starts here. We need to find a proper threshold to separate the background paper and the cells of interest. But even with a proper threshold, we will not be able to completely remove the background paper with out destroying the cells image. So we allow a little background to appear white as long as the cells' shape are relatively preserved.

Next, we apply the opening morphological operation where we use erode then use dilate to return the images to their normal sizes. We use a circle of radius 10 pixels as strel. By using a circular strel, we can easily preserve the shape of the cells and may separate cells that have merged together in the binarization.

Next, we use bwlabel to recognize cells as a separate cell. bwlabel uses neighboring rules (specifically here, 8-neighbor rule) to qualify a certain pixel to be part of the same group. Now, since bwlabel uses a different integer for each cell group, finding the area is as easy as counting the number of pixels with the same integer for all the integers present in the image.

Finally, since we have a collection of all the areas calculated, all we need to do now is use the mean and stdev functions of scilab to get the mean area and standard deviation. We can evaluate the relevance of a certain calculated area in the histogram plot to see outliers in the calculations. These outliers are due to the fact some cells are placed on top of each other so much that they can no longer be separated.

Finally, we get a mean area of 452.49123 pixels and a standard deviation of 68.878548 pixels.
Original Image of Circles Processed Image of Circles

Now, for the more important part. We now have an idea how large a regular cell is. If we create a circle with the same radius as the largest regular cell, we can use it as the strel of an opening operation and eliminate all regular cells while returning the size of the cancer cell during the dilation.

So as with the first part of this exercise, we need to binarize and clean the image using the same method and the same strel. This will leave us an image of all regular cells as well as the cancer cells but now nice and clean.

Next, we use another opening operation this time using a circular strel with radius as that of the largest regular cell (we can increase it a little more just to be sure). After all that what we will have is an image of the cancer cells nice and isolated.
Original Image of Circles with Cancer Cells Location of Cancer Cells

For this exercise, I give my self a grade of 8 because of my late submission.

No comments:

Post a Comment