Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

Commit

Permalink
enh: add SHORE model
Browse files Browse the repository at this point in the history
Resolves: #38.
  • Loading branch information
oesteban committed Dec 9, 2022
1 parent cc5f547 commit 39be439
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ setup_requires =
setuptools_scm >= 6.2
wheel
install_requires =
cvxpy
dipy>=1.3.0
joblib
nipype>= 1.5.1, < 2.0
Expand Down
23 changes: 20 additions & 3 deletions src/eddymotion/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def init(gtab, model="DTI", **kwargs):
return AverageDWModel(gtab=gtab, **kwargs)

# Generate a GradientTable object for DIPY
if model.lower() in ("dti", "dki"):
if model.lower() in ("dti", "dki", "shore"):
Model = globals()[f"{model.upper()}Model"]
return Model(gtab, **kwargs)

Expand Down Expand Up @@ -285,13 +285,30 @@ class DTIModel(BaseModel):
_model_class = "dipy.reconst.dti.TensorModel"


class DKIModel(BaseModel):
class DKIModel(DTIModel):
"""A wrapper of :obj:`dipy.reconst.dki.DiffusionKurtosisModel`."""

_modelargs = DTIModel._modelargs
_model_class = "dipy.reconst.dki.DiffusionKurtosisModel"


class SHOREModel(BaseModel):
"""A wrapper of :obj:`dipy.reconst.shore.ShoreModel`."""

_modelargs = (
"radial_order",
"zeta",
"lambdaN",
"lambdaL",
"tau",
"constrain_e0",
"positive_constraint",
"pos_grid",
"pos_radius",
"cvxpy_solver",
)
_model_class = "dipy.reconst.shore.ShoreModel"


def _rasb2dipy(gradient):
gradient = np.asanyarray(gradient)
if gradient.ndim == 1:
Expand Down

0 comments on commit 39be439

Please sign in to comment.