Introduction | MCP | Matlab Investigation | C Implementation | Results | Conclusions | References | Appendix

Matlab Investigation of Motion-Compensated Prediction with the Cardiac Studies

After the block-matching estimation was written in Matlab, it was tested using some simple image sequences created in Matlab, for example small blocks moving with different periods in different directions. The same sequences were tested with a gradient background. (As an aside, it was interesting to note that when the blocks moved in the direction of the gradient, occlusion of the background caused some errors in the displacement vectors due to a different sum of absolute errors.) Once the function was verified, it was run in Matlab with DCT compression of the error images and uniform quantization of each block of the error images. Rate-distortion curves could not be created in Matlab without Huffman code, and so the lossless part of the compression system was only addressed in the C code. We did obtain very useful information from the spatial displacements, time buffer indices selected, and error images that allowed us to make good guesses of the rate-distortion performance.

Testing MCP with the Original Sequences
All images were of size 128 by 128. The block matching function used a block size of 16 by 16 pels, meaning it returned a total of 64 displacement vectors for dx and dy. To find the displacement vectors, each buffered block was shifted 16 times along the horizontal and vertical axes (in other words, each block was shifted 8 pixels in each of 4 directions) for each of the buffered previously reconstructed frames. The sum of absolute differences (SAD) was computed for each shift, and the minumim SAD was used to select each block's values for dx and dy. Since a heart cycle of about 16 frames was measured for the sequences, a buffer of 18 frames was used for long-term memory prediction of the original two sequences.

The Matlab MCP and reconstruction was first applied to the images in the short-axis study. Since a long-term memory buffer size of 18 was used, the first 19 frames were applied to the algorithm and reconstructed, with the 19th frame constructed with blocks from the entire buffer. This reconstructed image is shown in Figure 1a. Vectors representing the x and y displacement values for each block are shown superimposed on the image at the center of each block location. The same 19 frames were then reconstructed with a buffer size of 1. The reconstructed image and displacement vectors are shown in Figure 1b:


Figure 1. a) Reconstructed image with displacement vectors for each block shown superimposed. Long-term
MCP is used with a buffer of 18 images. b) Reconstructed image with displacement vectors for MCP
with a single image buffer.

For the long-term memory prediction, we show the reconstructed image with the block edges superimposed and the time buffer indices of each block in Figure 2. Here, 1 corresponds the the index of the previous reconstructed frame, and 18 would correspond the the furthest frame in the time buffer (in this case, the first frame.)


Figure 2.
Recostructed image showing long-term MCP time buffer indices
for each block in the 19th short-axis image.


Figure 3. a)
Error image for the long-term MCP prediction.
b) Error image for the single-frame MCP prediction.


Figure 4. a) Reconstructed image with displacement vectors for each block shown superimposed. Long-term MCP
is used with a buffer of 18 images.
b) Reconstructed image with displacement vectors for MCP with a single image buffer.


Figure 5.
Recostructed image showing long-term MCP time buffer indices
for each block in the 19th coronary image.


Figure 6. a)
Error image for the long-term MCP prediction.
b) Error image for the single-frame MCP prediction.


Testing with a Synthetic Sequence
To understand why there was so little difference between the performace of MCP with a frame buffer of 1 image and MCP with a frame buffer of many images including all phases in the cardiac cycle, we construct a stythetic sequence that is absolutely periodic: we take 5 frames and repeat them over and over. We then apply MCP and recostruction with a buffer of 10 frames, and reconstruct 11 images to see the results of a frame using a full time buffer. We also repeat the MCP and reconstruction using only the previous reconstructed frame.

We expect three things of long-term memory MCP and reconstruction with the synthetic sequence:

  1. The time displacement, here the indices of the frame buffer, should all be equal to the period of the sequence. In other words, the previous identical frame should be selected for each block.
  2. Since an identical frame is being selected, each block's displacement vectors should be zero.
  3. Since same frames are being selected, the error images should be nearly zero, meaning the error should only be equal to the quantization noise from lossy DCT compression of the previously reconstructed frame. (If no lossy compression is used in the system, then the error image should indeed be all zeros.)

The time displacement for each block was indeed 5, meaning that the correct quantized image was selected from the frame buffer, verifying our first test condition. The displacement vectors are plotted in Figure 7. Note that now there is a significant difference between vectors using different buffer sizes. For long-term memory MCP, the vectors were zero everywhere, except at the 4 corners outside the image where the displacement selected corresponded to the lowest sum of quantization noise, satisfying our second test condition.


Figure 7.Synthetic periodic 5-image repeated sequence:
a) Reconstructed image with displacement vectors for each block. Long-term MCP is used with a buffer of 10 images.
b) Reconstructed image with displacement vectors for MCP with a single image buffer.
Finally, we compare the error images of both MCP tests in Figure 8. While we have significant errors from using the previous frame as shown in b), when the long-term memory MCP selects the image at the same phase, the error is nearly zero and equal to the quantization noise in the reconstructed image (Figure 8a.)


Figure 8. a)
Error image for the long-term MCP prediction.
b) Error image for the single-frame MCP prediction.


MCP with Temporally Sub-Sampled Sequences
Since the previous frame was being selected during long-term memory MCP of the original sequences, the data was investigated for strong temporal correlations. MR data was acquired at a rate of 6 frames per second. To acquire data in real-time, each frame's 2D Fourier transform was acquired with a spiral trajectory [1]. A single spiral acquired at this speed, when gridded to an image, would have large sample spacing and therefore significant aliasing artifact. Therefore, as part of this fast-scanning tecnique, each of six spiral interleaves were used with a sliding-window reconstruction to create the 18 frame per second image sequence. Each interleaved spiral is rotated so that six subsequent spirals can all be gridded to produce an image with minimum aliasing artifact from spatial sampling of the data. Each MR measurement acquired 2 of the 6 spiral interleaves, meaning that the frames were assembled in the following way:

spiral interleaves:
1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 ...........
..|1 2 3 4 5 6| <------- 1st reconstructed image
........|3 4 5 6 1 2| <----- 2nd reconstructed image
............|5 6 1 2 3 4| <-- 3rd reconstructed image

This means that two-thirds of the data used to construct the current image were also used to construct the previous image. This means that subsequent images in the sequence are strongly correlated, and it is reasonable to expect that long-term memory prediction will often select the previous reconstructed frame.

We tested this by removing frame-to-frame data dependencies. We applied motion-compensated prediction and reconstruction to temporally sub-sampled versions of the image sequences. We started by sub-sampling both by a factor of six. The displacement vectors for the reconstructed frame using a single image and a long-term buffer are shown in figures 9 and 10. Now that each frame comes from a completely different data set, the single-frame prediction does much worse compared to when a long-term buffer is used.


Figure 9. Coronary image sequence temporally sub-sampled by a factor of 6. a) Difference
vectors for MCP with long-term memory. b) Difference vectors for MCP with the previous
reconstructed frame.


Figure 10. Short-axis image sequence temporally sub-sampled by a factor of 6. a) Difference
vectors for MCP with long-term memory. b) Difference vectors for MCP with the previous
reconstructed frame.

Figure 11 shows the values of the time buffer indices (equivalent to time displacement) for each block in each of the two predicted images. Now that the two image sequences are uncorrelated from frame to frame, very few of the blocks select the previous reconstructed frame.

a) b)
Figure 11.
Reconstructed image using MCP with long-term memory, showing time buffer
indices for each of the 16-by-16 blocks. a) Coronary sequence. b)Short-axis sequence.

An image sequence with a frame rate of 3 frames per second is not acceptable for a cardiac sequence. However, an image sequence with a frame rate of 9 frames per second might be acceptable. We sub-sampled the original 18 fps image sequences by a factor of two. The displacement vectors for the coronary image sequence tests are shown in Figure 12. There is still a significant difference in the displacement vectors between the long-term memory and single-frame predictions, because now only one-sixth of the data is the same between subsequent image frames.


Figure 12. Coronary image sequence temporally sub-sampled by a factor of 2. a) Difference
vectors for MCP with long-term memory. b) Difference vectors for MCP with the previous
reconstructed frame.

The error images are shown as mesh plots in figure 13 for magnitude comparison. The error is not reduced as significantly as in the synthetic sequence, but there is a distinguishable difference in a region of blocks. The error images are displayed in Figure 14 (a and b) to the same windowed levels. A reference image is shown in Figure 14c to gauge the locations of highest error in the single-frame MCP. Note that the error peaks are located in the region of highest heart motion, meaning that long-term MCP is picking a frame for those blocks closer to the same position in the cardiac cycle.


Figure 13. Error shown with mesh plots for comparison of magnitude.
a) After long-term memory MCP. b) After MCP with a single frame.



Figure 14. a) Error image after long-term memory MCP. b) Error image after MCP with a single
reconstructed frame, shown at same windowing level. Note locations of highest error are where
there is most periodic heart motion. c) Reconstructed image for reference of error location in b).



Introduction | MCP | Matlab Investigation | C Implementation | Results | Conclusions | References | Appendix