-
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
Add --fs-no-resume option to reuse existing freesurfer outputs without resuming (eg. longitudinal pipeline base) #393
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #393 +/- ##
===========================================
+ Coverage 62.99% 78.54% +15.54%
===========================================
Files 24 30 +6
Lines 1927 2093 +166
Branches 248 249 +1
===========================================
+ Hits 1214 1644 +430
+ Misses 678 417 -261
+ Partials 35 32 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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, getting back to this. Thanks for the patience. As I understand it, instead of trying to correctly wrap longitudinal FreeSurfer in the same way we've been wrapping single-session FreeSurfer, this just give the user a "trust me, I know what I'm doing" button.
If that's the case, I think the better approach is probably to make the flag --fs-no-resume
or something like that (open to alternatives), which would allow it to work with any FreeSurfer-like directory structure. This would work equally well with longitudinal FreeSurfer, fastsurfer (#280) or any other technique that comes out.
One thing that would be worth considering in that case is to provide a function to check for necessary files and error out early if they are not found. For example we need {lh,rh}.{white,pial,thickness,sulc,curv,sphere,sphere.reg}
as well as T1.mgz
, aparc.mgz
, aparc+aseg.mgz
and either FLAIR.mgz
or T2.mgz
, if T2w/FLAIR are detected.
That said, since this would be a "power user" feature, I don't think it's critical to write a hand-holder on the first pass.
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
Exactly, wrapping longitudinal pipeline is more complex.
Happy with renaming the flag, I had not thought about the fastsurfer usecase but that's a very good point.
Such as a new nipype node that checks that the traits are not undefined?
|
smriprep/cli/run.py
Outdated
help='Import precomputed freesurfer without resuming ' | ||
'(longitudinal or fastsurfer data) ' | ||
"!expert option (you know what you're doing)!", |
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.
Probably needs different line break points, but here's some updated wording:
help='Import precomputed freesurfer without resuming ' | |
'(longitudinal or fastsurfer data) ' | |
"!expert option (you know what you're doing)!", | |
help='EXPERT: Import pre-computed FreeSurfer reconstruction without resuming. ' | |
'The user is responsible for ensuring that all necessary files are present.' |
Interestingly, templateflow/tpl-fsaverage#5 broke the CI run here (and likely any smriprep run?) |
I guess we want Line 416 in 45c2e2f
to become: dseg_tsv = str(api.get('fsaverage', hemi=None, seg='aparc', suffix='dseg', extension=['.tsv'])) |
Opened #420 |
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.
LGTM. Added a comment and updated the fmt:<on|off|skip>
directives.
0.15.0 (March 22, 2024) New feature release in the 0.15.x series. This release adds the workflow configuration option and CLI option to reuse existing FreeSurfer outputs without attempting to resume. This should allow for using longitudinal or non-standard pipelines (for example, FastSurfer) without additional tooling for each variant. * FIX: Patch version for smriprep-docker (#424) * FIX: Require recent templateflow, select correct aparc dseg.tsv (#420) * ENH: Add --fs-no-resume option to reuse existing FreeSurfer outputs without resuming (#393) * MNT: set copyright owner in LICENSE file (#426) * MNT: Apply Repo-Review suggestions (#422) * CI: Small cleanups to GHA (#423)
(Reopen of #371)
For now, it is not possible to run f/sMRIPrep with existing longitudinal freesurfer output.
If I understood correctly, the current surface generation workflow:
runs autorecon1 without skullstripping
injects a custom (and more robust) brainmask.mgz
resume to autorecon2/3 without any other tweaks.
The simpler way I found to input the base/template recon-all is to use the FreeSurferSource and reconnect everything appropriately. Does that make sense, or I missed something (like registering the sMRIPrep generated average to the freesurfer one).