Tumor

From ComputingForScientists

Jump to: navigation, search

Contents

  1. Problem Statement
    1. Malignant
    2. Benign
  2. Project
  3. Hints and Notes
    1. Algorithmic Statement Notes
    2. Algorithm translation example
    3. Algorithm implementation suggestion
    4. Code to produce a benign image

1. Problem Statement

You are a doctor. You are given the following set of images and asked to develop an algorithm that will detect benign and malignant tumors. The only information that you have is the following set of slides. In a few years more images will be available, but for now you are asked to develop a detector algorithm using the only available information.

1.1. Malignant


1.2. Benign


2. Project

Post the following on your wiki page in a section named Project:

  1. What is your algorithmic statement? (Draft to be turned in for review with HW #9, post final version in Project section)
  2. Write a program that reproduces the images for the malignant tumors. For hints, you may want to refer to the program that produces the benign images given below. (Draft to be turned in for review with HW #9)
  3. Write a program that implements your algorithm. If you discover that your algorithm must be revised, update your algorithm. (Draft to be turned in with HW #10)

Grading:

  1. If your program detects all benign tumors, 75%.
  2. If your program correctly identifies all benign and malignant tumors in the above 5 cases, 90%.
  3. If you program correctly identifies all benign and malignant tumors on a set of slides that will only be available after you submit your program, 100%.
  4. In-between scores will depend on your programs number of hits, misses, and false alarms.

3. Hints and Notes

3.1. Algorithmic Statement Notes

Write an algorithmic statement that will be translated into a computer program. Your statement must have two qualities:

  1. It should be a good algorithmic statement (a programmer, who thinks in terms of algorithms, will understand your statement).
  2. It should be a good detector algorithm (it should get the correct answer).

Example of good algorithmic statements:

If any black squares in the image, declare it malignant (but is a bad detector statement - catches only 3 out of the 5 cases).
If a black square has a black square to its left and to its right, declare it benign (also a bad detector statement).

Example of bad algorithmic statements

Any image with a kink is that of a malignant tumor. (Bad because a programmer does not understand what you mean by a "kink".)
Any image with an odd shape is that of a malignant tumor. (Bad because a typical programmer thinks straight lines are odd shapes.)

3.2. Algorithm translation example

To implement an algorithm in a computer language, use programming terms such as

  • Matrices
  • Arrays
  • Iteration
  • Nested loops
  • If statements
  • Variables such as i, i+1, and counter

Example:

The example algorithm statement was

If any black squares in the image, declare it malignant (but is a bad detector statement - catches only 3 out of the 5 cases).

This is translated to

Iterate through each row. Then iterate through each column. When any black square is found, declare the image to be that of a malignant tumor.

3.3. Algorithm implementation suggestion

When trying to implement an algorithm, it is often helpful to try a simplified version of the problem. For example, if you want to implement the statement:

If exactly three black squares in the matrix, declare benign

first, break it down into smaller problem. Instead of looking for exactly three black squares in a matrix, try to write a program that can detect three black squares in an array:

A = [0,1,0,0,0,0];
counter = 0;
for i = [1:6]
  if (A(i) == 1)
     counter = counter + 1
  end  
end

counter

if (counter == 1)
  disp('benign')
else
  disp('malignant')
end

3.4. Code to produce a benign image

for i = [1:20]
 for j = [1:20]
   M(i,j) = 0;
 end
end
M(11,3)  = 1;
M(12,3)  = 1;
M(13,3)  = 1;
M

colormap([1,1,1 ; 0,0,0])
imagesc(M);
axis square;grid on;
set(gca,'xtick',[1:20]);
set(gca,'ytick',[1:20]);
set(gca,'xaxislocation','top');
print -dpng benign1.png
Personal tools