From a0ca25aaec52fd9092bc1a2dc720f948826b3415 Mon Sep 17 00:00:00 2001 From: Marcel Zwiers Date: Tue, 16 Apr 2024 15:22:43 +0200 Subject: [PATCH] Fix false positive matches from other parts in the BIDS filename (e.g. files named `sub-01-acq-fieldmap_magnitude1.nii.gz` (see github issue #264) --- sdcflows/fieldmaps.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdcflows/fieldmaps.py b/sdcflows/fieldmaps.py index b724a26a8b..0909592ee8 100644 --- a/sdcflows/fieldmaps.py +++ b/sdcflows/fieldmaps.py @@ -340,9 +340,9 @@ def __attrs_post_init__(self): try: new_path = ( sources[0].parent / sources[0].name - .replace("fieldmap", "magnitude") - .replace("diff", "1") - .replace("phase", "magnitude") + .replace("_fieldmap", "_magnitude") + .replace("_phasediff", "_phase1") + .replace("_phase", "_magnitude") ) self.sources.append(FieldmapFile(new_path)) except Exception: