ENH: Refactor the workflow infrastructure #113
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR essentially creates a new
init_fmap_preproc_wf
workflow factory function, inspired by the success ofinit_anat_preproc_wf
in sMRIPrep for T1w, T2w, and FLAIR images.The idea is to clearly split the SDC (susceptibility distortion correction) process into its two main steps (#21): estimation of the warping and unwarping of data. To do so, fieldmap data are regarded at a higher level that actually generates derivatives (ref. #26).
The new
init_fmap_preproc_wf
takes in someinput_data
and:Because there's no spec for fieldmap derivatives, we could store it as a 4D file with two timepoints. First timepoint is the actual fieldmap and the second is the corresponding anatomical reference (magnitude, epi).
The derivative file would be something like:
derivatives/fmriprep-20.2.0/sub-01/fmap/sub-01_desc-preproc_fieldmap.nii.gz
. Should bids-standard/bids-specification#622 be merged, then a potential name for this could bederivatives/fmriprep-20.2.0/sub-01/fmap/sub-01_[id-<B0FieldIdentifier>]_fieldmap.nii.gz
withB0FieldIdentifier
being the metadata entry, if present.The corresponding JSON metadata should always propagate the
IntendedFor
of the source data, so that these fieldmaps can be actually applied (esp. if bids-standard/bids-specification#622 is never accepted.)Another feature I'm seriously considering is to create a lightweight object (á la
niworkflows.utils.spaces.Reference
) for representinginput_data
argument.Some sort of
FieldmapSources
object that morphs itself depending on the inputs, to offer specialized methods and metadata determined from the inputs.I'm just proposing the idea with this draft, looking forward to getting some feedback.