eddymotion.model.dmri module

class eddymotion.model.dmri.AverageDWModel(**kwargs)[source]

Bases: BaseDWIModel

A trivial model that returns an average map.

fit(data, **kwargs)[source]

Calculate the average.

predict(*_, **kwargs)[source]

Return the average map.

class eddymotion.model.dmri.BaseDWIModel(gtab, S0=None, b_max=None, **kwargs)[source]

Bases: BaseModel

Interface and default methods for DWI models.

fit(data, n_jobs=None, **kwargs)[source]

Fit the model chunk-by-chunk asynchronously

predict(gradient=None, **kwargs)[source]

Predict asynchronously chunk-by-chunk the diffusion signal.

eddymotion.model.dmri.DEFAULT_CLIP_PERCENTILE = 75

Upper percentile threshold for intensity clipping.

eddymotion.model.dmri.DEFAULT_HIGHB_THRESHOLD = 10000

A b-value cap for DWI data.

eddymotion.model.dmri.DEFAULT_LOWB_THRESHOLD = 50

The lower bound for the b-value so that the orientation is considered a DW volume.

eddymotion.model.dmri.DEFAULT_MAX_BVAL = 8000

Maximum b-value cap.

eddymotion.model.dmri.DEFAULT_MAX_BVALUE = 1000

Maximum allowed value for the b-value.

eddymotion.model.dmri.DEFAULT_MAX_S0 = 1.0

Maximum value when considering the \(S_{0}\) DWI signal.

eddymotion.model.dmri.DEFAULT_MIN_S0 = 1e-05

Minimum value when considering the \(S_{0}\) DWI signal.

eddymotion.model.dmri.DEFAULT_MULTISHELL_BIN_COUNT_THR = 7

Default bin count to consider a multishell scheme.

eddymotion.model.dmri.DEFAULT_NUM_BINS = 15

Number of bins to classify b-values.

class eddymotion.model.dmri.DKIModel(gtab, S0=None, b_max=None, **kwargs)[source]

Bases: BaseDWIModel

A wrapper of dipy.reconst.dki.DiffusionKurtosisModel.

class eddymotion.model.dmri.DTIModel(gtab, S0=None, b_max=None, **kwargs)[source]

Bases: BaseDWIModel

A wrapper of dipy.reconst.dti.TensorModel.

class eddymotion.model.dmri.GPModel(gtab, S0=None, b_max=None, **kwargs)[source]

Bases: BaseDWIModel

A wrapper of GaussianProcessModel.

eddymotion.model.dmri.find_shelling_scheme(bvals, num_bins=15, multishell_nonempty_bin_count_thr=7, bval_cap=8000)[source]

Find the shelling scheme on the given b-values.

Computes the histogram of the b-values according to num_bins and depending on the nonempty bin count, classify the shelling scheme as single-shell if they are 2 (low-b and a shell); multi-shell if they are below the multishell_nonempty_bin_count_thr value; and DSI otherwise.

Parameters:
  • bvals (list or ndarray) – List or array of b-values.

  • num_bins (int, optional) – Number of bins.

  • multishell_nonempty_bin_count_thr (int, optional) – Bin count to consider a multi-shell scheme.

Returns:

  • scheme (str) – Shelling scheme.

  • bval_groups (list) – List of grouped b-values.

  • bval_estimated (list) – List of ‘estimated’ b-values as the median value of each b-value group.