To 3D

  • Purpose: This command allows the user to take your raw images and convert them to AFNI format. Afni

    does however, now accept Analyze format, but I think overall there are some advantages to converting to the AFNI .BRIK & .HEAD format.

  • Usage: Below is an example of how to use this command. My lab has always taken the Pfile.7.mag and

    converted that to Analyze format first. So, the example below will show you how to go from Analyze format to AFNI format. If you'd like to learn how to convert to afni directly from the P.mag file, or if you have a completely different file structure, then I suggest you do one of three things: 1) go to the Afni website, 2) type "to3d -help" into a linux command prompt that has Afni installed, or 3) talk to Philippe Goldin who is the ultimate AFNI guru. I will give an explanation of my example below.

Functional Dataset Example

           to3d -prefix myfxnls -orient RPI -2swap -time:zt 12 210 2000 seq+z *hdr

Anatomical Dataset Example

           to3d -prefix anatomy -orient RPI seq+z anatomy*.hdr
  • The subcommand "-prefix" allows you to specify the output name for the files whether they be for an anatomical or functional dataset. It also tells to3d that you want to use the batch method of converting to afni, so a gui window will not open up. If you want the gui to open up, just leave out this option as well as the "-orient".
  • The "-orient RPI" option specifies the orientation of your 3D volumes. The code must be 3 letters, one from each of the pairs {R,I} {A,P} {I,S}. The first letter gives the orientation of the x-axis, the second the orientation of the y-axis, the third the z-axis:
      R = right-to-left              L = left-to-right
      A = anterior-to-posterior      P = posterior-to-anterior
      I = inferior-to superior       S = superior to inferior

As already mentioned with the "to3d" command you also have the option of having a GUI open up so you don't have to guess what direction your 3D volumes are in. If that is the case, just leave out the "- orient RPI" option and the "-prefix" option and the GUI will open automatically. Once you click on view images, you will want to go to the upper left corner of the window and select the orientation codes. At the bottom right corner you can put in your prefix name for the dataset.

  • For functional datasets, the "-time:zt 12 210 2000 seq+z" is used to specify the parameters of your scan. "-time:zt" specifies how your slices were collected in the time domain. Specifically, this subcommand tells "to3d" that your slices are input in the order z-axis first, then t-axis. The numbers "12 210 2000" are still a part of the -time:zt subcommand and refer to # of slices, # of timepoints collected, your TR. "seq+z" indicates that your slices were taken sequentially in the plus direction.
  • The "*hdr" refers to all of the analyze format images you collected for one particular run whether that run was for anatomical images or functional images.