Next: Saving the Integrated Up: Some Basic Examples: Previous: Integrating Images

## Viewing and Comparing the Integrated Images

Now, we wish to view the integrated images. If you are using a colour console or an monochrome X terminal, enter the following to create a MATLAB figure window and display the image obtained by rectangular integration:

```
figure;
viewimage (PETsummed1);```
(Note that explicitly creating the window via the figure command is not really necessary. However, if you already had a figure window with a plot or image that you did not want to lose, MATLAB would have overwritten the existing figure when you called viewimage. It is generally good practice to call figure before creating new plots or images, unless you are sure you wish to obliterate whatever was previously in the current figure window.)

You may want to title this window:

```
title ('yates_19445, slice 8, rectangular integration');```

Now do the same thing for PETsummed2. You will probably want to move one or both figure windows so that you can see both images simultaneously. Clearly, the two images are similar-but if we want a more objective comparison, we can calculate the ratio of the two images on a pixel-by-pixel basis and view this:

```
ratio = PETsummed1 ./ PETsummed2;
figure;
viewimage (ratio);```

Note the use of the ./ operator to specify an element-by-element operation on two matrices. The resulting image shows that most of the pixels in PETsummed1 and PETsummed2 appear fairly close. However, because some pixels have such large values compared to 1, any small variations around 1 are swamped. One way to deal with this is simply to clip the image at certain points: for example, set all points below -10 to -10, and all points above 10 to 10. This is accomplished as follows:

```
clipneg = find (ratio < -10);
ratio (clipneg) = ones (size (clipneg)) * (-10);
clippos = find (ratio > 10);
ratio (clippos) = ones (size (clippos)) * (10);```

If you wish to know how many points were clipped at either end, type size (clipneg) or size (clippos).

If you now viewimage (ratio), it should be clear that the overall ratio between the two integrated images is close to 1 inside the head.

Next: Saving the Integrated Up: Some Basic Examples: Previous: Integrating Images

wolforth@pet.mni.mcgill.ca