Skip to content

Commit

Permalink
fixes gtab dmipy2dipy bug with undefined deltas (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
rutgerfick committed Oct 1, 2019
1 parent 04fb836 commit 4e5dc14
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dmipy/core/acquisition_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,15 +899,19 @@ def gtab_dmipy2dipy(dmipy_gradient_table):
delta = dmipy_gradient_table.delta
Delta = dmipy_gradient_table.Delta

if len(np.unique(delta)) > 1:
if delta is None:
pass # leave delta undefined in dipy gtab
elif len(np.unique(delta)) > 1:
msg = "Cannot create Dipy GradientTable for Acquisition schemes with "
msg += "multiple delta (pulse duration) values, due to current "
msg += "limitations of Dipy GradientTables."
raise ValueError(msg)
elif len(np.unique(delta)) == 1:
delta = delta[0]

if len(np.unique(Delta)) > 1:
if Delta is None:
pass # leave Delta undefined in dipy gtab
elif len(np.unique(Delta)) > 1:
msg = "Cannot create Dipy GradientTable for Acquisition schemes with "
msg += "multiple Delta (pulse sepration) values, due to current "
msg += "limitations of Dipy GradientTables."
Expand Down

0 comments on commit 4e5dc14

Please sign in to comment.