Skip to content

Commit 51145b5

Browse files
authored
Merge pull request #1221 from poldracklab/chrisfilo-patch-1
ENH: More specific errors for missing echo times
2 parents f60fa28 + ccb04ca commit 51145b5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

fmriprep/interfaces/fmap.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,15 @@ def _delta_te(in_values, te1=None, te2=None):
518518
if isinstance(te2, list):
519519
te2 = te2[1]
520520

521-
if te1 is None or te2 is None:
521+
# For convienience if both are missing we should give one error about them
522+
if te1 is None and te2 is None:
523+
raise RuntimeError('EchoTime1 and EchoTime2 metadata fields not found. '
524+
'Please consult the BIDS specification.')
525+
if te1 is None:
522526
raise RuntimeError(
523-
'No echo time information found')
527+
'EchoTime1 metadata field not found. Please consult the BIDS specification.')
528+
if te2 is None:
529+
raise RuntimeError(
530+
'EchoTime2 metadata field not found. Please consult the BIDS specification.')
524531

525532
return abs(float(te2) - float(te1))

0 commit comments

Comments
 (0)