-
Notifications
You must be signed in to change notification settings - Fork 37
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
RF: Split anatomical workflow into fit and derivatives workflows #303
Conversation
d4db265
to
69ba77d
Compare
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #303 +/- ##
===========================================
+ Coverage 31.18% 53.75% +22.56%
===========================================
Files 20 22 +2
Lines 1456 1600 +144
Branches 206 251 +45
===========================================
+ Hits 454 860 +406
+ Misses 987 672 -315
- Partials 15 68 +53
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
ca58281
to
abe2c05
Compare
abe2c05
to
9cbcb73
Compare
224b305
to
6be5c53
Compare
2b40799
to
e7628a0
Compare
ac6a5d9
to
0d8b632
Compare
Tests passing. Will start re-adding the workflow description. |
0d8b632
to
7de4d09
Compare
8959b5e
to
2bba697
Compare
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.
@@ -65,7 +65,6 @@ | |||
"seaborn", | |||
"skimage", | |||
"svgutils", | |||
"templateflow", |
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.
Hopefully we don't end up downloading things during builds, but if so, so be it.
@@ -50,81 +51,6 @@ def get_outputnode_spec(): | |||
return fields | |||
|
|||
|
|||
def predict_derivatives(subject_id, output_spaces, freesurfer): |
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.
This didn't seem to be used anywhere, and deleting this freed me up to change collect_derivatives
to use BIDSLayout
and use lists as "or" instead of "and" in io_spec.json
.
name="anat_preproc_wf", | ||
skull_strip_fixed_seed=False, | ||
skull_strip_fixed_seed: bool = False, |
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.
Type annotations grew out of frustration of not knowing what I was working with (particularly Reference and SpatialReference). The consequence of this was that I need to import Reference
and SpatialReference
at the module level, which meant that a mocked templateflow
prevented the loading of spatial references.
return workflow | ||
|
||
|
||
def init_ds_template_wf( |
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.
I feel like we need a better name, but this is the subject template, not MNI or other template spaces.
return workflow | ||
|
||
|
||
def init_anat_derivatives_wf( | ||
def init_anat_second_derivatives_wf( |
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.
This could definitely stand refactoring, but I'd prefer to keep that until later.
@@ -655,12 +932,104 @@ def init_anat_derivatives_wf( | |||
return workflow | |||
|
|||
|
|||
def init_template_iterator_wf(*, spaces, name="template_iterator_wf"): |
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.
I like this a lot. I feel like what we're going to want one of these sitting in the subject level that then gets passed as inputs to the baseline derivatives (registrations only), reporting and full derivative workflows.
Need to spend some time to work out what that would look like, in a separate PR. For now we spin one of these up inside the reporting and full derivatives workflows.
if "fsnative" not in precomputed.get("transforms", {}): | ||
fsnative2t1w_xfm = pe.Node( | ||
RobustRegister(auto_sens=True, est_int_scale=True), name="fsnative2t1w_xfm" | ||
) | ||
|
||
# fmt:off | ||
workflow.connect([ | ||
(inputnode, fsnative2t1w_xfm, [('t1w', 'target_file')]), | ||
(autorecon1, fsnative2t1w_xfm, [('T1', 'source_file')]), | ||
(fsnative2t1w_xfm, outputnode, [('out_reg_file', 'fsnative2t1w_xfm')]), | ||
]) | ||
# fmt: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.
This was all that was needed to isolate this step, which drew attention to the fact that we're not mapping skull-strips correctly into fsnative. This should be resolved in another PR.
name="outputnode", | ||
) | ||
|
||
aseg_to_native_wf = init_segs_to_native_wf() |
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.
Duplicated here and in init_surface_derivatives_wf
. Acceptably small duplication of effort for conceptual clarity, IMO.
…s.apply.resampling
Currently skipping report generation and LiterateWorkflow descriptions
76b7362
to
8aa8e6c
Compare
e16d855
to
26ff900
Compare
bb39a29
to
653f728
Compare
9002119
to
811f52f
Compare
I have verified that the sphere_reg_fsLR files is deterministic and also quick to compute, so there is no harm in pushing this out of fit.
9b4f22c
to
22f236d
Compare
22f236d
to
c8853ef
Compare
@mgxd @oesteban I've reset the merge target to a I will be doing a similar thing over on fMRIPrep. |
Starting on #300.