Differences between revisions 13 and 14
Deletions are marked like this. Additions are marked like this.
Line 4: Line 4:
'''Note:''' The information on this page refers to TRACULA in the latest version of !FreeSurfer (6.0). Available options and their default values in this version may differ from [[dmrircPastVersions|past versions.]]

== Example 1: Cross-sectional study ==
The following is an example dmrirc file for the most common scenario, where only one diffusion scan from a single time point is available for each subject. A copy of this file is available in the !FreeSurfer distribution as:
'''Note:''' The information on this page refers to TRACULA in the latest version of !FreeSurfer (7.2). Available options and their default values in this version may differ from [[dmrircPastVersions|past versions.]]

== Example 1: Cross-sectional study, one diffusion scan per session ==
This example sets up a TRACULA analysis for a cross-sectional study where there is a single diffusion scan for each subject. A copy of this file is available in the !FreeSurfer distribution as:
Line 44: Line 44:
# Diffusion gradient tables (if there is a different one for each scan)
# Must be specified if they cannot be read from the DICOM headers
# Diffusion gradient tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
Line 55: Line 55:
# Diffusion gradient table (if using the same one for all scans)
# Must be specified if it cannot be read from the DICOM headers
# The table must have either three columns, where each row is a gradient vector
# or three rows, where each column is a gradient vector
# There must be as many gradient vectors as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvecfile = /path/to/bvecs.txt

# Diffusion b-value tables (if there is a different one for each scan)
# Must be specified if they cannot be read from the DICOM headers
# Diffusion b-value tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
Line 73: Line 64:
# Diffusion b-value table (if using the same one for all scans)
# Must be specified if it cannot be read from the DICOM headers
# There must be as many b-values as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvalfile = /path/to/bvals.txt

# Perform registration-based B0-inhomogeneity compensation?
# Default: 0 (no)
#
set dob0 = 1

# Input B0 field map magnitude DICOMs (file names relative to dcmroot)
# Perform correction for B0 inhomogeneity distortions?
# 0: No correction (default)
# 1: Perform correction based on a field map
# Requires additional inputs (see below): b0mlist, b0plist, echospacing
# 2: Perform correction based on reverse-polarity images
# Requires additional inputs (see below): echospacing, pedir, epifactor
#
set dob0 = 2

# Input B0 field map magnitude DICOMs (file names can be relative to dcmroot)
Line 91: Line 79:
# Input B0 field map phase DICOMs (file names relative to dcmroot) # Input B0 field map phase DICOMs (file names can be relative to dcmroot)
Line 97: Line 85:
# Echo spacing for field mapping sequence (from sequence printout)
# Only used if dob0 = 1
# Echo spacing (this is found in the scanner protocol printout)
# Only used if dob0 = 1 or 2
Line 103: Line 91:
# Perform registration-based eddy-current compensation? # Perform correction for eddy-current distortions?
# 0: No correction
# 1: Perform registration-based correction with eddy_correct
# 2: Perform model-based correction with eddy (default)
#
set doeddy = 2

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1 or 2
Line 106: Line 102:
set doeddy = 1

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1
set dorotbvecs = 1

# Intra-subject (diffusion-to-T1) registration method
# 1: Affine with a correlation ratio cost
# 2: Affine with a mutual information cost
# 3: Affine with a boundary-based cost (default)
#
set intrareg = 3

# Degrees of freedom for intra-subject registration
# Can be 6 (rigid), 9 (rigid+scaling), or 12 (full affine)
# Default: 6 for infants, 9 otherwise
#
set intradof = 6

# Maximum rotation angle (degrees) for intra-subject registration
# Default: 3 for infants, 90 otherwise
#
set intrarot = 90

# Inter-subject registration method
# 1: Affine T1-to-T1 with a correlation ratio cost
# 2: Affine T1-to-T1 with a mutual information cost
# 3: Affine T1-to-T1 with a robust cost (default for infants)
# 4: Nonlinear T1-to-T1 with CVS
# 5: Nonlinear FA-to-FA with SyN (default)
#
set interreg = 5

# Target brain for inter-subject registration
# Default for affine T1-to-T1:
# $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
# Default for nonlinear T1-to-T1:
# $FREESURFER_HOME/subjects/cvs_avg35/
# Default for nonlinear FA-to-FA:
# $FREESURFER_HOME/trctrain/hcp/MGH35_HCP_FA_template.nii.gz
#
set intertrg = /path/to/a/duck/template.nii.gz

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
Line 112: Line 145:
set dorotbvecs = 1 set usemaskanat = 1
Line 120: Line 153:
# Perform diffusion-to-T1 registration by flirt?
# Default: 0 (no)
#
set doregflt = 0

# Perform diffusion-to-T1 registration by bbregister?
# Default: 1 (yes)
#
set doregbbr = 1

# Perform registration of T1 to MNI template?
# Default: 1 (yes)
#
set doregmni = 1

# MNI template
# Only used if doregmni = 1
# Default: $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
#
set mnitemp = /path/to/mni_template.nii.gz

# Perform registration of T1 to CVS template?
# Default: 0 (no)
#
set doregcvs = 0

# CVS template subject ID
# Only used if doregcvs = 1
# Default: cvs_avg35
#
set cvstemp = donald

# Parent directory of the CVS template subject
# Only used if doregcvs = 1
# Default: $FREESURFER_HOME/subjects
#
set cvstempdir = /path/to/cvs/atlases/of/ducks

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
# Default: 1 (yes)
#
set usemaskanat = 1
Line 165: Line 154:
# Default: All paths in the atlas
#
set pathlist = ( lh.cst_AS rh.cst_AS \
                 lh.unc_AS rh.unc_AS \
                 lh.ilf_AS rh.ilf_AS \
                 fmajor_PP fminor_PP \
                 lh.atr_PP rh.atr_PP \
                 lh.ccg_PP rh.ccg_PP \
                 lh.cab_PP rh.cab_PP \
                 lh.slfp_PP rh.slfp_PP \
                 lh.slft_PP rh.slft_PP )
# Default: All paths in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set pathlist = ( lh.uf rh.uf cc.rostrum )
Line 179: Line 160:
# paths specified in pathlist
# Default: 7 for the forceps major, 6 for the corticospinal tract,
# 4 for the angular bundle, and 5 for all other paths
#
set ncpts = (6 6 5 5 5 5 7 5 5 5 5 5 4 4 5 5 5 5)
# paths specified in pathlist (recommended, with more points for longer paths)
# Default: As in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set ncpts = ( 7 7 5 )
Line 227: Line 207:
== Example 2: Longitudinal study ==
The following is an example dmrirc file for a longitudinal analysis, where multiple diffusion scans from different time points are available for each subject. A copy of this file is available in the !FreeSurfer distribution as:
== Example 2: Longitudinal study, one diffusion scan per session ==
This example sets up a TRACULA analysis for a longitudinal study where there is a single diffusion scan per visit. A copy of this file is available in the !FreeSurfer distribution as:
Line 251: Line 231:
set subjlist = ( huey-scan1 \
                 huey-scan2 \
                 dewey-scan1 \
                 dewey-scan2 \
                 louie-scan1 \
                 louie-scan2 )
set subjlist = ( huey-visit1 \
                 huey-visit2 \
                 dewey-visit1 \
                 dewey-visit2 \
                 louie-visit1 \
                 louie-visit2 )
Line 284: Line 264:
# Diffusion gradient tables (if there is a different one for each scan)
# Must be specified if they cannot be read from the DICOM headers
# Diffusion gradient tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
Line 291: Line 271:
set bveclist = (/path/to/huey/year1/bvecs.txt \
                /path/to/huey/year2/bvecs.txt \
                /path/to/dewey/year1/bvecs.txt \
                /path/to/dewey/year2/bvecs.txt \
                /path/to/louie/year1/bvecs.txt \
                /path/to/louie/year2/bvecs.txt)

# Diffusion gradient table (if using the same one for all scans)
# Must be specified if it cannot be read from the DICOM headers
# The table must have either three columns, where each row is a gradient vector
# or three rows, where each column is a gradient vector
# There must be as many gradient vectors as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvecfile = /path/to/bvecs.txt

# Diffusion b-value tables (if there is a different one for each scan)
# Must be specified if they cannot be read from the DICOM headers
set bveclist = ( /path/to/huey/year1/bvecs.txt \
                 /path/to/huey/year2/bvecs.txt \
                 /path/to/dewey/year1/bvecs.txt \
                 /path/to/dewey/year2/bvecs.txt \
                 /path/to/louie/year1/bvecs.txt \
                 /path/to/louie/year2/bvecs.txt )

# Diffusion b-value tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
Line 312: Line 283:
set bvallist = (/path/to/huey/year1/bvals.txt \
                /path/to/huey/year2/bvals.txt \
                /path/to/dewey/year1/bvals.txt \
                /path/to/dewey/year2/bvals.txt \
                /path/to/louie/year1/bvals.txt \
                /path/to/louie/year2/bvals.txt)

# Diffusion b-value table
# Must be specified if it cannot be read from the DICOM headers
# There must be as many b-values as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvalfile = /path/to/bvals.txt

# Perform registration-based B0-inhomogeneity compensation?
# Default: 0 (no)
#
set dob0 = 1

# Input B0 field map magnitude DICOMs (file names relative to dcmroot)
set bvallist = ( /path/to/huey/year1/bvals.txt \
                 /path/to/huey/year2/bvals.txt \
                 /path/to/dewey/year1/bvals.txt \
                 /path/to/dewey/year2/bvals.txt \
                 /path/to/louie/year1/bvals.txt \
                 /path/to/louie/year2/bvals.txt )

# Perform correction for B0 inhomogeneity distortions?
# 0: No correction (default)
# 1: Perform correction based on a field map
# Requires additional inputs (see below): b0mlist, b0plist, echospacing
# 2: Perform correction based on reverse-polarity images
# Requires additional inputs (see below): echospacing, pedir, epifactor
#
set dob0 = 2

# Input B0 field map magnitude DICOMs (file names can be relative to dcmroot)
Line 342: Line 310:
# Input B0 field map phase DICOMs (file names relative to dcmroot) # Input B0 field map phase DICOMs (file names can be relative to dcmroot)
Line 353: Line 321:
# Echo spacing for field mapping sequence (from sequence printout)
# Only used if dob0 = 1
# Echo spacing (this is found in the scanner protocol printout)
# Only used if dob0 = 1 or 2
Line 359: Line 327:
# Perform registration-based eddy-current compensation? # Perform correction for eddy-current distortions?
# 0: No correction
# 1: Perform registration-based correction with eddy_correct
# 2: Perform model-based correction with eddy (default)
#
set doeddy = 2

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1 or 2
Line 362: Line 338:
set doeddy = 1

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1
set dorotbvecs = 1

# Intra-subject (diffusion-to-T1) registration method
# 1: Affine with a correlation ratio cost
# 2: Affine with a mutual information cost
# 3: Affine with a boundary-based cost (default)
#
set intrareg = 3

# Degrees of freedom for intra-subject registration
# Can be 6 (rigid), 9 (rigid+scaling), or 12 (full affine)
# Default: 6 for infants, 9 otherwise
#
set intradof = 6

# Maximum rotation angle (degrees) for intra-subject registration
# Default: 3 for infants, 90 otherwise
#
set intrarot = 90

# Inter-subject registration method
# 1: Affine T1-to-T1 with a correlation ratio cost
# 2: Affine T1-to-T1 with a mutual information cost
# 3: Affine T1-to-T1 with a robust cost (default for infants)
# 4: Nonlinear T1-to-T1 with CVS
# 5: Nonlinear FA-to-FA with SyN (default)
#
set interreg = 5

# Target brain for inter-subject registration
# Default for affine T1-to-T1:
# $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
# Default for nonlinear T1-to-T1:
# $FREESURFER_HOME/subjects/cvs_avg35/
# Default for nonlinear FA-to-FA:
# $FREESURFER_HOME/trctrain/hcp/MGH35_HCP_FA_template.nii.gz
#
set intertrg = /path/to/a/duck/template.nii.gz

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
Line 368: Line 381:
set dorotbvecs = 1 set usemaskanat = 1
Line 376: Line 389:
# Perform diffusion-to-T1 registration by flirt?
# Default: 0 (no)
#
set doregflt = 0

# Perform diffusion-to-T1 registration by bbregister?
# Default: 1 (yes)
#
set doregbbr = 1

# Perform registration of T1 to MNI template?
# Default: 1 (yes)
#
set doregmni = 1

# MNI template
# Only used if doregmni = 1
# Default: $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
#
set mnitemp = /path/to/mni_template.nii.gz

# Perform registration of T1 to CVS template?
# Default: 0 (no)
#
set doregcvs = 0

# CVS template subject ID
# Only used if doregcvs = 1
# Default: cvs_avg35
#
set cvstemp = donald

# Parent directory of the CVS template subject
# Only used if doregcvs = 1
# Default: $FREESURFER_HOME/subjects
#
set cvstempdir = /path/to/cvs/atlases/of/ducks

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
# Default: 1 (yes)
#
set usemaskanat = 1
Line 421: Line 390:
# Default: All paths in the atlas
#
set pathlist = ( lh.cst_AS rh.cst_AS \
                 lh.unc_AS rh.unc_AS \
                 lh.ilf_AS rh.ilf_AS \
                 fmajor_PP fminor_PP \
                 lh.atr_PP rh.atr_PP \
                 lh.ccg_PP rh.ccg_PP \
                 lh.cab_PP rh.cab_PP \
                 lh.slfp_PP rh.slfp_PP \
                 lh.slft_PP rh.slft_PP )
# Default: All paths in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set pathlist = ( lh.uf rh.uf cc.rostrum )
Line 435: Line 396:
# paths specified in pathlist
# Default: 7 for the forceps major, 6 for the corticospinal tract,
# 4 for the angular bundle, and 5 for all other paths
#
set ncpts = (6 6 5 5 5 5 7 5 5 5 5 5 4 4 5 5 5 5)
# paths specified in pathlist (recommended, with more points for longer paths)
# Default: As in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set ncpts = ( 7 7 5 )
Line 483: Line 443:
== Example 3: Cross-sectional study, multiple diffusion scans per session ==
This example sets up a TRACULA analysis for a cross-sectional study where there are multiple diffusion scans per subject. The different diffusion scans in a session may be acquired with different gradient direction sets or be repetitions of the same direction set; they may be acquired with reverse phase-encode directions (in which case they can be used for B0 distortion correction) or with the same phase-encode direction (in which case they can still be combined, but cannot be used for distortion correction). A copy of this file is available in the !FreeSurfer distribution as:

{{{
$FREESURFER_HOME/bin/dmrirc.multiscan.example
}}}

The comments over each parameter explain the default settings. Remove a parameter from the dmrirc file if you want use its default value. Parameters that don't have default values must be specified.

Any other commands that you might want to run before an analysis could also be added to this file.

{{{
# FreeSurfer SUBJECTS_DIR
# T1 images and FreeSurfer segmentations are expected to be found here
#
setenv SUBJECTS_DIR /path/to/recons/of/ducks

# Output directory where trac-all results will be saved
# Default: Same as SUBJECTS_DIR
#
set dtroot = /path/to/tracts/of/ducks

# Subject IDs
# Here each subject is listed twice because it has two diffusion scans
#
set subjlist = ( huey huey dewey dewey louie louie )

# In case you want to analyze only Huey and Louie
# Default: Run analysis on all subjects
#
set runlist = (1 2 5 6)

# Input diffusion DICOMs (file names relative to dcmroot)
# If original DICOMs don't exist, these can be in other image format
# but then the gradient table and b-value table must be specified (see below)
#
set dcmroot = /path/to/dicoms/of/ducks
set dcmlist = ( huey/run4/XXX-1.dcm \
                huey/run8/XXX-1.dcm \
                dewey/run5/XXX-1.dcm \
                dewey/run9/XXX-1.dcm \
                louie/run4/XXX-1.dcm \
                louie/run8/XXX-1.dcm )

# Diffusion gradient tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# The tables must have either three columns, where each row is a gradient vector
# or three rows, where each column is a gradient vector
# There must be as many gradient vectors as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bveclist = ( /path/to/huey/run4/bvecs.txt \
                 /path/to/huey/run8/bvecs.txt \
                 /path/to/dewey/run5/bvecs.txt \
                 /path/to/dewey/run9/bvecs.txt \
                 /path/to/louie/run4/bvecs.txt \
                 /path/to/louie/run8/bvecs.txt )

# Diffusion b-value tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# There must be as many b-values as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvallist = ( /path/to/huey/run4/bvals.txt \
                 /path/to/huey/run8/bvals.txt \
                 /path/to/dewey/run5/bvals.txt \
                 /path/to/dewey/run9/bvals.txt \
                 /path/to/louie/run4/bvals.txt \
                 /path/to/louie/run8/bvals.txt )

# Perform correction for B0 inhomogeneity distortions?
# 0: No correction (default)
# 1: Perform correction based on a field map
# Requires additional inputs (see below): b0mlist, b0plist, echospacing
# 2: Perform correction based on reverse-polarity images
# Requires additional inputs (see below): echospacing, pedir, epifactor
#
set dob0 = 2

# Echo spacing (this is found in the scanner protocol printout)
# Only used if dob0 = 1 or 2
# Default: None
#
set echospacing = 0.35

# Phase-encode direction (this is found in the scanner protocol printout)
# One for each diffusion scan above (must differ between runs in a session)
# In this example, each session contains an AP- and a PA-encoded diffusion scan
# Only used if dob0 = 2
# Default: None
#
set pedir = ( AP PA AP PA AP PA )

# EPI factor (this is found in the scanner protocol printout)
# Only used if dob0 = 2
# Default: None
#
set epifactor = 140

# Perform correction for eddy-current distortions?
# 0: No correction
# 1: Perform registration-based correction with eddy_correct
# 2: Perform model-based correction with eddy (default)
#
set doeddy = 2

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1 or 2
# Default: 1 (yes)
#
set dorotbvecs = 1

# Intra-subject (diffusion-to-T1) registration method
# 1: Affine with a correlation ratio cost
# 2: Affine with a mutual information cost
# 3: Affine with a boundary-based cost (default)
#
set intrareg = 3

# Degrees of freedom for intra-subject registration
# Can be 6 (rigid), 9 (rigid+scaling), or 12 (full affine)
# Default: 6 for infants, 9 otherwise
#
set intradof = 6

# Maximum rotation angle (degrees) for intra-subject registration
# Default: 3 for infants, 90 otherwise
#
set intrarot = 90

# Inter-subject registration method
# 1: Affine T1-to-T1 with a correlation ratio cost
# 2: Affine T1-to-T1 with a mutual information cost
# 3: Affine T1-to-T1 with a robust cost (default for infants)
# 4: Nonlinear T1-to-T1 with CVS
# 5: Nonlinear FA-to-FA with SyN (default)
#
set interreg = 5

# Target brain for inter-subject registration
# Default for affine T1-to-T1:
# $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
# Default for nonlinear T1-to-T1:
# $FREESURFER_HOME/subjects/cvs_avg35/
# Default for nonlinear FA-to-FA:
# $FREESURFER_HOME/trctrain/hcp/MGH35_HCP_FA_template.nii.gz
#
set intertrg = /path/to/a/duck/template.nii.gz

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
# Default: 1 (yes)
#
set usemaskanat = 1

# Fractional intensity threshold for BET mask extraction from low-b images
# This mask is used only if usemaskanat = 0
# Default: 0.3
#
set thrbet = 0.5

# Paths to reconstruct
# Default: All paths in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set pathlist = ( lh.uf rh.uf cc.rostrum )

# Number of path control points
# It can be a single number for all paths or a different number for each of the
# paths specified in pathlist (recommended, with more points for longer paths)
# Default: As in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set ncpts = ( 7 7 5 )

# List of training subjects
# This text file lists the locations of training subject directories
# Default: $FREESURFER_HOME/trctrain/trainlist.txt
#
set trainfile = $FREESURFER_HOME/trctrain/trainlist.txt

# Number of "sticks" (anisotropic diffusion compartments) in the bedpostx
# ball-and-stick model
# Default: 2
#
set nstick = 2

# Number of MCMC burn-in iterations
# (Path samples drawn initially by MCMC algorithm and discarded)
# Default: 200
#
set nburnin = 200

# Number of MCMC iterations
# (Path samples drawn by MCMC algorithm and used to estimate path distribution)
# Default: 7500
#
set nsample = 7500

# Frequency with which MCMC path samples are retained for path distribution
# Default: 5 (keep every 5th sample)
#
set nkeep = 5

# Reinitialize path reconstruction?
# This is an option of last resort, to be used only if one of the reconstructed
# pathway distributions looks like a single curve. This is a sign that the
# initial guess for the pathway was problematic, perhaps due to poor alignment
# between the individual and the atlas. Setting the reinit parameter to 1 and
# rerunning "trac-all -prior" and "trac-all -path", only for the specific
# subjects and pathways that had this problem, will attempt to reconstruct them
# with a different initial guess.
# Default: 0 (do not reinitialize)
#
set reinit = 0
}}}

== Example 4: Longitudinal study, multiple diffusion scans per session ==
This example sets up a TRACULA analysis for a longitudinal study where there are multiple diffusion scans per visit. The different diffusion scans in a session may be acquired with different gradient direction sets or be repetitions of the same direction set; they may be acquired with reverse phase-encode directions (in which case they can be used for B0 distortion correction) or with the same phase-encode direction (in which case they can still be combined, but cannot be used for distortion correction). A copy of this file is available in the !FreeSurfer distribution as:

{{{
$FREESURFER_HOME/bin/dmrirc.long.multiscan.example
}}}

The comments over each parameter explain the default settings. Remove a parameter from the dmrirc file if you want use its default value. Parameters that don't have default values must be specified.

Any other commands that you might want to run before an analysis could also be added to this file.

{{{
# FreeSurfer SUBJECTS_DIR
# T1 images and FreeSurfer segmentations are expected to be found here
#
setenv SUBJECTS_DIR /path/to/recons/of/ducks

# Output directory where trac-all results will be saved
# Default: Same as SUBJECTS_DIR
#
set dtroot = /path/to/tracts/of/ducks

# Subject IDs (one per scan per time point per subject)
# In this example, each time point of each subject is listed twice because
# there are two diffusion scans from each time point
#
set subjlist = ( huey-visit1 \
                 huey-visit1 \
                 huey-visit2 \
                 huey-visit2 \
                 dewey-visit1 \
                 dewey-visit1 \
                 dewey-visit2 \
                 dewey-visit2 \
                 louie-visit1 \
                 louie-visit1 \
                 louie-visit2 \
                 louie-visit2 )

# Longitudinal base template subject IDs (one for each scan above)
#
set baselist = ( huey \
                 huey \
                 huey \
                 huey \
                 dewey \
                 dewey \
                 dewey \
                 dewey \
                 louie \
                 louie \
                 louie \
                 louie )

# In case you want to analyze only Huey and Louie
# Default: Run analysis on all time points and subjects
#
set runlist = (1 2 3 4 9 10 11 12)

# Input diffusion DICOMs (file names relative to dcmroot)
# If original DICOMs don't exist, these can be in other image format
# but then the gradient table and b-value table must be specified (see below)
#
set dcmroot = /path/to/dicoms/of/ducks
set dcmlist = ( huey/year1/run4/XXX-1.dcm \
                huey/year1/run8/XXX-1.dcm \
                huey/year2/run4/XXX-1.dcm \
                huey/year2/run8/XXX-1.dcm \
                dewey/year1/run5/XXX-1.dcm \
                dewey/year1/run9/XXX-1.dcm \
                dewey/year2/run5/XXX-1.dcm \
                dewey/year2/run9/XXX-1.dcm \
                louie/year1/run4/XXX-1.dcm \
                louie/year1/run8/XXX-1.dcm \
                louie/year2/run4/XXX-1.dcm \
                louie/year2/run8/XXX-1.dcm )

# Diffusion gradient tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# The tables must have either three columns, where each row is a gradient vector
# or three rows, where each column is a gradient vector
# There must be as many gradient vectors as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bveclist = ( /path/to/huey/year1/run4/bvecs.txt \
                 /path/to/huey/year1/run8/bvecs.txt \
                 /path/to/huey/year2/run4/bvecs.txt \
                 /path/to/huey/year2/run8/bvecs.txt \
                 /path/to/dewey/year1/run5/bvecs.txt \
                 /path/to/dewey/year1/run9/bvecs.txt \
                 /path/to/dewey/year2/run5/bvecs.txt \
                 /path/to/dewey/year2/run9/bvecs.txt \
                 /path/to/louie/year1/run4/bvecs.txt \
                 /path/to/louie/year1/run8/bvecs.txt \
                 /path/to/louie/year2/run4/bvecs.txt \
                 /path/to/louie/year2/run8/bvecs.txt )

# Diffusion b-value tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# There must be as many b-values as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvallist = ( /path/to/huey/year1/run4/bvals.txt \
                 /path/to/huey/year1/run8/bvals.txt \
                 /path/to/huey/year2/run4/bvals.txt \
                 /path/to/huey/year2/run8/bvals.txt \
                 /path/to/dewey/year1/run5/bvals.txt \
                 /path/to/dewey/year1/run9/bvals.txt \
                 /path/to/dewey/year2/run5/bvals.txt \
                 /path/to/dewey/year2/run9/bvals.txt \
                 /path/to/louie/year1/run4/bvals.txt \
                 /path/to/louie/year1/run8/bvals.txt \
                 /path/to/louie/year2/run4/bvals.txt \
                 /path/to/louie/year2/run8/bvals.txt )

# Perform correction for B0 inhomogeneity distortions?
# 0: No correction (default)
# 1: Perform correction based on a field map
# Requires additional inputs (see below): b0mlist, b0plist, echospacing
# 2: Perform correction based on reverse-polarity images
# Requires additional inputs (see below): echospacing, pedir, epifactor
#
set dob0 = 2

# Echo spacing (this is found in the scanner protocol printout)
# Only used if dob0 = 1 or 2
# Default: None
#
set echospacing = 0.35

# Phase-encode direction (this is found in the scanner protocol printout)
# One for each diffusion scan above (must differ between runs in a session)
# In this example, each session contains an AP- and a PA-encoded diffusion scan
# Only used if dob0 = 2
# Default: None
#
set pedir = ( AP PA AP PA AP PA AP PA AP PA AP PA )

# EPI factor (this is found in the scanner protocol printout)
# Only used if dob0 = 2
# Default: None
#
set epifactor = 140

# Perform correction for eddy-current distortions?
# 0: No correction
# 1: Perform registration-based correction with eddy_correct
# 2: Perform model-based correction with eddy (default)
#
set doeddy = 2

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1 or 2
# Default: 1 (yes)
#
set dorotbvecs = 1

# Intra-subject (diffusion-to-T1) registration method
# 1: Affine with a correlation ratio cost
# 2: Affine with a mutual information cost
# 3: Affine with a boundary-based cost (default)
#
set intrareg = 3

# Degrees of freedom for intra-subject registration
# Can be 6 (rigid), 9 (rigid+scaling), or 12 (full affine)
# Default: 6 for infants, 9 otherwise
#
set intradof = 6

# Maximum rotation angle (degrees) for intra-subject registration
# Default: 3 for infants, 90 otherwise
#
set intrarot = 90

# Inter-subject registration method
# 1: Affine T1-to-T1 with a correlation ratio cost
# 2: Affine T1-to-T1 with a mutual information cost
# 3: Affine T1-to-T1 with a robust cost (default for infants)
# 4: Nonlinear T1-to-T1 with CVS
# 5: Nonlinear FA-to-FA with SyN (default)
#
set interreg = 5

# Target brain for inter-subject registration
# Default for affine T1-to-T1:
# $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
# Default for nonlinear T1-to-T1:
# $FREESURFER_HOME/subjects/cvs_avg35/
# Default for nonlinear FA-to-FA:
# $FREESURFER_HOME/trctrain/hcp/MGH35_HCP_FA_template.nii.gz
#
set intertrg = /path/to/a/duck/template.nii.gz

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
# Default: 1 (yes)
#
set usemaskanat = 1

# Fractional intensity threshold for BET mask extraction from low-b images
# This mask is used only if usemaskanat = 0
# Default: 0.3
#
set thrbet = 0.5

# Paths to reconstruct
# Default: All paths in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set pathlist = ( lh.uf rh.uf cc.rostrum )

# Number of path control points
# It can be a single number for all paths or a different number for each of the
# paths specified in pathlist (recommended, with more points for longer paths)
# Default: As in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set ncpts = ( 7 7 5 )

# List of training subjects
# This text file lists the locations of training subject directories
# Default: $FREESURFER_HOME/trctrain/trainlist.txt
#
set trainfile = $FREESURFER_HOME/trctrain/trainlist.txt

# Number of "sticks" (anisotropic diffusion compartments) in the bedpostx
# ball-and-stick model
# Default: 2
#
set nstick = 2

# Number of MCMC burn-in iterations
# (Path samples drawn initially by MCMC algorithm and discarded)
# Default: 200
#
set nburnin = 200

# Number of MCMC iterations
# (Path samples drawn by MCMC algorithm and used to estimate path distribution)
# Default: 7500
#
set nsample = 7500

# Frequency with which MCMC path samples are retained for path distribution
# Default: 5 (keep every 5th sample)
#
set nkeep = 5

# Reinitialize path reconstruction?
# This is an option of last resort, to be used only if one of the reconstructed
# pathway distributions looks like a single curve. This is a sign that the
# initial guess for the pathway was problematic, perhaps due to poor alignment
# between the individual and the atlas. Setting the reinit parameter to 1 and
# rerunning "trac-all -prior" and "trac-all -path", only for the specific
# subjects and pathways that had this problem, will attempt to reconstruct them
# with a different initial guess.
# Default: 0 (do not reinitialize)
#
set reinit = 0
}}}

dmrirc

This is a configuration file that can be used to set various options of the TRACULA processing stream. This file is passed to trac-all with the -c command-line option. It is a tcsh script file that is sourced by trac-all before any other commands are run.

Note: The information on this page refers to TRACULA in the latest version of FreeSurfer (7.2). Available options and their default values in this version may differ from past versions.

Example 1: Cross-sectional study, one diffusion scan per session

