:py:mod:`AFQ.tractography.tractography` ======================================= .. py:module:: AFQ.tractography.tractography Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: AFQ.tractography.tractography.track AFQ.tractography.tractography._tracking .. py:function:: 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) Tractography :Parameters: **params_file** : str, nibabel img. Full path to a nifti file containing CSD spherical harmonic coefficients, or nibabel img with model params. **directions** : str How tracking directions are determined. One of: {"det" | "prob"} Default: "prob" **max_angle** : float, optional. The maximum turning angle in each step. Default: 30 **sphere** : Sphere object, optional. The discretization of direction getting. default: dipy.data.default_sphere. **seed_mask** : array, optional. Float or binary mask describing the ROI within which we seed for tracking. Default to the entire volume (all ones). **seed_threshold** : float, optional. A value of the seed_mask above which tracking is seeded. Default to 0. **n_seeds** : int 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_seeds** : bool Whether to generate a total of n_seeds random seeds in the mask. Default: False. **rng_seed** : int random seed used to generate random seeds if random_seeds is set to True. Default: None **stop_mask** : array 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_threshold** : float 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 [R2bb8bf7259c4-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_percentages** : bool, 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_size** : float, 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_model** : str, optional One of {"DTI", "CSD", "DKI"}. Defaults to use "DTI" **tracker** : str, optional Which strategy to use in tracking. This can be the standard local tracking ("local") or Particle Filtering Tracking ([R2bb8bf7259c4-Girard2014]_). One of {"local", "pft"}. Default: "local" **trx** : bool, 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 () .. .. rubric:: References .. [R2bb8bf7259c4-Girard2014] Girard, G., Whittingstall, K., Deriche, R., & Descoteaux, M. Towards quantitative connectivity analysis: reducing tractography biases. NeuroImage, 98, 266-278, 2014. .. only:: latex [R2bb8bf7259c4-Girard2014]_ .. !! processed by numpydoc !! .. py:function:: _tracking(tracker, seeds, dg, stopping_criterion, params_img, step_size=0.5, minlen=40, maxlen=200, random_seed=None, trx=False) Helper function .. !! processed by numpydoc !!