Anda di halaman 1dari 3

CS 359

Medical Image Registration


J. M. Fitzpatrick
Assignment 1
To become familiar with Matlab and its support for image processing, you can use
Matlabs Help Facility. The system provided by the E-School is:
Matlab Version 7.20.2232 (R2006a) with the Image Processing Toolbox,
Version 5.2 (R2006a).
Note that, while Registration is listed as part of the Image Processing Toolbox, it is
limited to two-dimensional (2D) point-based registration. We will work with threedimensional (3D) point-based registration and other registration methods as well, all in
3D, so the Image Processing Toolbox will not be used in this course.
Problem 1
For this problem you are to write a Matlab function called reformat that transforms an
image using an affine transformation. A call must look like this
new_image = reformat(image, vdim, A, t)

The array image can be 3D or 2D. If it is 3D, then new_image is also 3D. If image is
2D, then new_image is also 2D. The second argument, vdim, is a vector that gives the
dimensions in millimeters of one voxel of image (or one pixel, if image is 2D): vdim(1)
is the x dimension, vdim(2) is the y dimension, and, if image is 3D, vdim(3) is the z
dimension. All three are in millimeters. When image is displayed properly, each row will
appear as a horizontal line and each column as a vertical line (as expected). The origin is
at the upper left. The third dimension, if there is one, points into the screen in the
direction that you are looking. To see a 3D or 2D image displayed and to inspect its
values, you may use the function inspect_image, which is available by download in
Other Links.
The third and fourth arguments give the affine transformation. The meaning of this
transformation is that a point x in image moves to x = Ax + t in new_image. You may
assume that A is 3 by 3 and t is 3 by 1 (i.e., a column vector) if image is 3D and that A
is 2 by 2 and t is 2 by 1 if image is 2D. A is unitless; the units of t are millimeters.
Use linear interpolation. Two handy functions are interp2 and interp3. If a point in
new_image comes from a point that lies outside image, then that point is to be treated
as if it had an intensity of zero.
To test your solution you may use the three images provided for download in Other
Links:

im_tiny, which is 32 by 32 by 4, and for which vdim = [10.0, 10.0, 26.0]


im_small, which is 64 by 64 by 8, and for which vdim = [5.0, 5.0, 13.0]
MR_markers , which is 256 by 256 by 26, and for which vdim = [1.25, 1.25,

4.0]

The first two images are lower resolution versions of the third image, which is an MR
image of a patient acquired in a study. (The patients in this study have given written
permission for me to use these images.) Markers were attached to the patient before
imaging and are most clearly visible in the high resolution version.
You may compare your results for various A and t by running jmf_reformat, which is
also provided in Other Links in the file jmf_reformat.p. This file is a compiled version
of jmf_reformat.m. You can run it, just as you would jmf_reformat.m, but you cannot
open it in the editor and see Matlab code.
Problem 2
Write a function called localize that finds the intensity-weighted centroids of box-shaped
regions of an image, when given the centers of the boxes in units of voxels and the
dimensions of the boxes (all boxes have the same dimensions) in units of millimeters.
[See pages 463-465 of Fitzpatrick, Hill, and Maurer]. The call should look like this
centroids = localize(image, vdim, centers, sx, sy, sz, i0)

You should assume that image is 3D. The argument vdim has the same meaning as in
Problem 1.The argument centers is an array giving the x, y, and z coordinates, in that
order, in units of voxels (not millimeters) of the center of one box in each of its columns.
You may assume that the coordinates in centers are integers. You may not assume that
sx, sy, and sz are integers. These latter three arguments are the lengths of the sides of the
boxes in millimeters. The argument i0 is the intensity of an empty voxel. The intensity of
an empty voxel for MR_markers is zero, but you should not assume that it will always
be zero when writing your function. (It may be tested for a situation in which it is not
zero.)
The array centroids is a list of the x, y, and z coordinates of the centroids, which will
almost never be exact integers. Each row of this array gives the x, y, and z coordinates, in
that order, in millimeters, for one centroid.
You may use MR_markers as an image to test your program. Use inspect_image to
find values to put into centers and to determine good values for sx, sy, and sz. Good
values will allow you to place each rectangle so that it encloses all, or almost all, of a
marker and nothing, or almost nothing, else.
In calculating a centroid, you should include every voxel that is partly (or wholly) inside
the box.

Anda mungkin juga menyukai