ENGGE4620/6620: HOMEWORK 5

Filtering in the spatial domain

The goal of this homework is to get familiar with image processing in the spatial domain by means of convolution filters

In order to reduce noise in MR images, the acquisition is repeated several times, and the resulting frames are averaged. The result is an improved signal-to-noise ratio (SNR). This behavior can be simulated with the following 6 frames showing one slice of MR data of the liver. Please download all 6 images.

1 Frame 1 Frames 1 and 2
2 Frame 2 Frames 1 through 3
3 Frame 3 Frames 1 through 4
4 Frame 4 Frames 1 through 5
5 Frame 5 Frames 1 through 6
6 Frame 6          

For the signal-to-noise ratio, we will use the approximation that was introduced recently, i.e. image average divided by the standard deviation. A good choice for a region of interest (ROI) would be a homogeneous section in the liver, for example a rectangle from (109,186) to (171,303). Make sure that you position the ROI identically for each measurement. Help -> image info provides you with the ROI coordinates, and if you really want to be precise, you can use the Macro immediate execution function to enter `setroi (109,186,171,303);ยด.The function Measure -> Statistics provides you with average and SD inside the ROI.

Task 1: Show that SNR really increases with the square root of the number of slices averaged. Crystal Image offers a function (File -> Open Multiple) to load multiple slices into a "stack". To load images 1 and 2, you would enter liver[12].tif as file name. For images 1,2, and 3, the file name would be liver[123].tif etc. Under the menu Special, you'll find the timecourse function which allows you to average the slices.
Part 1: Since we expect SNR to increase proportionally with the square root of the number of slices, we expect the 2-slice SNR to be about 40% higher than the 1-slice SNR, and the 4-slice SNR to be about twice the 1-slice SNR. Finally, the 6-slice average should have about 2.5 time the SNR. Do your results confirm this?
Part 2: You will likely find a systematic deviation from the square root scheme: SNR increases less than expected with a higher number of slices. Explain why (hint: our SNR formula is merely an approximation. What would you expect for the theoretical SNR of an ideal, noise-free image; and how does our approximation differ?).

Task 2: Edge detection and sharpening operations emphasize the noise component. Apply the Sobel operator to one slice and to your 4-slice average. Print the resulting images.

Task 3: Smoothing suppresses noise. Apply a smoothing operation to slice 1 and determine the SNR. How does the SNR compare to your 4-slice average? How does the smoothed image with an edge detector applied (Sobel operator) compare to the edge images from Task 2?

Task 4: Convolution is a linear operation. You can apply the smoothing filter two times. Instead, you can also convolve the image with a single kernel to achieve the same effect. Determine and present this kernel. Along the same lines, applying the 3x3 box filter (averaging) kernel twice is not the same as applying a 5x5 box filter. What is the kernel equivalent to two successive applications of the 3x3 box filter? Which operation needs more multiplications overall, the repeated application of a 3x3 filter or the single application of a 5x5 filter?

Task 5: We have seen in Task 2 that noise is detrimental for edge-detection. This is also valid for sharpening, an operation that slightly emphasizes edges. Take a noisy image (e.g. slice 1) and sharpen it. Determine the SNR and compare it to the SNR found in Task 1. If you smooth before sharpening, do you expect a net benefit? To answer this question, determine and present the resulting single 5x5 mask. Then apply both operations on your slice in sequence and determine the resulting SNR. What is the visual effect of the combined operation?

Due date and turnin

Homework is due on 11-10-2011.

The turnin may either be a typewritten printed paper or a file sent by e-mail. If you decide to send an e-mail, you MUST use the word "HOMEWORK" in capital letters in the subject line. Otherwise I won't guarantee that I received your homework. Electronic submissions should have a single attachment with the concise report, which contains all explanations, equations, and figures. Also note that I will grade electronic submissions on-screen. Only typewritten and printed turnins can be returned to you with comments.

Maximum score is 20 points, 5 points for Task 1, 2 points for Task 2, 3 points for Task 3, 5 points for Task 4, and 5 points for Task 5.

Late turnin penalty: For each late day, you lose 1 point from your total score.

Early turnin bonus: If your homework is done before the due date, you may present your work for a brief evaluation. If I find significant errors, I will point those out and return the homework to you for revision. You may turn in a revised version by the due date.

Notes

The instructions above refer to Crystal Image, but this homework can be solved with many other biomedical image processing programs, including ImageJ and IMAL. You are free to choose the software.

Crystal Image users may use the following macro to simplify the SNR measurement. The macro takes the presently displayed image, selects a suitable ROI, measures mean (m) and standard deviation (sd), and finally prints the estimated SNR.

macro liver_snr:

	a = mainimage;
	setroi (106, 168, 211, 319);
	m = measure (a, 0);
	sd = user[1];
	snr = m / (sd*sd);
	print ("Estimated SNR: ", snr);
	setroi ();

endmacro;

Important: Crystal Image handles a variety of image formats, including a floating- point representation of the pixel. Most other programs cannot open those files. If you want to export a TIFF file and make sure that a word processor such as OpenOffice Writer displays the image properly, you need to make sure that your image is in 8-bit format. Choose Edit -> Data Type and select 8-bit uchar. Hit OK and save your image as TIFF.