This example sets up a TRACULA analysis for a cross-sectional study where there is a single diffusion scan for each subject. A copy of this file is available in the FreeSurfer distribution as:

$FREESURFER_HOME/bin/dmrirc.example

The comments over each parameter explain the default settings. Remove a parameter from the dmrirc file if you want use its default value. Parameters that don't have default values must be specified.

Any other commands that you might want to run before an analysis could also be added to this file.

# FreeSurfer SUBJECTS_DIR
# T1 images and FreeSurfer segmentations are expected to be found here
# 
setenv SUBJECTS_DIR /path/to/recons/of/ducks

# Output directory where trac-all results will be saved
# Default: Same as SUBJECTS_DIR
#
set dtroot = /path/to/tracts/of/ducks

# Subject IDs
#
set subjlist = (huey dewey louie)

# In case you want to analyze only Huey and Louie
# Default: Run analysis on all subjects
#
set runlist = (1 3)

# Input diffusion DICOMs (file names relative to dcmroot)
# If original DICOMs don't exist, these can be in other image format
# but then the gradient table and b-value table must be specified (see below)
#
set dcmroot = /path/to/dicoms/of/ducks
set dcmlist = (huey/day1/XXX-1.dcm dewey/day1/XXX-1.dcm louie/day2/XXX-1.dcm)

# Diffusion gradient tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# The tables must have either three columns, where each row is a gradient vector
# or three rows, where each column is a gradient vector
# There must be as many gradient vectors as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bveclist = (/path/to/huey/bvecs.txt \
                /path/to/dewey/bvecs.txt \
                /path/to/louie/bvecs.txt)

# Diffusion b-value tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# There must be as many b-values as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvallist = (/path/to/huey/bvals.txt \
                /path/to/dewey/bvals.txt \
                /path/to/louie/bvals.txt)

# Perform correction for B0 inhomogeneity distortions?
# 0: No correction (default)
# 1: Perform correction based on a field map
#    Requires additional inputs (see below): b0mlist, b0plist, echospacing
# 2: Perform correction based on reverse-polarity images
#    Requires additional inputs (see below): echospacing, pedir, epifactor
#
set dob0 = 2

# Input B0 field map magnitude DICOMs (file names can be relative to dcmroot)
# Only used if dob0 = 1
# Default: None
#
set b0mlist = (huey/fmag/XXX-1.dcm dewey/fmag/XXX-1.dcm louie/fmag/XXX-1.dcm)

# Input B0 field map phase DICOMs (file names can be relative to dcmroot)
# Only used if dob0 = 1
# Default: None
#
set b0plist = (huey/fphas/XXX-1.dcm dewey/fphas/XXX-1.dcm louie/fphas/XXX-1.dcm)

# Echo spacing (this is found in the scanner protocol printout)
# Only used if dob0 = 1 or 2
# Default: None
#
set echospacing = 0.7

# Perform correction for eddy-current distortions?
# 0: No correction
# 1: Perform registration-based correction with eddy_correct
# 2: Perform model-based correction with eddy (default)
#
set doeddy = 2

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1 or 2
# Default: 1 (yes)
#
set dorotbvecs = 1

# Intra-subject (diffusion-to-T1) registration method
# 1: Affine with a correlation ratio cost
# 2: Affine with a mutual information cost
# 3: Affine with a boundary-based cost (default)
#
set intrareg = 3

# Degrees of freedom for intra-subject registration
# Can be 6 (rigid), 9 (rigid+scaling), or 12 (full affine)
# Default: 6 for infants, 9 otherwise
#
set intradof = 6

# Maximum rotation angle (degrees) for intra-subject registration
# Default: 3 for infants, 90 otherwise
#
set intrarot = 90

# Inter-subject registration method
# 1: Affine T1-to-T1 with a correlation ratio cost 
# 2: Affine T1-to-T1 with a mutual information cost
# 3: Affine T1-to-T1 with a robust cost (default for infants)
# 4: Nonlinear T1-to-T1 with CVS
# 5: Nonlinear FA-to-FA with SyN (default)
#
set interreg = 5

# Target brain for inter-subject registration
# Default for affine T1-to-T1:
#   $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
# Default for nonlinear T1-to-T1:
#   $FREESURFER_HOME/subjects/cvs_avg35/
# Default for nonlinear FA-to-FA:
#   $FREESURFER_HOME/trctrain/hcp/MGH35_HCP_FA_template.nii.gz
#
set intertrg = /path/to/a/duck/template.nii.gz

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
# Default: 1 (yes)
#
set usemaskanat = 1

# Fractional intensity threshold for BET mask extraction from low-b images
# This mask is used only if usemaskanat = 0
# Default: 0.3
#
set thrbet = 0.5

# Paths to reconstruct
# Default: All paths in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set pathlist = ( lh.uf rh.uf cc.rostrum )

# Number of path control points
# It can be a single number for all paths or a different number for each of the
# paths specified in pathlist (recommended, with more points for longer paths)
# Default: As in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set ncpts = ( 7 7 5 )

# List of training subjects
# This text file lists the locations of training subject directories
# Default: $FREESURFER_HOME/trctrain/trainlist.txt
#
set trainfile = $FREESURFER_HOME/trctrain/trainlist.txt

# Number of "sticks" (anisotropic diffusion compartments) in the bedpostx
# ball-and-stick model
# Default: 2
#
set nstick = 2

# Number of MCMC burn-in iterations
# (Path samples drawn initially by MCMC algorithm and discarded)
# Default: 200
#
set nburnin = 200

# Number of MCMC iterations
# (Path samples drawn by MCMC algorithm and used to estimate path distribution)
# Default: 7500
#
set nsample = 7500

# Frequency with which MCMC path samples are retained for path distribution
# Default: 5 (keep every 5th sample)
#
set nkeep = 5

# Reinitialize path reconstruction?
# This is an option of last resort, to be used only if one of the reconstructed
# pathway distributions looks like a single curve. This is a sign that the
# initial guess for the pathway was problematic, perhaps due to poor alignment
# between the individual and the atlas. Setting the reinit parameter to 1 and
# rerunning "trac-all -prior" and "trac-all -path", only for the specific
# subjects and pathways that had this problem, will attempt to reconstruct them
# with a different initial guess.
# Default: 0 (do not reinitialize)
#
set reinit = 0

Example 2: Longitudinal study, one diffusion scan per session

This example sets up a TRACULA analysis for a longitudinal study where there is a single diffusion scan per visit. A copy of this file is available in the FreeSurfer distribution as:

$FREESURFER_HOME/bin/dmrirc.long.example

The comments over each parameter explain the default settings. Remove a parameter from the dmrirc file if you want use its default value. Parameters that don't have default values must be specified.

Any other commands that you might want to run before an analysis could also be added to this file.

# FreeSurfer SUBJECTS_DIR
# T1 images and FreeSurfer segmentations are expected to be found here
# 
setenv SUBJECTS_DIR /path/to/recons/of/ducks

# Output directory where trac-all results will be saved
# Default: Same as SUBJECTS_DIR
#
set dtroot = /path/to/tracts/of/ducks

# Subject IDs (one per time point per subject)
#
set subjlist = ( huey-visit1 \
                 huey-visit2 \
                 dewey-visit1 \
                 dewey-visit2 \
                 louie-visit1 \
                 louie-visit2 )

# Longitudinal base template subject IDs (one for each time point above)
#
set baselist = ( huey \
                 huey \
                 dewey \
                 dewey \
                 louie \
                 louie )

# In case you want to analyze only Huey and Louie
# Default: Run analysis on all time points and subjects
#
set runlist = (1 2 5 6)

