-
Notifications
You must be signed in to change notification settings - Fork 28
Description
What would you like to see added in this software?
I am trying to replace an internal, outdated copy of SDCFlows in ASLPrep with the current version. However, since asl and m0scan are not supported suffixes for PEPOLAR or fieldmap-less distortion correction, I cannot use SDCFlows as a dependency without making changes to the codebase, getting those changes merged in, and getting a new release minted.
It seems like this restriction could be alleviated if suffixes and datatypes could be configured outside of the functions and classes.
Do you have any interest in helping implement the feature?
Yes
Additional information / screenshots
For example, there's a constant in sdcflows.fieldmaps called MODALITIES that I could override with a context manager when I use FieldmapFile in ASLPrep:
sdcflows/sdcflows/fieldmaps.py
Lines 54 to 68 in 8ca7280
| MODALITIES = { | |
| "bold": EstimatorType.PEPOLAR, | |
| "dwi": EstimatorType.PEPOLAR, | |
| "epi": EstimatorType.PEPOLAR, | |
| "fieldmap": EstimatorType.MAPPED, | |
| "magnitude": None, | |
| "magnitude1": None, | |
| "magnitude2": None, | |
| "phase1": EstimatorType.PHASEDIFF, | |
| "phase2": EstimatorType.PHASEDIFF, | |
| "phasediff": EstimatorType.PHASEDIFF, | |
| "sbref": EstimatorType.PEPOLAR, | |
| "T1w": EstimatorType.ANAT, | |
| "T2w": EstimatorType.ANAT, | |
| } |
However, FieldmapFile then has suffixes hardcoded throughout, so, even if I modified MODALITIES it still wouldn't recognize the suffixes I need. For example:
sdcflows/sdcflows/fieldmaps.py
Lines 243 to 248 in 8ca7280
| # Check for REQUIRED metadata (depends on suffix.) | |
| if self.suffix in ("bold", "dwi", "epi", "sbref"): | |
| if "PhaseEncodingDirection" not in self.metadata: | |
| raise MetadataError( | |
| f"Missing 'PhaseEncodingDirection' for <{self.path}>." | |
| ) |