## page was renamed from FsTutorial/RunningTracula [[https://surfer.nmr.mgh.harvard.edu/fswiki/Tutorials|Back to list of all tutorials]] | [[FsTutorial|Back to course page]] | [[FsTutorial/Tracula|Previous]] | [[FsTutorial/TraculaOutputs|Next]] <> = Running TRACULA = == Remember... == For '''each new''' terminal that you open, you must do: {{{ export SUBJECTS_DIR=$TUTORIAL_DATA/tracula_tutorial/fs cd $TUTORIAL_DATA/tracula_tutorial }}} === If you are at an organized course === Running the commands described below will take more time than you have for this tutorial, so please '''DO NOT RUN''' these commands right now. All the data has already been processed for you! === If you are not at an organized course === If you are '''NOT''' taking one of the formally organized courses, then to follow this exercise exactly be sure you've downloaded the [[FsTutorial/Data|tutorial data set]] before you begin. If you choose not to download the data set you can follow these instructions on your own data, but you will have to substitute your own specific paths and subject names. These are the commands that you need to run before getting started: {{{ ## bash export FREESURFER_HOME=/path/to/freesurfer source $FREESURFER_HOME/SetUpFreeSurfer.sh export TUTORIAL_DATA= export SUBJECTS_DIR=$TUTORIAL_DATA/tracula_tutorial/fs cd $TUTORIAL_DATA/tracula_tutorial/ ## tcsh setenv FREESURFER_HOME /path/to/freesurfer source $FREESURFER_HOME/SetUpFreeSurfer.csh setenv TUTORIAL_DATA setenv SUBJECTS_DIR $TUTORIAL_DATA/tracula_tutorial/fs cd $TUTORIAL_DATA/tracula_tutorial }}} If you are not using the tutorial data you should set your {{{SUBJECTS_DIR}}} to the directory in which the recon(s) of the subject(s) you will use for this tutorial are located. '''IMPORTANT:''' Please make sure that you have the latest version of !FreeSurfer installed, including [[Tracula/#Updates|the latest TRACULA updates,]] before running this tutorial. -------- There are three steps involved in processing individual subjects with TRACULA: * Pre-processing * FSL's {{{bedpostX}}} * Reconstructing white-matter pathways The three steps must be run in this order, using the command {{{trac-all.}}} * '''Martinos Center users:''' Do not submit {{{trac-all}}} as a job on the cluster using pbsubmit. Instead, run {{{trac-all}}} directly on the command line. If run on the cluster, {{{trac-all}}} will submit each subject listed in the [[FsTutorial/Tracula|configuration file]] as a seperate job on the cluster. Adding -jobs to the trac-all command line will process the configuration file, set up the analysis for all subjects included in it, but will not actually run the analysis. Instead, it will write the commands that need to be run into . The user is then responsible for submitting those as jobs to be run in parallel on a cluster. == Pre-processing == Some pre-processing of the diffusion image data is needed before white-matter pathways can be reconstructed by TRACULA. This pre-processing includes: * Compensation for B0 inhomogeneity and eddy-current distortions * Computing measures of head motion during the DWI scan * Intra-subject registration (individual DWI to individual T1) * Inter-subject registration (individual to a common template space) * Tensor fitting for extraction of tensor-based measures (FA, MD, etc) * Computing anatomical priors for white-matter pathways from a manually annotated set of training subjects All of the above pre-processing steps can be run by passing the {{{-prep}}} command-line option to {{{trac-all}}} as follows: {{{#!wiki caution '''Do not run these commands if you're at an organized course.''' It will take a while and has already been done for you. }}} {{{ trac-all -prep -c $TUTORIAL_DATA/tracula_tutorial/dmrirc.tutorial }}} The argument of the {{{-c}}} command-line option is the [[FsTutorial/Tracula|configuration file]], where preferences for these pre-processing steps can be specified. == 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. {{{bedpostx}}} should only be run on a computer with high computational power, for more information on {{{bedpostx}}} [[https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FDT/UserGuide#BEDPOSTX|click here]]. This command will run {{{bedpostX}}} on the pre-processed data of all the subjects specified in the configuration file: {{{ trac-all -bedp -c $TUTORIAL_DATA/tracula_tutorial/dmrirc.tutorial }}} == Reconstructing white-matter pathways == The final step is to generate the probability distributions for all [[https://dmri.mgh.harvard.edu/tract-atlas/|42 white-matter pathways]] or for the subset of pathways that 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 obtained from the manually annotated set of training subjects that comprise the TRACULA atlas. The following command will generate the probability distributions of the pathways: {{{ trac-all -path -c $TUTORIAL_DATA/tracula_tutorial/dmrirc.tutorial }}} == Check for output files == There are many output files from each step, and the [[trac-all | trac-all]] page has a complete list. You do not need to know what all of them are. In the following sections of the tutorial, we will inspect some the key outputs closely. Now let's look at the results! Click on '''Next''' below. -------- = Summary = By the end of this page, you should know how to: * Run TRACULA (3 commands) * Look up the output files from each step [[https://surfer.nmr.mgh.harvard.edu/fswiki/Tutorials|Back to list of all tutorials]] | [[FsTutorial|Back to course page]] | [[FsTutorial/Tracula|Previous]] | [[FsTutorial/TraculaOutputs|Next]]