Beauchamp:CreateAFNIBRIKfromMR

From OpenWetWare
Revision as of 14:44, 9 April 2008 by Molly A Bryan (talk | contribs) (New page: == Converting DICOM Files to AFNI Files == DICOM is the standard file format for storing medical data. Typically each scan is saved in a unique folder and each file represents a single sl...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Converting DICOM Files to AFNI Files

DICOM is the standard file format for storing medical data. Typically each scan is saved in a unique folder and each file represents a single slice. OsiriX is a free DICOM viewer for Macs and can be downloaded from the following URL:

http://homepage.mac.com/rossetantoine/osirix/

Use to3d to convert the DICOM files to AFNI readable files. to3d can be used either from the command line or from a GUI interface.

Using to3d from the GUI interface

To load the GUI component of to3d just specify all the files from a single scan. Since each scan typically has its own folder this can be as simple as running to3d * from the correct folder. Below is a picture of the GUI interface with the most commonly edited options highlighted. Note that the bottom right of the window includes buttons to view the images, save the dataset, and quit. Normally to3d reads the variable information from the DICOM headers and nothing needs to be changed. Only the filename prefix needs to be set.

Using to3d from the command line (Faster)

to3d can also write files from the command line, which is particularly helpful when writing scripts to automate the task for several subjects. There are also more options from the command line. To see them all check the help file: to3d –help | more After the files have been created you should use 3dcopy to save a copy in the subject’s surfaces directory.

mkdir /surfaces/subject_name
mkdir /surfaces/subject_name/afni
3dcopy subjIDanatr /surfaces/subject_name/afni/subjIDanatr

Note that 3dcopy automatically moves the BRIK and HEAD files that share the prefix subjIDanatr, and the program also appends the header file’s history.

Averaging Anatomical Scans Using AFNI

To register all the anatomicals to the space of the anatomical closest in time to the functional data (generally anatr1), this is with just two anatomical's:

 3dAllineate -base ${subj}anatr1+orig -source ${subj}anatr2+orig -prefix ${subj}anatr2_2RegTo1 -verb -warp shift_rotate -cost mi -automask -1Dfile ${subj}anatr2toanatr1

Average anatomicals into one dataset:

 3dmerge -gnzmean -nscale -prefix ${subj}anatavg ${subj}anatr1+orig ${subj}anatr2_2RegTo1+orig