-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: Enable anatomical fast track reusing existing derivatives #107
ENH: Enable anatomical fast track reusing existing derivatives #107
Conversation
c9a5383
to
11e1e8c
Compare
a83f3d1
to
1489776
Compare
Spatial normalization defines selected ``--output-spaces`` as an iterable to the workflow. This PR removes several ad-hoc function nodes and replaces them with a new nipype interface to query templates. These changes will facilitate concluding nipreps#107.
This PR delays report generation to the ``anat_report_wf`` workflow which is staged at the end. This decoupling will allow creating reportlets from existing derivatives in the context of nipreps#107.
This PR delays report generation to the ``anat_report_wf`` workflow which is staged at the end. This decoupling will allow creating reportlets from existing derivatives in the context of nipreps#107.
1489776
to
e3d554b
Compare
@oesteban I'm assuming this is still WIP? |
Yup, it is. Although I wasn't too far away from finishing up. |
Okay. Just clicked through and saw you requested a review, so wanted to make sure you weren't waiting on that. |
The review could be very helpful. I'm not blocked by that though - I hit a couple of edge cases - just need to make sure all the derivatives we then reuse are generated (e.g., one of the tk2ras or vice-versa for FreeSurfer was missing). |
e3d554b
to
680aaf4
Compare
0bbc87a
to
2de3b5b
Compare
This commit stops exposing the parameterized outputs (by iterables), namely ``template``, ``anat2std_xfm`` and ``std2anat_xfm``.
2de3b5b
to
6292298
Compare
I think this is finished, currently working with nipreps/fmriprep#2036 -- I was waiting on that one to be finished or very nearly finished before pushing on this one for the final stretch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good
Last call for comments - this is going in otherwise... :D |
I've started looking a couple times, but won't be able to finish until tomorrow afternoon, so if you need it in before then, go ahead without me. |
I am looking forward to merging this asap, but I also think your vetting is more important. Waiting for one more day will not hurt at all, and not waiting will potentially bite back. I'll hold on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it looks like an all-or-nothing thing. If any expected derivative is not found, then the whole thing is rerun. I would assume the long-term goal is to allow individual steps to be replaced, but this seems like a good first step.
Thanks for your patience.
Correct.
Yup, that'd be the plan. There are a lot of details we need to figure out to continue with it. And yes, the scope of this is just one first step.
Thanks for your time! |
… given Summary ------- This PR utilizes nipreps/smriprep#107 to allow a fast skip of the anatomical workflow evaluation, and the need of maintaining the work directory for it. Closes nipreps#1175 Changes suggested ----------------- * [x] Added an ``--anat-derivatives`` flag to the command line. * [x] Integrated the new flag with the new config module. * [x] Estimate existing derivatives using *sMRIPrep*'s tooling. * [x] Pass in the existing derivatives and nipreps/smriprep#107 skips the anatomical workflow fulfilling the workflow API. Potential problems ------------------ This PR does not contain any measures to preserve the reproducibility of *fMRIPrep* if the fast-track is used.
Uses nipreps/smriprep#107 to skip precalculated anatomical derivatives, just setting the ``--anat-derivatives <path>`` command line argument.
Summary
These changes modify the workflow construction function
init_anat_preproc_wf
to add a checkpoint on the new named argumentexisting_derivatives
at the beginning of the process.When
existing_derivatives
is a dictionary containing all the anatomical derivatives to be computed, then the workflow is short-cut and only the reportlets are re-generated.Changes
Other changes in this PR include:
existing_derivatives
that may serve as pattern reference to include this characteristic in fmriprep and dmriprep. The boilerplate includes a new--force-build
argument to smriprep's command line that allows dismissing the check on existing derivatives, hence running the full workflow with standard nipype operation as regards caching.smriprep.utils.bids.collect_derivatives
function that populatesexisting_derivatives
, which can (should) be imported to use the feature in f/dMRIPrep.[force-build]
are added the new--force-build
tag. Commits to master are automatically added the flag.Related issues
Closes #105.