Skip to content

Commit 53a5184

Browse files
committed
enh: check number of pe directions for pepolar
1 parent 4f94438 commit 53a5184

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sdcflows/fieldmaps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,11 @@ def __attrs_post_init__(self):
331331

332332
if _pepolar_estimation:
333333
self.method = MODALITIES[pepolar_types.pop()]
334+
_pe = set(f.metadata["PhaseEncodingDirection"] for f in self.sources)
335+
if len(_pe) == 1:
336+
raise ValueError(
337+
f"Only one phase-encoding direction <{_pe.pop()}> found across sources."
338+
)
334339

335340
anat_types = suffix_set.intersection(("T1w", "T2w"))
336341
if anat_types:

0 commit comments

Comments
 (0)