Monday, September 20, 2010

A10 – Binary Operations

First part: Finding the cells of ordinary cells

In this activity we apply what we have learned about morphological operations (see activity 9) for finding the area of cells.

This operation can actually be easily done using opening and closing operations, however, these functions are not present in scilab. Lucky for us, the said functions can also be done using the erode() and dilate() functions.

Remember this:
Open = Erode + Dilate
Close = Dilate + Erode

The image below is an image model of cells:


Figure 1: Image of cells

We divide this image into 9 sub-images...

Figure 2: Collage of sub-images of original image

To separate the cells from the background, we look at its histogram:

Figure 3: Histogram of one sub-image

Since we know that the background have a gray color, using the appropriate values for im2bw() (near white), we would end up with the binarized image below:



Note: For illustration purposes, the thresholded image above is just one sub-image of the original image, however, all the operations in this activity are applied to all the sub-images.

After getting the thresholded image, we may now apply erosion and dilation operations to fill-up the cells and separate cells that are overlapping. The result after applying these operations is the image below:


Figure 4: Sub-image after erosion and dilation

As you can see, some cells are reduced to smaller sizes than the original while other cells are still not separated from each other(which may be interpreted as larger cells in a 2D image). Since our goal is to average the cell sizes(areas), it would be wrong to use these "reduced in size cells" and "large cells" for finding the mean area. To solve this problem, we look at the histogram of areas of all cells:


Figure 5: Histogram of cell areas

Using this histogram, we may assign a specific threshold locating the cells for which we would get the areas from.

To get the area of a cell, we just add the pixels comprising each cell. Repeat this for all cells and find the mean.

Results:
Mean area: 451.69231
Variance: 66.891858

Second part: Isolating cancer cells

In this part of the activity, our goal is to locate the cancer cells in the image below:


Figure 6: Image of cells with cancer

In this model image, the cancer cells are represented by the larger cells. Fortunately, none of them are overlapping with the normal cells making our work a lot easier.

Basically, the same steps are applied but this time several erosion operations are applied to separate the cells from each other.

Here are the result:


The cancer cells are successfully isolated from the normal cells.

I would like to give myself a grade of 10/10 since I was able to obtain the results asked for.

Thanks to Joseph for the help.

No comments:

Post a Comment