CSE 455: Computer Vision

Autumn 2010


Homework 1
Binary Vision in Medical Image Analysis
Assigned October 4, 2010; Due October 11, 2010 11:59pm

Materials

Download the software and images you need: Windows rar file; Windows zip file; Linux rar file; Linux zip file; The code we give is in C/C++. You need to be able to understand C++, but if you are more comfortable coding in C, that should work. See Alfred for any explanations of code you need, or just email him.

Contents

The main goal of this assignment is to find organs of interest in CT images, using techniques of binary vision. The organs of interest are the kidneys, the liver, and the spleen, as shown below.

original kidney image isolated regions

We provide you with the CT images and the following image analysis operators:

thresh
threshold an image within a given range, producing a binary image
conrgn
compute connected regions in a binary image
autocolor
autocolor a connected region image

After you compile the provided code, you can try using these operators on some images.

What To Do

You'll have to code the following two image operators:
erode
perform erosion on a binary image
dilate
perform dilation on a binary image

Both of these operate on an image and a structuring element. You only need to support disc (circular) structuring elements of any user-specified diameter. The file BinaryOperator.cpp has some code to get you started.

Once you're done, you can use these, along with the provided operators, to experiment with some CT images.

The first problem is to find a threshold that will produce a binary image that has most of the organs separated into distinct regions. Use thresh to try various threshold ranges yourself.

The second problem is to use the morphological operators you have written, erode and dilate, to help separate organs that are connected together or to fill small holes in organs. Once you have a decent binary image, you can feed it to the connected components labeling operator conrgn to produce a labeled image, which should have a distinct label (low integers) for each region. You can convert this to pseudocolor using autocolor.

Use your thresholding, morphology, and labeling procedure on the CT abdomen images included in the software package. Here is an example command sequence (THE NUMBERS ARE ONLY EXAMPLES, NOT TO USE.):

thresh 64 128 kidney.pgm > kidney_thresh.pgm
erode d 10 kidney_thresh.pgm > kidney_erode.pgm
dilate d 10 kidney_erode.pgm > kidney_dilate.pgm
conrgn g kidney_dilate.pgm > kidney_regions.pgm
autocolor kidney_regions.pgm > kidney_color.ppm

This sequence of commands thresholds the CT image between gray values 64 and 128, then erodes with a disc of radius 10, then dilates with a disc of radius 10, then labels the connected regions, then creates a color image of the connected regions. When you do this yourself, you might want to try several different sequences of erosions and dilations.

NOTE: In your final code, make 2 modules, one for dilate and one for erode. They should use the EXACT SAME COMMAND SYNTAX shown above, so Alfred can test them. Alfread will test erosion and dilation both in the context of the whole program and separately to be sure they work. To be sure that your erode and dilate work as he expects, make sure that the command line "erode d 1 input.pgm > output.pgm" performs an erosion with the following structuring element to input.pgm, producing output.pgm,

0 1 0
1 1 1
0 1 0
and similarly for dilate. Note2: the "d" stands for disc.

Evaluation

Turnin

You must turn in:

  1. your code for erode and dilate which are well commented and in ASCII format so that the grader can compile them to working binaries.
  2. the results (which are images) of your thresholding, morphology, and labeling procedure on each of the three CT images, as well as the particular sequence of operations you used to get these results. This part can be either in MS Word, pdf, or html (web page) format. If you use a web page, send the URL by email, not the files and images, and make sure the web page is viewable by the deadline. Any modification made after the deadline will not be counted for your grade.

Please email your homework to Alfred (alfredg@cs.washington.edu).

Homework is due on October 11 (Monday) by 11:59 PM. Please plan your work early.

This is a one-person assignment. You may discuss it, but please turn in your own individual work. It is an exercise, so it should not be very hard.