3D Volreg

  • Purpose: 3dvolreg stands for 3d volume registration and is used for correcting your data for motion. As with

    other commands in afni you can learn more about all of the subcommands and parameters by typing in "3dvolreg -help" into the command line of a linux operating system that has afni installed.

  • Usage: Below are two examples of a 3dvolreg script. The first example illustrates how to realign your

    functional data to any timepoint (or subbrick as it's called by afni users) within that same scan. The second example illustrates how to realign your data to any timepoint (subbrick) within another scan.

Example 1: Realigning to same scan

           3dvolreg \
             -Fourier
             -prefix My_Realigned_Dataset \
             -base 1 \
             -1Dfile motion.1D \
             mydataset+orig                (mydataset should be slice timed)

Example 2: Realigning to separate scan

           3dvolreg \
             -Fourier
             -prefix My_Realigned_Dataset \
             -base 'firstscan+orig[1]' \
             -1Dfile motion.1D \
             -mydataset+orig
  • The subcommand "-Fourier" tells 3dvolreg to use the fourier interpolation method for motion correcting
  • The option "-prefix" tells Afni the name of the output file after it realigns your data.
  • The option "-base #" tells 3dvolreg which timepoint you want your dataset aligned to. Philippe Goldin suggests you determine this by looking at your raw dataset across time (very easy to do in AFNI) and see where there are a series of continuous timepoints that are relatively stable, and use one of those as your realignment timepoint.
  • The option "-base 'scanname[ ]'" is the command for realigning your dataset to a timepoint within a separate scan. I don't use this much because with the spinal cord, we can't have any movement, so we take anatomicals in between each functional run.
  • The subcommand "-1Dfile motion.1D" tells 3dvolreg to output the 6 corrected motion parameters to a text file called motion.1D.
  • "mydataset+orig" is the input dataset you would like to have realigned.