Friday, 13 February 2015

TRACULA preprocessing

Step 1 (preprocessing)- 
  • Eddy-current compensation
  • Computing measures of head motion during the DWI scan
  • Intra-subject registration (individual DWI to individual T1)
  • Inter-subject registration (individual T1 to a common template space)
  • Creation of cortical and white-matter masks from FreeSurfer reconstructions
  • Tensor fitting for extract of tensor-based measures (FA, MD, etc)
  • Computing anatomical priors for white-matter pathways from the TRACULA atlas
Command is:

% trac-all -prep -c /home/.../config.file

Errors:
  • May get errors when trying to include all subjects in config file, couldn't figure out why so I created several config files splitting the subjects into smaller groups.
  • There may be issues with registration of the T1 to DTI data. You can check this by either overlaying the dmri/dtifit_FA.nii.gz and dlabel/aparc+aseg.bbr.nii files is fslview or freeview. Alternatively you can check the registration specifically using the command:
% tkregister2 --mov /home/.../dmri/dwi.nii.gz \
--reg /home/../dmir/xfms/anatorig2diff.bbr.dat --surf

  • There are several options for correcting a bad registration. Go into the TRACULA_OUTPUT/subject/scripts and open the trac-all.log. In there search for bbregister, keep searching until you find the bbregister command line and copy this into the command line to test on one subject only. You can substitute '--init-fsl' for '--init-header', '--init-spm' or --init-rr' (if don't have spm). I tried several options and in the end it was --init-spm that worked the best. - The command should be something like
% bbregister --s PDPLUS010 --init-header --dti --mov /home/.../dmri/dwi.nii.gz --reg /home/../dmri/xfms/anatorig2diff.bbr.dat --fslmat /home/../dmri/xfms/diff2anatorig.bbr.mat

use the command bbregister prints out to check the registration.

  • If this works and you now need to run all of the registrations again with the new option you will need to edit the trac-preproc script. Find $FREESURFER_HOME/bin/trac-preproc and copy it to your account. There you can search for '--init-header' and change this to '--init-spm'. You will also need a system administrator to copy the main trac-all script and edit this to specify that the new trac-preproc script is to be used. These edits mean that the one directory where this has been done will need to be used for all analysis, and for each command you will need to specify ./trac-all (whilst in the directory) for each command e.g.:
% ls /home/.../bbreg_TRAC
% ./trac-all -prep -c /home/config.file

  • You can now rerun the whole of the first preprocessing step again on all subjects. Check using fslview.
Step 2 (Ball and Stick model fit):
  • TRACULA uses the ball-and-stick model of diffusion to reconstruct the pathways from the DWI data. FSL's bedpostX fits the ball-and-stick model to the DWI data, estimating probability distributions of the parameters of this model at every voxel. This command will run bedpostX on the pre-processed data of all the subjects specified in the configuration file.
% ./trac-all -bedp -c /home/.../config.file
  • I did get some errors at this stage, system administrator fixed this (not sure what it was)
Step 3 (Reconstructing white matter pathways)

The final step is to generate the probability distributions for each white-matter bundles you specified in the configuration file. This is done by simultaneously fitting the shape of each pathway to the results of the ball-and-stick model of diffusion from above and to the prior knowledge of the pathway anatomy given by the set of manually labeled training subjects in the TRACULA atlas. The following command will reconstruct the probabilistic distribution of the pathways. 

% ./trac-all -path -c /home/.../config.file

  • you can check the output of the tract reconstruction either individual tracts:
freeview -v $TUTORIAL_DATA/diffusion_tutorial/elmo.2012/dmri/dtifit_FA.nii.gz \
            $TUTORIAL_DATA/diffusion_tutorial/elmo.2012/dpath/rh.ilf_AS_avg33_mni_bbr/path.pd.nii.gz:colormap=jet:isosurface=0,0:color='Red':name=rh.ilf \
            $TUTORIAL_DATA/diffusion_tutorial/elmo.2012/dpath/lh.ilf_AS_avg33_mni_bbr/path.pd.nii.gz:colormap=jet:isosurface=0,0:color='Red':name=lh.ilf
  • Or all together:
freeview -tv $TUTORIAL_DATA/diffusion_tutorial/elmo.2012/dpath/merged_avg33_mni_bbr.mgz \
         -v $TUTORIAL_DATA/diffusion_tutorial/elmo.2012/dmri/dtifit_FA.nii.gz &


  • Errors: you may find that some tracts are not reconstructed and do not show in the 3D view. I have created a separate page on how to fix this.











No comments:

Post a Comment