dipy logo

Site Navigation

NIPY Community

dipy.reconst.odf

class dipy.reconst.odf.OdfModel

An abstract class to be sub-classed by specific odf models

All odf models should provide a fit method which may take data as it’s first and only argument.

Methods

fit(data) To be implemented by specific odf models
fit(data)

To be implemented by specific odf models

dipy.reconst.odf.gfa(samples)

The general fractional anisotropy of a function evaluated on the unit sphere

dipy.reconst.odf.peak_directions(odf, sphere, relative_peak_threshold=0.25, min_separation_angle=45)

Get the directions of odf peaks

Parameters :

odf : 1d ndarray

The odf function evaluated on the vertices of sphere

sphere : Sphere

The Sphere providing discrete directions for evaluation.

relative_peak_threshold : float

Only return peaks greater than relative_peak_threshold * m where m is the largest peak.

min_separation_angle : float in [0, 90] The minimum distance between

directions. If two peaks are too close only the larger of the two is returned.

Returns :

directions : (N, 3) ndarray

N vertices for sphere, one for each peak

values : (N,) ndarray

peak values

indices : (N,) ndarray

peak indices of the directions on the sphere

dipy.reconst.odf.peak_directions_nl(sphere_eval, relative_peak_threshold=0.25, min_separation_angle=45, sphere=<dipy.core.sphere.HemiSphere object at 0x5a21b10>, xtol=1e-07)

Non Linear Direction Finder

Parameters :

sphere_eval : callable

A function which can be evaluated on a sphere.

relative_peak_threshold : float

Only return peaks greater than relative_peak_threshold * m where m is the largest peak.

min_separation_angle : float in [0, 90]

The minimum distance between directions. If two peaks are too close only the larger of the two is returned.

sphere : Sphere

A discrete Sphere. The points on the sphere will be used for initial estimate of maximums.

xtol : float

Relative tolerance for optimization.

Returns :

directions : array (N, 3)

Points on the sphere corresponding to N local maxima on the sphere.

values : array (N,)

Value of sphere_eval at each point on directions.

dipy.reconst.odf.peaks_from_model(model, data, sphere, relative_peak_threshold, min_separation_angle, mask=None, return_odf=False, gfa_thr=0.02, normalize_peaks=False)

Fits the model to data and computes peaks and metrics

Parameters :

model : a model instance

model will be used to fit the data.

sphere : Sphere

The Sphere providing discrete directions for evaluation.

relative_peak_threshold : float

Only return peaks greater than relative_peak_threshold * m where m is the largest peak.

min_separation_angle : float in [0, 90] The minimum distance between

directions. If two peaks are too close only the larger of the two is returned.

mask : array, optional

If mask is provided, voxels that are False in mask are skipped and no peaks are returned.

return_odf : bool

If True, the odfs are returned.

gfa_thr : float

Voxels with gfa less than gfa_thr are skipped, no peaks are returned.

normalize_peaks : bool

If true, all peak values are calculated relative to max(odf).