-
Notifications
You must be signed in to change notification settings - Fork 296
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: Use new DerivativesDataSink
from NiWorkflows 1.2.0
#2114
Conversation
Thank your for raising your pull request. Some of the fMRIPRep maintainers will review your changes as soon as time permits. PR ReviewPlease check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide
Please check what applies in the following aspects of the PR: Code documentation
Documentation site
Tests
Data
Dependencies: smriprep
Dependencies: niworkflows
Dependencies: sdcflows
Dependencies: Nipype
Dependencies: other
Reports generated within CI tests
|
45ccd1c
to
83d4754
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.
Okay, the PR is working locally and I have high expectations that it'll work on Circle. I've left a few comments to make your reviews a bit easier, hope that helps.
@@ -9,69 +9,69 @@ fmriprep/logs/CITATION.md | |||
fmriprep/logs/CITATION.tex | |||
fmriprep/sub-01 | |||
fmriprep/sub-01/func | |||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv | |||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.json |
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.
pybids sanitizes the zero padding, and I'm fine with it - others?
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-brain_mask.nii.gz | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-preproc_bold.json | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-preproc_bold.nii.gz | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-1_AROMAnoiseICs.csv |
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 believe this is pretty nonstandard (even w.r.t. any current draft). Should we fix this in a separate PR, now that the implementation will be flexible enough to just update the inputs to the datasink?
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.
Let's do a separate PR, because we need to talk through the consequences with interested users.
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-1_desc-confounds_regressors.json | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-1_desc-confounds_regressors.tsv | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-1_desc-MELODIC_mixing.tsv | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-1_space-fsaverage5_hemi-L_bold.func.gii |
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've also added this as a default pattern:
-
hemi-X.func.gii
->hemi-X_bold.func.gii
The reason is that the suffix was being missed. In case you're wondering why I didn't add a _T1w suffix to the .surf.gii
of anatomical derivatives, the reason is that .surf.gii
only contains geometrical information, so there's no concept of modality expressed by the suffix. One less theoretical reason is that finding _T1w.surf.gii
implies the surface was extracted from a T1w and, for instance FLAIR or T2w were not used. Agreed this is not a super-solid argument, but I believe should be enough to feel comfortable with the new naming as regards GIFTIs.
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.
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.
Hmm. Yeah, maybe let's not do this until we finalize derivatives, to minimize the number of times we change derivatives.
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.
The default pattern is already written in niworkflows (which means, rolling back requires one more PR cycle). In addition, the new pattern would be more regular so hopefully more likely to be in line with the finalized derivatives.
If the reason to roll back is just practical (i.e., the reason to introduce this change is not counterargued), I'd rather keep it.
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'm okay with this. It looks like it's not covered explicitly anywhere in the derivatives draft, so we should make a point to argue for it.
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-2_desc-confounds_regressors.json | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-2_desc-confounds_regressors.tsv | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-2_desc-MELODIC_mixing.tsv | ||
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-2_space-fsaverage5_hemi-L_bold.func.gii |
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.
Similarly to the AROMA noise components, we might want to update this and generate space-fsaverage_den-10k
here (for a future PR).
@@ -50,7 +50,6 @@ single reference template (see `Longitudinal processing`_). | |||
('T1w', {}), | |||
('fsnative', {}) | |||
]), | |||
reportlets_dir='.', |
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.
Reportlets can now be written out directly to <output>/fmriprep/sub-xx/figures/
@@ -256,60 +256,133 @@ def init_func_derivatives_wf( | |||
|
|||
fs_outputs = spaces.cached.get_fs_spaces() | |||
if freesurfer and fs_outputs: | |||
from niworkflows.interfaces.surf import GiftiNameSource |
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 haven't removed this for backwards compatibility, but the new Path2BIDS should simplify its logic (no need anymore for building up the new pattern).
]) | ||
|
||
return workflow | ||
|
||
|
||
def init_bold_preproc_report_wf(mem_gb, reportlets_dir, name='bold_preproc_report_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 change is a bit out of scope. This workflow is not used anywhere (I wrote it when there were plans to show a before/after reportlet without/with preprocessing. This will potentially be used at some point, and I thought it was more findable here in the outputs module.
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.
Ran out of time to finish this before the meeting. Let's also revert the unnecessary setup.*
changes here, and that will make sure we test the latest commit over at niworkflows.
Will finish review this afternoon.
@@ -826,7 +826,7 @@ def init_func_preproc_wf(bold_file): | |||
# Fill-in datasinks of reportlets seen so far | |||
for node in workflow.list_node_names(): | |||
if node.split('.')[-1].startswith('ds_report'): | |||
workflow.get_node(node).inputs.base_directory = reportlets_dir | |||
workflow.get_node(node).inputs.base_directory = output_dir |
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 will also put HTML snippets in figures/
, right?
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.
One additional comment.
This PR integrates the new API that will be released with 1.2.0. References: nipreps/niworkflows#507
... in Circle's docker containers.
- [x] ``res-0X`` -> ``res-X`` - [x] ``hemi-X.func.gii`` -> ``hemi-X_bold.func.gii``
48bd94e
to
a86d1ef
Compare
a86d1ef
to
7aa3453
Compare
This is looking good. Can we just merge now? Last call for last minute reviews? |
Let's do it. |
This PR integrates the new API that will be released with 1.2.0.
References: nipreps/niworkflows#507
Changes proposed in this pull request
Documentation that should be reviewed