Monday, September 3, 2012

Applications of Morphological Operations Part 3 of 3

Image processing has made it a lot easier to automate naming of parasites in the human blood. Most of the parasites that attack the red blood cells cause the RBCs to have an enlarged shape - bigger than the normal. For example, when a person is affected with malaria, the image below should be seen under the microscope.

Plasmodium vivax

 This one is the case when the parasite present is Plasmodium vivax. It can be observed that the RBCs are larger than the normal.

In this activity, we are given an image of scattered punched papers which we will consider as cells. Th goal is to use all the image processing techniques that we have learned in order to get the area (in pixel count) of the "cells".


First, we are given the image below. The whole image will be cut into 256 x 256 subimage.



Original image


Here is the first sub-image.

1st Sub-image

I first worked on this image. I got the histogram of the image in order to get rid of those that are not cells. 

Histogram of the 1st sub-image
From the histogram of the image, I used SegmentByThreshold () of IPD to isolate the cells. The threshold is at 220. 

Binarized version of the thresholded image

I masked the image above so that we'll be able to isolate the cells. This is the best I can do to separate them. See image below.

Isolated Cells

I used a Bounding Box to emphasize the isolation. However, they were both enclosed in one box. I took the area of this cells inside by taking the length of the pixels which are true in this image and divided it by 2 since there are two circles. I got 510. So for now, this will be my "theoretical" area. This will help me easily filter the other sub-images such that I will only be calculating the isolated cells.

Since I now have a "theoretical" threshold. I will start processing the sub-images. I will use the FilterBySize() function of IPD, setting my SizeThreshold to 510. This means that filter those pixels with sizes less than 510.
To make sure that I am getting the correct area, I have another threshold which I set at 550. Using the same function. this will only show cells greater than the cells of interest. I subtracted the latter image to the former, giving me an image of the cells of interest only. Thus, it is easier for me to know their areas. 

Isolated Cell of Interest

To get the area, we count the number of pixels tagged wit the same number by AnalyzeBlobs () function of IPD. The area of this cell is 517 pixels. I will repeat the same procedure to the other sub-images and tally the area of isolated pixels. The code for getting the area is shown below.


s = length(BlobStatistics);
for i = 1:s
    [area(i)] = length(find(Filt_image1 == i));
end

BE = mean(area);
SD = stdev(area);
disp(area');


However, it was hard to automate the whole process. It was hard to have just one threshold for all the images. So, I have to get the area of the cells for all the sub-images manually.

The best estimate was determined to be 639 pixels with a standard deviation of 485.



ISOLATION OF CANCER CELLS

Another image of scattered punched papers was given to us. However, in this image, the size of the punched papers are not uniform. The presence of bigger punched papers can be attributed to "cancer" cells. The goal of the next part of the activity is to isolate the "cancer" cells n the image and estimate their sizes.

Circles with Cancer

For easy processing, this image was cut into sub-images. Since the 1st sub-image contains a "cancer" cell, I just used to 1st sub-image to accomplish this part of the activity.

1st sub-image of the image with a cancer cell


Using the same procedure as the first part of the activity, the final results is shown below.

Isolation of Cancer Cells
The area of the cancer cell in the image is determined to be 818 pixels.

I give myself 9/10 for this activity because I was able to accomplish the tasks except for the looping.

I thank Krizia Lampa for the helpful discussions. :)

References:

1. Image Processing with Scilab and Image Processing Design Toolbox
2. Soriano, M., Applications of Morphological Operations 3 of 3: Looping through Images

No comments:

Post a Comment