Skip to content

Commit 635bb5a

Browse files
authored
Clarify echo time errors. Closes #1219
1 parent 85c06a3 commit 635bb5a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

fmriprep/interfaces/fmap.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,16 @@ def _delta_te(in_values, te1=None, te2=None):
517517
te1 = te1[1]
518518
if isinstance(te2, list):
519519
te2 = te2[1]
520-
521-
if te1 is None or te2 is None:
520+
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(
524+
'EchoTime1 and EchoTime2 metadata fields not found. Please consult the BIDS specification.')
525+
if te1 is None:
526+
raise RuntimeError(
527+
'EchoTime1 metadata field not found. Please consult the BIDS specification.')
528+
if te1 is None:
522529
raise RuntimeError(
523-
'No echo time information found')
530+
'EchoTime2 metadata field not found. Please consult the BIDS specification.')
524531

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

0 commit comments

Comments
 (0)