**Objective:**

To apply the Principal Component Analysis (PCA) on sets of MRI and
CT medical images.

Create a directory lab4 and copy all the files from my public directory into lab4 directory. Here is the command to do this:

% cp ~rt/public/hotelling/* . (don’t forget the .)

There are 12 images in BMP format, 6 MRI and 6 CT images, and a MATLAB code (hotelling.m) in that directory. The current version of the code works for 4 images. You may first start by taking only four images of a set and run the code to make sure it works correctly. Note that use the name of four images that exist in your directory.

After each run the code will generate the following data:

· The mean of all images used

· The eigenvalues corresponding to those images

· The covariance matrix

The program also creates three sets of images,

1) The original images,

2) The eigenimages, and

3) The reconstructed images using the selected eigenvalues.

When I used eb01, eb02, eb03, and eb04 images, the program produced
the following results.

>> hotelling

mean_y =

26.6492 26.8061 30.0067
37.0254

Which represent the mean of the four images in the same order that they were entered, i.e., mean of eb01, eb02, eb03, and eb04, respectively.

c =

1.0e+003 *

1.9372 0.9993
0.6436 0.7286

0.9993 1.6285
1.0940 0.8469

0.6436 1.0940
1.7158 1.4107

0.7286 0.8469
1.4107 2.2546

This is the covariance matrix Cx as we described it in class. On the diagonal you will see the correlation of an image with itself.

eigen_values =

1.0e+003 *

0.3522

0.8500

1.5510

4.7829

The above are the list of eigenvalues in the same order as the images were entered time 1000.

Here is what you need to do.

**Lab Activity (1)**

Take the MRI set (6 images) and run the code and record the means,
the eigenvalues, and determine the correlation values. Find out what kind
of correlation is held between each pair of image.

To eliminate an image from the reconstruction process, you will use the emin and emax to select a range of eigenvalues. For example, if you want to use all the eigenvalues of six images, then emin = 1, and emax = 6.

The first run should always include all eigenvalues which results in perfect reconstruction. Modify the program find the matrix of the difference between the original image and the reconstructed image to determine the accuracy of the reconstruction. Basically you will find the difference image, which is the subtraction of the reconstructed image from the original image. If you have a perfect reconstruction, then the image difference is an all 0 image.

Once you determined the most important components (highest eigenvalues), reconstruct the images of the set, using: 5 eigenimages, 4 eigenimages, 3 eigenimages, …, and 2 eigenimages by changing the emin. Every time, compute the difference image and see what the error is.

Write your conclusions here:

**Post-lab Activity**

Repeat similar process for the CT image set.