scil_tracking_local.py

usage: __main__.py [-h] [--step STEP_SIZE] [--min_length m] [--max_length M]
                   [--theta THETA] [--sfthres sf_th]
                   [--sh_basis {descoteaux07,tournier07,descoteaux07_legacy,tournier07_legacy}]
                   [--npv NPV | --nt NT] [--sh_to_pmf]
                   [--algo {det,prob,ptt,eudx}]
                   [--sphere {repulsion100,repulsion200,repulsion724,symmetric362,symmetric642,symmetric724}]
                   [--sub_sphere SUB_SPHERE] [--probe_length PROBE_LENGTH]
                   [--probe_radius PROBE_RADIUS]
                   [--probe_quality PROBE_QUALITY] [--probe_count PROBE_COUNT]
                   [--support_exponent SUPPORT_EXPONENT] [--use_gpu]
                   [--sh_interp {trilinear,nearest}] [--forward_only]
                   [--batch_size BATCH_SIZE] [--compress [COMPRESS_TH]] [-f]
                   [--save_seeds] [--seed SEED] [-v [{DEBUG,INFO,WARNING}]]
                   in_odf in_seed in_mask out_tractogram

Local streamline HARDI tractography.
The tracking direction is chosen in the aperture cone defined by the
previous tracking direction and the angular constraint.

WARNING: This script DOES NOT support asymetric FODF input (aFODF).

Algo 'eudx': select the peak from the spherical function (SF) most closely
aligned to the previous direction, and follow an average of it and the previous
direction [1].

Algo 'det': select the orientation corresponding to the maximum of the
spherical function.

Algo 'prob': select a direction drawn from the empirical distribution function
defined from the SF.

Algo 'ptt': select the propagation direction using Parallel-Transport
Tractography (PTT) framework, see [2] for more details.

NOTE: eudx can be used with pre-computed peaks from fodf as well as
evecs_v1.nii.gz from scil_dti_metrics.py (experimental).

NOTE: If tracking with PTT, the step-size should be smaller than usual,
i.e 0.1-0.2mm or lower. The maximum angle between segments (theta) should
be between 10 and 20 degrees.

The local tracking algorithm can also run on the GPU using the --use_gpu
option (experimental). By default, GPU tracking behaves the same as
DIPY. Below is a list of known divergences between the CPU and GPU
implementations:
    * Backend: The CPU implementation uses DIPY's LocalTracking and the
        GPU implementation uses an in-house OpenCL implementation.
    * Algo: For the GPU implementation, the only available algorithm is
        Algo 'prob'.
    * SH interpolation: For GPU tracking, SH interpolation can be set to either
        nearest neighbour or trilinear (default). With DIPY, the only available
        method is trilinear.
    * Forward tracking: For GPU tracking, the `--forward_only` flag can be used
        to disable backward tracking. This option isn't available for CPU
        tracking.

All the input nifti files must be in isotropic resolution.

References
----------
[1]: Garyfallidis, E. (2012). Towards an accurate brain tractography
[PhD thesis]. University of Cambridge. United Kingdom.

[2]: Aydogan, D. B., & Shi, Y. (2020). Parallel transport tractography.
IEEE transactions on medical imaging, 40(2), 635-647.

Formerly: scil_compute_local_tracking.py

positional arguments:
  in_odf                File containing the orientation diffusion function
                        as spherical harmonics file (.nii.gz). Ex: ODF or fODF.
  in_seed               Seeding mask (.nii.gz).
  in_mask               Tracking mask (.nii.gz).
                        Tracking will stop outside this mask. The last point of each
                        streamline (triggering the stopping criteria) IS added to the streamline.
  out_tractogram        Tractogram output file (must be .trk or .tck).

options:
  -h, --help            show this help message and exit

Tracking options:
  --step STEP_SIZE      Step size in mm. [0.5]
  --min_length m        Minimum length of a streamline in mm. [10.0]
  --max_length M        Maximum length of a streamline in mm. [300.0]
  --theta THETA         Maximum angle between 2 steps. If the angle is too big, streamline is
                        stopped and the following point is NOT included.
                        ["eudx"=60, "det"=45, "prob"=20, "ptt"=20]
  --sfthres sf_th       Spherical function relative threshold. [0.1]
  --sh_basis {descoteaux07,tournier07,descoteaux07_legacy,tournier07_legacy}
                        Spherical harmonics basis used for the SH coefficients.
                        Must be either descoteaux07', 'tournier07',
                        'descoteaux07_legacy' or 'tournier07_legacy' [['descoteaux07_legacy']]:
                            'descoteaux07'       : SH basis from the Descoteaux et al.
                                                   MRM 2007 paper
                            'tournier07'         : SH basis from the new Tournier et al.
                                                   NeuroImage 2019 paper, as in MRtrix 3.
                            'descoteaux07_legacy': SH basis from the legacy Dipy implementation
                                                   of the Descoteaux et al. MRM 2007 paper
                            'tournier07_legacy'  : SH basis from the legacy Tournier et al.
                                                   NeuroImage 2007 paper.
  --sh_to_pmf           If set, map sherical harmonics to spherical function (pmf) before
                        tracking (faster, requires more memory)
  --algo {det,prob,ptt,eudx}
                        Algorithm to use. [prob]
  --sphere {repulsion100,repulsion200,repulsion724,symmetric362,symmetric642,symmetric724}
                        Dipy sphere; set of possible directions.
                        Default: [repulsion724]
  --sub_sphere SUB_SPHERE
                        Subdivides each face of the sphere into 4^s new faces. [0]

Seeding options:
  When no option is provided, uses --npv 1.

  --npv NPV             Number of seeds per voxel.
  --nt NT               Total number of seeds to use.

PTT options:
  --probe_length PROBE_LENGTH
                        The length of the probes. Smaller value
                        yields more dispersed fibers. [1.0]
  --probe_radius PROBE_RADIUS
                        The radius of the probe. A large probe_radius
                        helps mitigate noise in the pmf but it might
                        make it harder to sample thin and intricate
                        connections, also the boundary of fiber
                        bundles might be eroded. [0]
  --probe_quality PROBE_QUALITY
                        The quality of the probe. This parameter sets
                        the number of segments to split the cylinder
                        along the length of the probe (minimum=2) [3]
  --probe_count PROBE_COUNT
                        The number of probes. This parameter sets the
                        number of parallel lines used to model the
                        cylinder (minimum=1). [1]
  --support_exponent SUPPORT_EXPONENT
                        Data support exponent, used for rejection
                        sampling. [3]

GPU options:
  --use_gpu             Enable GPU tracking (experimental).
  --sh_interp {trilinear,nearest}
                        SH image interpolation method. [trilinear]
  --forward_only        Perform forward tracking only.
  --batch_size BATCH_SIZE
                        Approximate size of GPU batches (number
                        of streamlines to track in parallel). [10000]

Output options:
  --compress [COMPRESS_TH]
                        If set, compress the resulting streamline. Value is the maximum
                        compression distance in mm.
                        A rule of thumb is to set it to 0.1mm for deterministic
                        streamlines and to 0.2mm for probabilitic streamlines.[0.1]
  -f                    Force overwriting of the output files.
  --save_seeds          If set, save the seeds used for the tracking
                         in the data_per_streamline property.
                        Hint: you can then use scilpy_compute_seed_density_map.
  --seed SEED           Random number generator seed.

Logging options:
  -v [{DEBUG,INFO,WARNING}]
                        Produces verbose output depending on the provided level.
                        Default level is warning, default when using -v is info.