AFQ.tractography.tractography#

Module Contents#

Functions#

track(params_file[, directions, max_angle, sphere, ...])

Tractography

_tracking(tracker, seeds, dg, stopping_criterion, ...)

Helper function

AFQ.tractography.tractography.track(params_file, directions='prob', max_angle=30.0, sphere=None, seed_mask=None, seed_threshold=0, thresholds_as_percentages=False, n_seeds=1, random_seeds=False, rng_seed=None, stop_mask=None, stop_threshold=0, step_size=0.5, minlen=50, maxlen=250, odf_model='CSD', tracker='local', trx=False)[source]#

Tractography

Parameters
params_filestr, nibabel img.

Full path to a nifti file containing CSD spherical harmonic coefficients, or nibabel img with model params.

directionsstr

How tracking directions are determined. One of: {“det” | “prob”} Default: “prob”

max_anglefloat, optional.

The maximum turning angle in each step. Default: 30

sphereSphere object, optional.

The discretization of direction getting. default: dipy.data.default_sphere.

seed_maskarray, optional.

Float or binary mask describing the ROI within which we seed for tracking. Default to the entire volume (all ones).

seed_thresholdfloat, optional.

A value of the seed_mask above which tracking is seeded. Default to 0.

n_seedsint or 2D array, optional.

The seeding density: if this is an int, it is is how many seeds in each voxel on each dimension (for example, 2 => [2, 2, 2]). If this is a 2D array, these are the coordinates of the seeds. Unless random_seeds is set to True, in which case this is the total number of random seeds to generate within the mask. Default: 1

random_seedsbool

Whether to generate a total of n_seeds random seeds in the mask. Default: False.

rng_seedint

random seed used to generate random seeds if random_seeds is set to True. Default: None

stop_maskarray or str, optional.

If array: A float or binary mask that determines a stopping criterion (e.g. FA). If tuple: it contains a sequence that is interpreted as: (pve_wm, pve_gm, pve_csf), each item of which is either a string (full path) or a nibabel img to be used in particle filtering tractography. A tuple is required if tracker is set to “pft”. Defaults to no stopping (all ones).

stop_thresholdfloat or tuple, optional.

If float, this a value of the stop_mask below which tracking is terminated (and stop_mask has to be an array). If str, “CMC” for Continuous Map Criterion [Girard2014].

“ACT” for Anatomically-constrained tractography [Smith2012].

A string is required if the tracker is set to “pft”. Defaults to 0 (this means that if no stop_mask is passed, we will stop only at the edge of the image).

thresholds_as_percentagesbool, optional

Interpret seed_threshold and stop_threshold as percentages of the total non-nan voxels in the seed and stop mask to include (between 0 and 100), instead of as a threshold on the values themselves. Default: False

step_sizefloat, optional.

The size of a step (in mm) of tractography. Default: 0.5

minlen: int, optional

The miminal length (mm) in a streamline. Default: 20

maxlen: int, optional

The miminal length (mm) in a streamline. Default: 250

odf_modelstr, optional

One of {“DTI”, “CSD”, “DKI”}. Defaults to use “DTI”

trackerstr, optional

Which strategy to use in tracking. This can be the standard local tracking (“local”) or Particle Filtering Tracking ([Girard2014]). One of {“local”, “pft”}. Default: “local”

trxbool, optional

Whether to return the streamlines compatible with input to TRX file (i.e., as a LazyTractogram class instance). Default: False

Returns
list of streamlines ()

References

Girard2014(1,2)

Girard, G., Whittingstall, K., Deriche, R., & Descoteaux, M. Towards quantitative connectivity analysis: reducing tractography biases. NeuroImage, 98, 266-278, 2014.

AFQ.tractography.tractography._tracking(tracker, seeds, dg, stopping_criterion, params_img, step_size=0.5, minlen=40, maxlen=200, random_seed=None, trx=False)[source]#

Helper function