|
SPM99b
Spatial pre-processing: Coregistration
A. Procedure : single subject
B. Source code: spm_coregister.m
C. Notes
D. Slides99 notes
A. Procedure : single subject
Coregister SPM for functional MRI
Display
- please select image : ana0001.img (done)Reorient images …
Images to reorient : ana0001.img (done)reading current orientations
Reorienting images |
 |
Display
please select image : str0001.img (done)Images to reorient :
meanafmri_r10001.img
str0001.img
rafmri_r10010.img
~rafmri_r10013.img (done)
reading current orientations
Reorienting images |
Display
please select image:
meanafmri_r10001.img (done)Images to reorient :
meanafmri_r10001.img
rafmri_r10010.img
~rafmri_r10013.img (done)
reading current orientations
Reorienting images |
| Coregister •number of subjects: 1
•Which options?...
- Coregister only
- Reslice Only
- *Coregister & Reslice <x>
•Modality of first target image?...
- *target - PET
- target - T1 MRI
- target - T2 MRI
- target - PD MRI
- target - EPI <x>
- target - Transm
•Modality of first object image?...
- object - PET
- *object - T1 MRI <x>
- object - T2 MRI
- object - PD MRI
- object - EPI
- object - Transm
• select target image for subject 1:
meanafmri_r10001.img (done)
• select object image for subject 1:
str10001.img (done)
•select other images for subject 1: (done)
Coregister: working on subject 1
Rough Coregistration..
Segmenting..
Writing Segmented |
 |
| Coregister
•number of subjects: 1
•Which options?...
- Coregister only
- Reslice Only
- *Coregister & Reslice <x>
•Modality of first target image?...
- *target - PET
- target - T1 MRI<x>
- target - T2 MRI
- target - PD MRI
- target - EPI
- target - Transm
•Modality of first object image?...
- object - PET
- *object - T1 MRI <x>
- object - T2 MRI
- object - PD MRI
- object - EPI
- object - Transm
• select target image for subject 1:
rstrr0001.img (done)
• select object image for subject 1:
ana10001.img (done)
•select other images for subject 1: (done)
Coregister: working on subject 1
Rough Coregistration..
Segmenting..
Writing Segmented |
 |
B. Source code: spm_coregister.m
function spm_coregister(PGF, PFF, PGG, PFG, others,flags)
% Between and within mode image coregistration.
The TARGET image is the image to which the OBJECT image is registered. If there are any
OTHER images, then the same transformations are applied to these images as are applied to
the OBJECT image. The OBJECT image is the image to be registered to the TARGET image.
eg 1) to coregister a structural MR image to a sequence of PET images:
TARGET: meanPET1.img
OBJECT: MRI.img
OTHER: -
eg 2) to coregister a sequence of PET images to a structural MR image:
TARGET: T1MRI.img
OBJECT: meanPET1.img
OTHER: PET1.img PET2.img PET3.img etc...
eg 3) to coregister a structural MR image to a mean fMRI image:
TARGET: T2MRI.img
OBJECT: meanPET1.img
OTHER: PET1.img PET2.img PET3.img etc...
The program has two modes of operation:
1) If the modalities of the target image(s) and the object image(s) are
the same, then the program performs within mode coregistration by
minimising the sum of squares difference between the target and object.
2) If the target and object images have different modalities, a segmentation
(spm_segment) is carried out to partition the target and object into CSF, grey and white
matter. These partitions are then used in the coregistration. The following is performed:
i) Affine normalisation of object to a template of the same modality,
and affine normalisation of the target to a template of the same
modality. Only the parameters which describe rigid body
transformations are allowed to differ between these normalisations.
This produces a rough coregistration of the images.
ii) The images are partitioned into gray matter, white matter, csf and
(possibly) scalp using spm_segment.m. The mappings from images to
templates derived from the previous step are used to map from the
images to a set of a-priori probability images of GM, WM and CSF.
iii) These partitions are then registered together simultaneously, using
the results of step i as a starting estimate.
Coregister parameters are stored in the ".mat" files of the
"object" and the "other" images.
programers notes
%FORMAT spm_coregister(PGF, PFF, PGG, PFG, others,flags)
PGF - target image (the image to act as template).
PFF - object image (the image to reposition).
PGG - image to affine normalise target image to.
PFG - image to affine normalise object image to.
others - other images to apply same transformation to.
flags - any flags
n - only do first pass rough coregistration.
% FORMAT spm_coregister(PGF, PFF)
PGF - target image.
PFF - object image.
This form simply does a graphic display of how well the coregistration has worked.
C. Notes
- Registration forces the features in more than one image of the same to be in the same
pixel position. If we have several images of the same scene, which we wish to analysis
jointly, it simplifies matter if they match exactly, ie. Each pixel position corresponds
to the same part of the scene in the different images.
- The images may be different variables obtained with the same instrument, or same scene
viewed with different instrument , under different conditions or at different times,
sometimes the images will not exactly coincide, in which case, they must be distorted in
order to match. This process is known as image registration.
- Inter-modality registration is normally a three step procedure. The first step involves
simultaneous constrained affine registration of the images to a template. The affine
registration in this step is now more stable because it has been regularized. New
templates have been developed for this stage, including an EPI template for T2* fMRI. The
new templates are described in templates.man. The second step is segmentation, which has
been improved by having more correct images of prior probability. Other tweeks have also
been done in order to improve the results slightly. For example, better PET/MR
registration is possible when the CSF partition is not used.
- Step1) We have to discover what the image differences are.
Step2) To model the difference between the images: we can register all of the images to
one of the images which reduces to repeating two-images registration, or register all of
the images to a configuration based on the average position of the control points in the
different images.
Step3) Modify one of the images so that it matches the other. This is often referred to as
unwarping (or warping). If we have identified the distortion function as defined above, we
unwarp the second image so that it match the first.
D. Slides99 notes
1. Registration
Determine the rigid body transformation which minimises the sum of squared
difference between two images.
Rigid body transformation is defined by
- 3 translations in X, Y, Z directions,
- 3 rotations about X, Y, Z axes.
Operations can be represented as affine transformation matrixes.
2. Between Modality Coregistration
Can not be based on simply minimising sum of squares difference between the
images. eg, a PET image looks very different from an MR image.
3. A three step approach is used instead:
3-1. (Affine registrations) Simultaneous affine registrations between each image and
template images of the same modality.
a. Requires template images of the same modalities.
b. Both images are registered using 12 parameter affine transformations to their
corresponding templates by minimising the sum of squares difference.
c. Only the rigid-body transformation parameters differ between the two
registrations.
d. Thsi gives rigid-body mapping between the images, and affine mappings
between the images and the templates.
3-2. (PArtitioning) Partition of images into grey and white matter.
a. "Mixture model" cluster analysis to classify MR image as GM, WM and CSF.
b. Additional information is obtained from a prior probability images, which are
overlaid using previously determined affine transformations.
c. Assume that each MRI voxel is one of a number of distinct tissue types
(clusters). Each cluster has a (multivariate) normai distribution.
d. Iterative segmentation scheme: compute probabilities of each voxel
belonging to each cluster- weighting the probabilities with the a priori images
<-> Compute parameters which describe each cluster (weighted according to
the probabilities).
3-3. (Registration of Partitions)Final simultaneous registration of image partitions.
a. Grey and white matter partitions are registered using a rigid body
transformation
b. Simultaneously minimise sum of squared difference.
|