# Input diffusion DICOMs (file names relative to dcmroot)
# If original DICOMs don't exist, these can be in other image format
# but then the gradient table and b-value table must be specified (see below)
#
set dcmroot = /path/to/dicoms/of/ducks
set dcmlist = ( huey/year1/dwi/XXX-1.dcm \
                huey/year2/dwi/XXX-1.dcm \
                dewey/year1/dwi/XXX-1.dcm \
                dewey/year2/dwi/XXX-1.dcm \
                louie/year1/dwi/XXX-1.dcm \
                louie/year2/dwi/XXX-1.dcm )

# Diffusion gradient tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# The tables must have either three columns, where each row is a gradient vector
# or three rows, where each column is a gradient vector
# There must be as many gradient vectors as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bveclist = ( /path/to/huey/year1/bvecs.txt \
                 /path/to/huey/year2/bvecs.txt \
                 /path/to/dewey/year1/bvecs.txt \
                 /path/to/dewey/year2/bvecs.txt \
                 /path/to/louie/year1/bvecs.txt \
                 /path/to/louie/year2/bvecs.txt )

# Diffusion b-value tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# There must be as many b-values as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvallist = ( /path/to/huey/year1/bvals.txt \
                 /path/to/huey/year2/bvals.txt \
                 /path/to/dewey/year1/bvals.txt \
                 /path/to/dewey/year2/bvals.txt \
                 /path/to/louie/year1/bvals.txt \
                 /path/to/louie/year2/bvals.txt )

# Perform correction for B0 inhomogeneity distortions?
# 0: No correction (default)
# 1: Perform correction based on a field map
#    Requires additional inputs (see below): b0mlist, b0plist, echospacing
# 2: Perform correction based on reverse-polarity images
#    Requires additional inputs (see below): echospacing, pedir, epifactor
#
set dob0 = 2

# Input B0 field map magnitude DICOMs (file names can be relative to dcmroot)
# Only used if dob0 = 1
# Default: None
#
set b0mlist = ( huey/year1/fmag/XXX-1.dcm \
                huey/year2/fmag/XXX-1.dcm \
                dewey/year1/fmag/XXX-1.dcm \
                dewey/year2/fmag/XXX-1.dcm \
                louie/year1/fmag/XXX-1.dcm \
                louie/year2/fmag/XXX-1.dcm )

# Input B0 field map phase DICOMs (file names can be relative to dcmroot)
# Only used if dob0 = 1
# Default: None
#
set b0plist = ( huey/year1/fphas/XXX-1.dcm \
                huey/year2/fphas/XXX-1.dcm \
                dewey/year1/fphas/XXX-1.dcm \
                dewey/year2/fphas/XXX-1.dcm \
                louie/year1/fphas/XXX-1.dcm \
                louie/year2/fphas/XXX-1.dcm )

# Echo spacing (this is found in the scanner protocol printout)
# Only used if dob0 = 1 or 2
# Default: None
#
set echospacing = 0.7

# Perform correction for eddy-current distortions?
# 0: No correction
# 1: Perform registration-based correction with eddy_correct
# 2: Perform model-based correction with eddy (default)
#
set doeddy = 2

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1 or 2
# Default: 1 (yes)
#
set dorotbvecs = 1

# Intra-subject (diffusion-to-T1) registration method
# 1: Affine with a correlation ratio cost
# 2: Affine with a mutual information cost
# 3: Affine with a boundary-based cost (default)
#
set intrareg = 3

# Degrees of freedom for intra-subject registration
# Can be 6 (rigid), 9 (rigid+scaling), or 12 (full affine)
# Default: 6 for infants, 9 otherwise
#
set intradof = 6

# Maximum rotation angle (degrees) for intra-subject registration
# Default: 3 for infants, 90 otherwise
#
set intrarot = 90

# Inter-subject registration method
# 1: Affine T1-to-T1 with a correlation ratio cost
# 2: Affine T1-to-T1 with a mutual information cost
# 3: Affine T1-to-T1 with a robust cost (default for infants)
# 4: Nonlinear T1-to-T1 with CVS
# 5: Nonlinear FA-to-FA with SyN (default)
#
set interreg = 5

# Target brain for inter-subject registration
# Default for affine T1-to-T1: 
#   $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
# Default for nonlinear T1-to-T1: 
#   $FREESURFER_HOME/subjects/cvs_avg35/
# Default for nonlinear FA-to-FA: 
#   $FREESURFER_HOME/trctrain/hcp/MGH35_HCP_FA_template.nii.gz
#
set intertrg = /path/to/a/duck/template.nii.gz

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
# Default: 1 (yes)
#
set usemaskanat = 1

# Fractional intensity threshold for BET mask extraction from low-b images
# This mask is used only if usemaskanat = 0
# Default: 0.3
#
set thrbet = 0.5

# Paths to reconstruct
# Default: All paths in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set pathlist = ( lh.uf rh.uf cc.rostrum )

# Number of path control points
# It can be a single number for all paths or a different number for each of the
# paths specified in pathlist (recommended, with more points for longer paths)
# Default: As in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set ncpts = ( 7 7 5 )

# List of training subjects
# This text file lists the locations of training subject directories
# Default: $FREESURFER_HOME/trctrain/trainlist.txt
#
set trainfile = $FREESURFER_HOME/trctrain/trainlist.txt

# Number of "sticks" (anisotropic diffusion compartments) in the bedpostx
# ball-and-stick model
# Default: 2
#
set nstick = 2

# Number of MCMC burn-in iterations
# (Path samples drawn initially by MCMC algorithm and discarded)
# Default: 200
#
set nburnin = 200

# Number of MCMC iterations
# (Path samples drawn by MCMC algorithm and used to estimate path distribution)
# Default: 7500
#
set nsample = 7500

# Frequency with which MCMC path samples are retained for path distribution
# Default: 5 (keep every 5th sample)
#
set nkeep = 5

# Reinitialize path reconstruction?
# This is an option of last resort, to be used only if one of the reconstructed
# pathway distributions looks like a single curve. This is a sign that the
# initial guess for the pathway was problematic, perhaps due to poor alignment
# between the individual and the atlas. Setting the reinit parameter to 1 and
# rerunning "trac-all -prior" and "trac-all -path", only for the specific
# subjects and pathways that had this problem, will attempt to reconstruct them
# with a different initial guess.
# Default: 0 (do not reinitialize)
#
set reinit = 0

Example 3: Cross-sectional study, multiple diffusion scans per session

This example sets up a TRACULA analysis for a cross-sectional study where there are multiple diffusion scans per subject. The different diffusion scans in a session may be acquired with different gradient direction sets or be repetitions of the same direction set; they may be acquired with reverse phase-encode directions (in which case they can be used for B0 distortion correction) or with the same phase-encode direction (in which case they can still be combined, but cannot be used for distortion correction). A copy of this file is available in the FreeSurfer distribution as:

$FREESURFER_HOME/bin/dmrirc.multiscan.example

The comments over each parameter explain the default settings. Remove a parameter from the dmrirc file if you want use its default value. Parameters that don't have default values must be specified.

Any other commands that you might want to run before an analysis could also be added to this file.

# FreeSurfer SUBJECTS_DIR
# T1 images and FreeSurfer segmentations are expected to be found here
# 
setenv SUBJECTS_DIR /path/to/recons/of/ducks

# Output directory where trac-all results will be saved
# Default: Same as SUBJECTS_DIR
#
set dtroot = /path/to/tracts/of/ducks

# Subject IDs
# Here each subject is listed twice because it has two diffusion scans
#
set subjlist = ( huey huey dewey dewey louie louie )

# In case you want to analyze only Huey and Louie
# Default: Run analysis on all subjects
#
set runlist = (1 2 5 6)

