Skip to content

Run mrTrix from the command line

Rosemary Le edited this page Jun 30, 2016 · 7 revisions

The documentation for mrTrix tractography is here: version 2, version 3.

These notes here refer to version 2. Details for version 3 may be slightly different, those notes will follow.

The mrtrix streamtrack function is used perform tractography.

syntax: streamtrack [ options ] type source tracks

Necessary arguments

  • type The type of streamline tracking to be performed. mrTrix provides three different tractography algorithms (DT_STREAM, SD_STREAM, and SD_PROB). DT stands for diffusion tensor, SD stands for spherical deconvolution, STREAM means the algorithm is deterministic, PROB means the algorithm is probabilistic.
  • source The image containing the source data. The type of data required depends on the type of tracking as set in the preceeding argument. For DT methods, the base DWI are needed. For SD methods, the SH harmonic coefficients of the FOD are needed.
  • tracks The output file containing the tracks generated.

Additional parameters

  • -seed and -mask. Identify the seed voxels and the white-matter mask, respectively. For running whole-brain tractography, we typically use white-matter regions defined by the Freesurfer segmentation procedure as both the seed and the mask. The white matter mask can be defined in a nifti (.nii.gz) in a binary format (1: white matter: 0, other). To convert from nifti into .mif (the format the mrtrix uses), we can use the command (mrconvert or mrtrix_mrconvert in MATLAB).

  • -curvature Define the minimum radius of curvature in tractography. Depending on the step size, this will also constrain the angle of the tract.

  • -num The desired number of streamlines produced by tractography.

Here is an example:

streamtrack SD_PROB dwi_csd.mif -mask t1_class.mif -seed t1_class.mif -curvature 1 S1_SDPROB_500000.tck -num 500000

This call uses a CSD file as an input for CSD probabilistic tractography, uses a white-matter mask as both the seed and the mask, specifies S1_SDPROB_500000.tck as the output file and will produce 500000 fibers.

Clone this wiki locally