Skip to main content

Activity 10 Applications of Morphological Operation 3 of 3: Looping through images

When doing image-based measurements, we often want to separate the region of interest (ROI) from the background. One way to do this is by representing the ROIs as blobs. Binarizing the image using the optimum threshold obtained from the image histogram simplifies the task of segmenting the ROI.

Usually, we want to examine or process several ROIs in one image. We solve this by looping through the subimages and processing each. The binarized images may be cleaned using morphological operations. 

In this activity, we want to be able to distinguish simulated "normal cells" from simulated "cancer cells" by comparing their areas. We do this by taking the best estimate of the area of a "normal cell" and making it our reference. 

Figure 1 shows a scanned image of scattered punched papers which we imagine to be cells examined under the microscope. These will be the "normal cells."

Figure 1. Scattered punched paper digitized using flatbed scanner

This image was then cut up into several sub-images as shown in Figure 2. Some of the sub-images are overlapping. 
Figure 2. Sub-images produced from cutting up the image in Figure 1

To be able to determine a good threshold value for the sub-images their histograms (Figure 3) were examined.  
Figure 3. Histogram of the sub-images in Figure 2 
(the numbers on  histogram correspond to the numbers on the sub-images)  

Threshold values between 0.80 and 0.82 were used to binarize the images. The binarized images are shown in Figure 4.
Figure 4. Binarized images of the normal cells

The binarized images were then cleaned using morphological operations, specifically the OpenImage() and CloseImage() functions in the IPD 2.0 toolbox. After cleaning the images, the blobs were then labeled/tagged using the SearchBlobs() function. The blob image for each sub-image is shown in Figure 5. 
Figure 5. Blob images for the sub-images

We then take the areas of all the blobs for each sub-image and use them to create a histogram from which we can find the average area of a normal cell. The histogram is shown in Figure 6. We consider sizes between () to be the range of average area for an individual normal cell.
Figure 6. Area histogram of the blobs of all the sub-images

Now that we know the average area of a normal cell we can try to separate the cancer cells from the normal cells in the image in Figure 7a. The same techniques are used in creating the blob image in Figure 7b.   
Figure 7. Image of the "normal cells" together with "cancer cells"

Using the FIlterBySize function we separate the individual "cancer cells" from all the other cells. Shown below are the separated "cancer cells." Notice that there are some blobs that are just overlapping normal cells whose areas fall in the range of the cancer cells. 

Figure 8. Blob image "cancer cells" isolated using area thresholding

To eliminate these, we make use of the bounding box. For a cancer cell, it should approximate a square. The result of this technique is shown in Figure 9. We have successfully separated the individual "cancer cells" from blobs of overlapping normal cells! :D

Figure 9. Blob image of isolated "cancer cells" after considering 
the dimension of the bounding box
We can also apply the area threshold on the entire image using the FilterBySize function.  Shown in Figure 10 are the (a) blobs of individual normal cells,  (b) blobs that represent the cells which are not whole  and (c) blobs that represent the cells that are overlapping in the image. 

(a)
(b)
(c)
Figure 10. (a) individual normal cells (b) fraction of normal cells (c) overlapping normal cells

I would like to give myself a grade of 8 since I was able to achieve the objective of this activity. However, I posted the results late so I don't really deserve a perfect score. I would like to thank Ms. Maria Isabel Saludares for sharing the idea of using the Bounding Box and Ms. Maria Eloisa Ventura for helpful discussions. :)

References:
[1] M. Soriano, "Morphological Operations Part 3 of 3 - Looping through Images,"  Instruction Manual, 2012

Comments

  1. I think you deserve an 11. You went beyond the requirement by testing out fractions of cells and clumps of cells.

    ReplyDelete

Post a Comment

Popular posts from this blog

Activity 12: Basic Video Processing

Hello!  In this activity we will try to process a video of a kinematic event in order to extract information such as constants, frequencies, etc. For our group, we took a video of a 3D spring pendulum which we observed in one plane. We would like to trace its path and then try to determine its phase-space plot. The mass was covered in masking tape with the bottom colored red to facilitate easier segmentation. The video was taken using a Canon D10 camera at frame rate of 30fps.  Media 1. Video of the spring pendulum (first 50 frames only) The frames of the video were then extracted using Avidemux 2.5. The mass was then segmented from each frame using parametric segmentation. The patch of the region of interest (ROI) used for color segmentation is shown in Figure 1. Figure 1. Patch used to segment ROI  Using morphological operations, particularly Open and Close operations, the segmented images were cleaned. The extracted frames for different observation...

Activity 7: Morphological Operations

When talking about morphology, what immediately comes to mind are the forms and structures or shapes of objects. Hence, performing morphological operations imply that the shape or form of an object is altered.       In this activity, we will perform morphological operations on binary images. In particular, we make use of erosion and dilation . Erosion and dilation were performed on the following: 1. A 5×5 square 2. A triangle, base = 4 boxes, height = 3 boxes 3. A hollow 10×10 square, 2 boxes thick 4. A plus sign, one box thick, 5 boxes along each line Using each of the structuring elements below: 1. 2×2 ones 2. 2×1 ones 3. 1×2 ones 4. cross, 3 pixels long, one pixel thick. 5. A diagonal line, two boxes long, i.e. [[0 1],[1 0] ].      When performing these operations, it is important to note the “anchor” or “origin” of the structuring element in order to give an accurate prediction of the result. For the 2x2 ones, 2...