# Input diffusion DICOMs (file names relative to dcmroot)
# If original DICOMs don't exist, these can be in other image format
# but then the gradient table and b-value table must be specified (see below)
#
set dcmroot = /path/to/dicoms/of/ducks
set dcmlist = ( huey/run4/XXX-1.dcm \
                huey/run8/XXX-1.dcm \
                dewey/run5/XXX-1.dcm \
                dewey/run9/XXX-1.dcm \
                louie/run4/XXX-1.dcm \
                louie/run8/XXX-1.dcm )

# Diffusion gradient tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# The tables must have either three columns, where each row is a gradient vector
# or three rows, where each column is a gradient vector
# There must be as many gradient vectors as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bveclist = ( /path/to/huey/run4/bvecs.txt \
                 /path/to/huey/run8/bvecs.txt \
                 /path/to/dewey/run5/bvecs.txt \
                 /path/to/dewey/run9/bvecs.txt \
                 /path/to/louie/run4/bvecs.txt \
                 /path/to/louie/run8/bvecs.txt )

# Diffusion b-value tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# There must be as many b-values as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvallist = ( /path/to/huey/run4/bvals.txt \
                 /path/to/huey/run8/bvals.txt \
                 /path/to/dewey/run5/bvals.txt \
                 /path/to/dewey/run9/bvals.txt \
                 /path/to/louie/run4/bvals.txt \
                 /path/to/louie/run8/bvals.txt )

# Perform correction for B0 inhomogeneity distortions?
# 0: No correction (default)
# 1: Perform correction based on a field map
#    Requires additional inputs (see below): b0mlist, b0plist, echospacing
# 2: Perform correction based on reverse-polarity images
#    Requires additional inputs (see below): echospacing, pedir, epifactor
#
set dob0 = 2

# Echo spacing (this is found in the scanner protocol printout)
# Only used if dob0 = 1 or 2
# Default: None
#
set echospacing = 0.35

# Phase-encode direction (this is found in the scanner protocol printout)
# One for each diffusion scan above (must differ between runs in a session)
# In this example, each session contains an AP- and a PA-encoded diffusion scan
# Only used if dob0 = 2
# Default: None
#
set pedir = ( AP PA AP PA AP PA )

# EPI factor (this is found in the scanner protocol printout)
# Only used if dob0 = 2
# Default: None
#
set epifactor = 140

# Perform correction for eddy-current distortions?
# 0: No correction
# 1: Perform registration-based correction with eddy_correct
# 2: Perform model-based correction with eddy (default)
#
set doeddy = 2

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1 or 2
# Default: 1 (yes)
#
set dorotbvecs = 1

# Intra-subject (diffusion-to-T1) registration method
# 1: Affine with a correlation ratio cost
# 2: Affine with a mutual information cost
# 3: Affine with a boundary-based cost (default)
#
set intrareg = 3

# Degrees of freedom for intra-subject registration
# Can be 6 (rigid), 9 (rigid+scaling), or 12 (full affine)
# Default: 6 for infants, 9 otherwise
#
set intradof = 6

# Maximum rotation angle (degrees) for intra-subject registration
# Default: 3 for infants, 90 otherwise
#
set intrarot = 90

# Inter-subject registration method
# 1: Affine T1-to-T1 with a correlation ratio cost
# 2: Affine T1-to-T1 with a mutual information cost
# 3: Affine T1-to-T1 with a robust cost (default for infants)
# 4: Nonlinear T1-to-T1 with CVS
# 5: Nonlinear FA-to-FA with SyN (default)
#
set interreg = 5

# Target brain for inter-subject registration
# Default for affine T1-to-T1: 
#   $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
# Default for nonlinear T1-to-T1: 
#   $FREESURFER_HOME/subjects/cvs_avg35/
# Default for nonlinear FA-to-FA: 
#   $FREESURFER_HOME/trctrain/hcp/MGH35_HCP_FA_template.nii.gz
#
set intertrg = /path/to/a/duck/template.nii.gz

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
# Default: 1 (yes)
#
set usemaskanat = 1

# Fractional intensity threshold for BET mask extraction from low-b images
# This mask is used only if usemaskanat = 0
# Default: 0.3
#
set thrbet = 0.5

# Paths to reconstruct
# Default: All paths in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set pathlist = ( lh.uf rh.uf cc.rostrum )

# Number of path control points
# It can be a single number for all paths or a different number for each of the
# paths specified in pathlist (recommended, with more points for longer paths)
# Default: As in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set ncpts = ( 7 7 5 )

# List of training subjects
# This text file lists the locations of training subject directories
# Default: $FREESURFER_HOME/trctrain/trainlist.txt
#
set trainfile = $FREESURFER_HOME/trctrain/trainlist.txt

# Number of "sticks" (anisotropic diffusion compartments) in the bedpostx
# ball-and-stick model
# Default: 2
#
set nstick = 2

# Number of MCMC burn-in iterations
# (Path samples drawn initially by MCMC algorithm and discarded)
# Default: 200
#
set nburnin = 200

# Number of MCMC iterations
# (Path samples drawn by MCMC algorithm and used to estimate path distribution)
# Default: 7500
#
set nsample = 7500

# Frequency with which MCMC path samples are retained for path distribution
# Default: 5 (keep every 5th sample)
#
set nkeep = 5

# Reinitialize path reconstruction?
# This is an option of last resort, to be used only if one of the reconstructed
# pathway distributions looks like a single curve. This is a sign that the
# initial guess for the pathway was problematic, perhaps due to poor alignment
# between the individual and the atlas. Setting the reinit parameter to 1 and
# rerunning "trac-all -prior" and "trac-all -path", only for the specific
# subjects and pathways that had this problem, will attempt to reconstruct them
# with a different initial guess.
# Default: 0 (do not reinitialize)
#
set reinit = 0

Example 4: Longitudinal study, multiple diffusion scans per session

This example sets up a TRACULA analysis for a longitudinal study where there are multiple diffusion scans per visit. The different diffusion scans in a session may be acquired with different gradient direction sets or be repetitions of the same direction set; they may be acquired with reverse phase-encode directions (in which case they can be used for B0 distortion correction) or with the same phase-encode direction (in which case they can still be combined, but cannot be used for distortion correction). A copy of this file is available in the FreeSurfer distribution as:

$FREESURFER_HOME/bin/dmrirc.long.multiscan.example

The comments over each parameter explain the default settings. Remove a parameter from the dmrirc file if you want use its default value. Parameters that don't have default values must be specified.

Any other commands that you might want to run before an analysis could also be added to this file.

# FreeSurfer SUBJECTS_DIR
# T1 images and FreeSurfer segmentations are expected to be found here
# 
setenv SUBJECTS_DIR /path/to/recons/of/ducks

# Output directory where trac-all results will be saved
# Default: Same as SUBJECTS_DIR
#
set dtroot = /path/to/tracts/of/ducks

# Subject IDs (one per scan per time point per subject)
# In this example, each time point of each subject is listed twice because
# there are two diffusion scans from each time point
#
set subjlist = ( huey-visit1 \
                 huey-visit1 \
                 huey-visit2 \
                 huey-visit2 \
                 dewey-visit1 \
                 dewey-visit1 \
                 dewey-visit2 \
                 dewey-visit2 \
                 louie-visit1 \
                 louie-visit1 \
                 louie-visit2 \
                 louie-visit2 )

# Longitudinal base template subject IDs (one for each scan above)
#
set baselist = ( huey \
                 huey \
                 huey \
                 huey \
                 dewey \
                 dewey \
                 dewey \
                 dewey \
                 louie \
                 louie \
                 louie \
                 louie )

# In case you want to analyze only Huey and Louie
# Default: Run analysis on all time points and subjects
#
set runlist = (1 2 3 4 9 10 11 12)

