dipy logo

Site Navigation

NIPY Community

Previous topic

dipy.tracking.learning

dipy.tracking.markov

Implemention of various Tractography methods

these tools are meant to be paired with diffusion reconstruction methods from dipy.reconst

This module uses the trackvis coordinate system, for more information about this coordinate system please see dipy.tracking.utils The following modules also use this coordinate system: dipy.tracking.utils dipy.tracking.integration dipy.reconst.interpolate

class dipy.tracking.markov.BoundaryStepper(voxel_size=(1, 1, 1), overstep=0.10000000000000001)

Steps along a direction past the closest voxel boundary

Parameters :

voxel_size : array-like

Size of voxels in data volume

overstep : float

A small number used to prevent the track from getting stuck at the edge of a voxel.

Methods

__call__
class dipy.tracking.markov.CDT_NNO(model, interpolator, mask, take_step, angle_limit, seeds, max_cross=None, maxlen=500, mask_voxel_size=None)

ClosestDirectionTracker optimized for NearestNeighbor interpolator

For use with Nearest Neighbor interpolation, directions at each voxel are remembered to avoid recalculating.

Parameters :

model : model

A model used to fit data. Should return a some fit object with directions.

interpolator : interpolator

A NearestNeighbor interpolator, for other interpolators do not use this class.

angle_limit : float [0, 90]

Maximum angle allowed between prev_step and next_step.

Methods

reset_cache
reset_cache()

Clear saved directions

class dipy.tracking.markov.FixedSizeStepper(step_size=0.5)

A stepper that uses a fixed step size

Methods

__call__
class dipy.tracking.markov.MarkovIntegrator(model, interpolator, mask, take_step, angle_limit, seeds, max_cross=None, maxlen=500, mask_voxel_size=None)

An abstract class for fiber-tracking

class dipy.tracking.markov.ProbabilisticOdfWeightedTracker(model, interpolator, mask, take_step, angle_limit, seeds, sphere, max_cross=None, maxlen=500, mask_voxel_size=None)

A stochastic (probabilistic) fiber tracking method

Stochastically tracks streamlines by randomly choosing directions from sphere. The likelihood of a direction being chosen is taken from model.fit(data).odf(sphere). Negative values are set to 0. If no directions less than angle_limit degrees are from the incoming direction have a positive likelihood, the streamline is terminated.

Parameters :

model : model

The model used to fit diffusion data.

interpolator : interpolator

Diffusion weighted data wrapped in an interpolator. Data should be normalized.

mask : array, 3D

Used to confine tracking, streamlines end when they leave the mask.

take_step : callable

Determines the length of each step.

angle_limit : float [0, 90]

The angle between successive steps in the streamlines cannot be more than angle_limit degrees.

seeds : array (N, 3)

Points to seed the tracking.

sphere : Sphere

sphere used to evaluate the likelihood. A Sphere or a HemiSphere can be used here. A HemiSphere is more efficient.

max_cross : int or None

Max number of directions to follow at each seed. By default follow all peaks of the odf.

maxlen : int

Maximum number of segments to follow from seed. Used to prevent infinite loops.

mask_voxel_size : array (3,)

Voxel size for the mask. mask should cover the same FOV as data, but it can have a different voxel size. Same as the data by default.

dipy.tracking.markov.markov_streamline(get_direction, take_step, seed, first_step, maxlen)

Creates a streamline from seed

Parameters :

get_direction : callable

This function should return a direction for the streamline given a location and the previous direction.

take_step : callable

Take step should take a step from a location given a direction.

seed : array (3,)

The seed point of the streamline

first_step : array (3,)

A unit vector giving the direction of the first step

maxlen : int

The maximum number of segments allowed in the streamline. This is good for preventing infinite loops.

Returns :

streamline : array (N, 3)

A streamline.