eddymotion.model.base module

Base infrastructure for eddymotion’s models.

class eddymotion.model.base.AverageModel(**kwargs)[source]

Bases: BaseModel

A trivial model that returns an average map.

fit(data, **kwargs)[source]

Calculate the average.

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

Return the average map.

class eddymotion.model.base.BaseModel(mask=None, **kwargs)[source]

Bases: object

Defines the interface and default methods.

Implements the interface of dipy.reconst.base.ReconstModel. Instead of inheriting from the abstract base, this implementation follows type adaptation principles, as it is easier to maintain and to read (see https://www.youtube.com/watch?v=3MNVP9-hglc).

fit(data, **kwargs)[source]

Abstract member signature of fit().

property is_fitted
predict(*args, **kwargs)[source]

Abstract member signature of predict().

class eddymotion.model.base.ModelFactory[source]

Bases: object

A factory for instantiating diffusion models.

static init(model='DTI', **kwargs)[source]

Instantiate a diffusion model.

Parameters:

model (str) – Diffusion model. Options: "DTI", "DKI", "S0", "AverageDW"

Returns:

model – A model object compliant with DIPY’s interface.

Return type:

ReconstModel

class eddymotion.model.base.TrivialModel(predicted=None, **kwargs)[source]

Bases: BaseModel

A trivial model that returns a given map always.

fit(data, **kwargs)[source]

Do nothing.

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

Return the b=0 map.