# Input diffusion DICOMs (file names relative to dcmroot)
# If original DICOMs don't exist, these can be in other image format
# but then the gradient table and b-value table must be specified (see below)
#
set dcmroot = /path/to/dicoms/of/ducks
set dcmlist = ( huey/year1/run4/XXX-1.dcm \
                huey/year1/run8/XXX-1.dcm \
                huey/year2/run4/XXX-1.dcm \
                huey/year2/run8/XXX-1.dcm \
                dewey/year1/run5/XXX-1.dcm \
                dewey/year1/run9/XXX-1.dcm \
                dewey/year2/run5/XXX-1.dcm \
                dewey/year2/run9/XXX-1.dcm \
                louie/year1/run4/XXX-1.dcm \
                louie/year1/run8/XXX-1.dcm \
                louie/year2/run4/XXX-1.dcm \
                louie/year2/run8/XXX-1.dcm )

# Diffusion gradient tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# The tables must have either three columns, where each row is a gradient vector
# or three rows, where each column is a gradient vector
# There must be as many gradient vectors as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bveclist = ( /path/to/huey/year1/run4/bvecs.txt \
                 /path/to/huey/year1/run8/bvecs.txt \
                 /path/to/huey/year2/run4/bvecs.txt \
                 /path/to/huey/year2/run8/bvecs.txt \
                 /path/to/dewey/year1/run5/bvecs.txt \
                 /path/to/dewey/year1/run9/bvecs.txt \
                 /path/to/dewey/year2/run5/bvecs.txt \
                 /path/to/dewey/year2/run9/bvecs.txt \
                 /path/to/louie/year1/run4/bvecs.txt \
                 /path/to/louie/year1/run8/bvecs.txt \
                 /path/to/louie/year2/run4/bvecs.txt \
                 /path/to/louie/year2/run8/bvecs.txt )

# Diffusion b-value tables (file names can be relative to dcmroot)
# Must be specified only if they cannot be read from the DICOM headers
# There must be as many b-values as volumes in the diffusion data set
# Default: Read from DICOM header
#
set bvallist = ( /path/to/huey/year1/run4/bvals.txt \
                 /path/to/huey/year1/run8/bvals.txt \
                 /path/to/huey/year2/run4/bvals.txt \
                 /path/to/huey/year2/run8/bvals.txt \
                 /path/to/dewey/year1/run5/bvals.txt \
                 /path/to/dewey/year1/run9/bvals.txt \
                 /path/to/dewey/year2/run5/bvals.txt \
                 /path/to/dewey/year2/run9/bvals.txt \
                 /path/to/louie/year1/run4/bvals.txt \
                 /path/to/louie/year1/run8/bvals.txt \
                 /path/to/louie/year2/run4/bvals.txt \
                 /path/to/louie/year2/run8/bvals.txt )

# Perform correction for B0 inhomogeneity distortions?
# 0: No correction (default)
# 1: Perform correction based on a field map
#    Requires additional inputs (see below): b0mlist, b0plist, echospacing
# 2: Perform correction based on reverse-polarity images
#    Requires additional inputs (see below): echospacing, pedir, epifactor
#
set dob0 = 2

# Echo spacing (this is found in the scanner protocol printout)
# Only used if dob0 = 1 or 2
# Default: None
#
set echospacing = 0.35

# Phase-encode direction (this is found in the scanner protocol printout)
# One for each diffusion scan above (must differ between runs in a session)
# In this example, each session contains an AP- and a PA-encoded diffusion scan
# Only used if dob0 = 2
# Default: None
#
set pedir = ( AP PA AP PA AP PA AP PA AP PA AP PA )

# EPI factor (this is found in the scanner protocol printout)
# Only used if dob0 = 2
# Default: None
#
set epifactor = 140

# Perform correction for eddy-current distortions?
# 0: No correction
# 1: Perform registration-based correction with eddy_correct
# 2: Perform model-based correction with eddy (default)
#
set doeddy = 2

# Rotate diffusion gradient vectors to match eddy-current compensation?
# Only used if doeddy = 1 or 2
# Default: 1 (yes)
#
set dorotbvecs = 1

# Intra-subject (diffusion-to-T1) registration method
# 1: Affine with a correlation ratio cost
# 2: Affine with a mutual information cost
# 3: Affine with a boundary-based cost (default)
#
set intrareg = 3

# Degrees of freedom for intra-subject registration
# Can be 6 (rigid), 9 (rigid+scaling), or 12 (full affine)
# Default: 6 for infants, 9 otherwise
#
set intradof = 6

# Maximum rotation angle (degrees) for intra-subject registration
# Default: 3 for infants, 90 otherwise
#
set intrarot = 90

# Inter-subject registration method
# 1: Affine T1-to-T1 with a correlation ratio cost
# 2: Affine T1-to-T1 with a mutual information cost
# 3: Affine T1-to-T1 with a robust cost (default for infants)
# 4: Nonlinear T1-to-T1 with CVS
# 5: Nonlinear FA-to-FA with SyN (default)
#
set interreg = 5

# Target brain for inter-subject registration
# Default for affine T1-to-T1: 
#   $FSLDIR/data/standard/MNI152_T1_1mm_brain.nii.gz
# Default for nonlinear T1-to-T1: 
#   $FREESURFER_HOME/subjects/cvs_avg35/
# Default for nonlinear FA-to-FA: 
#   $FREESURFER_HOME/trctrain/hcp/MGH35_HCP_FA_template.nii.gz
#
set intertrg = /path/to/a/duck/template.nii.gz

# Use brain mask extracted from T1 image instead of low-b diffusion image?
# Has no effect if there is no T1 data
# Default: 1 (yes)
#
set usemaskanat = 1

# Fractional intensity threshold for BET mask extraction from low-b images
# This mask is used only if usemaskanat = 0
# Default: 0.3
#
set thrbet = 0.5

# Paths to reconstruct
# Default: All paths in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set pathlist = ( lh.uf rh.uf cc.rostrum )

# Number of path control points
# It can be a single number for all paths or a different number for each of the
# paths specified in pathlist (recommended, with more points for longer paths)
# Default: As in $FREESURFER_HOME/trctrain/hcp/pathlist.txt
#
set ncpts = ( 7 7 5 )

# List of training subjects
# This text file lists the locations of training subject directories
# Default: $FREESURFER_HOME/trctrain/trainlist.txt
#
set trainfile = $FREESURFER_HOME/trctrain/trainlist.txt

# Number of "sticks" (anisotropic diffusion compartments) in the bedpostx
# ball-and-stick model
# Default: 2
#
set nstick = 2

# Number of MCMC burn-in iterations
# (Path samples drawn initially by MCMC algorithm and discarded)
# Default: 200
#
set nburnin = 200

# Number of MCMC iterations
# (Path samples drawn by MCMC algorithm and used to estimate path distribution)
# Default: 7500
#
set nsample = 7500

# Frequency with which MCMC path samples are retained for path distribution
# Default: 5 (keep every 5th sample)
#
set nkeep = 5

# Reinitialize path reconstruction?
# This is an option of last resort, to be used only if one of the reconstructed
# pathway distributions looks like a single curve. This is a sign that the
# initial guess for the pathway was problematic, perhaps due to poor alignment
# between the individual and the atlas. Setting the reinit parameter to 1 and
# rerunning "trac-all -prior" and "trac-all -path", only for the specific
# subjects and pathways that had this problem, will attempt to reconstruct them
# with a different initial guess.
# Default: 0 (do not reinitialize)
#
set reinit = 0

Tutorial

More information on setting up the dmrirc file can be found in the TRACULA tutorial.

dmrirc (last edited 2021-11-20 13:45:05 by AnastasiaYendiki)