Skip to content

AFNI and NIfTI Server for NIMH/NIH/PHS/DHHS/USA/Earth

Sections
Personal tools
You are here: Home » FAQs » How do I register data from the same subject taken on different days?

How do I register data from the same subject taken on different days?

Document Actions
Up to table of contents

Q70. How do I register data from the same subject taken on different days?
This is actually mildly complicated, since you need to deal with the possibility that the anatomical coverage of your functional slices between days may not completely overlap. The file README.registration describes in detail the AFNI approach to this problem. A partial summary is given below, but you must read the full documentation to do this properly.

If you have high resolution anatomical datasets from each day, then you can use 3dvolreg to register the anatomicals to a common base. 3dvolreg will report the rotation+shift used for this registration. You can then use the same parameters to run 3drotate to move the functional data to the base coordinates. (This is assuming the functional data is aligned with the anatomicals from the same day.)

Alignment of anatomicals is done with a command like this:

   3dvolreg -twopass -twodup -heptic -clipit -rotcom -verbose -verbose \
            -prefix S3.2nd.REG -base 'S3.1st+orig[0]' S3.2nd+orig

where the parameters chosen mean
  • -twopass means to use a coarse registration pass followed by the usual fine registration pass;
  • -twodup means to duplicate the 3D (x,y,z) origin of the base dataset into the output dataset;
  • -heptic -clipit defines the interpolation algorithm (when potentially moving images a long ways, the default -Fourier interpolation methods can cause wraparound from opposite edges);
  • -rotcom means to print out, at the end, the command to use with 3drotate to get the same effect as 3dvolreg; the output of the -rotcom option is something like:
    
       3drotate -heptic -clipit -rotate 2.338I -2.451R 0.985A -ashift 3.265S 2.476L 6.670P
    
    This fragment can be used to generate the correct commands for moving other datasets that are aligned with the input dataset to be aligned with the base dataset;
  • -verbose -verbose means to print out a lot of information about the progress of the program (this is optional);
  • -prefix S3.2nd.REG sets the prefix of the output dataset;
  • -base 'S3.1st+orig[0]' sets the base brick (the goal is to move the input dataset brick to match this);
  • S3.2nd+orig is the input dataset.
When registering high resolution anatomicals, a couple of problems may arise:
  • Noise around the edges, particularly at the inferior edge of the head, may make it hard to get a good match between the input and base datasets. This can be overcome by using the -edging option to 3dvolreg. This option instructs the program to ignore a layer of voxels around the edge of each 3D brick. The default edging is 5% of each dimension.
  • If the images are gathered with a local gradient coil (as is used at MCW), the region near the base of the brain may be geometrically distorted. This is because the gradient fields are no longer linear in space there. With such data, registration by 3D rigid rotation+shift is not capable of producing perfect alignment, since the two volumes are warped relative to each other. In this case, the best you can do is to increase the edging factor, so as to make the registration depend only on the images in the regions without distortion, and then live with the results in the distorted regions. The alternative is to get an image reconstruction program that takes into account the nonlinear distortion of the gradient fields, and corrects for this effect. Of course, this is easier said than done.
For these reasons, it is essential that you visually inspect the results of the registration before relying on it!

Please note that registering high resolution anatomicals is a very intensive computation; for example, 256x256x124 volumes uses 330+ MB of memory and 150-300 CPU seconds on a 600 MHz Pentium III machine. Don't try this on some wimpy machine!

[Answer added 10 Dec 2000, edited 04 Mar 2001]

This FAQ applies to: Any version.

Created by Robert Cox
Last modified 2006-06-07 15:38
 

Powered by Plone

This site conforms to the following standards: