Skip to content

Commit

Permalink
Merge pull request #1139 from 36000/dki_bval_error_check
Browse files Browse the repository at this point in the history
Check bvals on dki
  • Loading branch information
36000 authored May 21, 2024
2 parents a2d8678 + 7d4ae39 commit 2889d7a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions AFQ/tasks/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ def dki_params(brain_mask, gtab, data):
full path to a nifti file containing
parameters for the DKI fit
"""
if len(dpg.unique_bvals_magnitude(gtab.bvals)) < 3:
raise ValueError((
"The DKI model requires at least 2 non-zero b-values, "
f"but you provided {len(dpg.unique_bvals_magnitude(gtab.bvals))}"
" b-values (including b=0)."))
mask =\
nib.load(brain_mask).get_fdata()
dkf = dki_fit_model(
Expand Down

0 comments on commit 2889d7a

Please sign in to comment.