Skip to content
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

FIX: Re-add cohort identifier to template name #416

Merged
merged 9 commits into from
Feb 28, 2024

Conversation

mgxd
Copy link
Collaborator

@mgxd mgxd commented Feb 21, 2024

Fixes #415

We have been stripping out the cohort identifier in split_desc, and as a result losing the information when saving out transforms. This re-enables the output transforms to include the cohort information, i.e. ...from-MNIPediatricAsym+3_to-T1w_mode-image_xfm.h5.

However, this change exposes another problem: collect_derivatives cannot collect these transformations, as the current BIDSLayout configurations do not account for the + character during parsing. Since BIDS derivatives conventions are still a bit murky, I figured we want to just create a modified fmriprep-derivatives config to catch this convention when parsing.

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 78.53%. Comparing base (51da19b) to head (a624b2a).

Files Patch % Lines
smriprep/workflows/fit/registration.py 33.33% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #416       +/-   ##
===========================================
+ Coverage   61.63%   78.53%   +16.89%     
===========================================
  Files          24       30        +6     
  Lines        1903     2073      +170     
  Branches      241      242        +1     
===========================================
+ Hits         1173     1628      +455     
+ Misses        702      413      -289     
- Partials       28       32        +4     
Flag Coverage Δ
ds005 ∅ <ø> (?)
ds054 45.97% <11.53%> (?)
pytest 68.16% <91.30%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@oesteban
Copy link
Member

Looks good in general. Perhaps relying on the + semantic is too risky. Since the proposal was done also including - as allowed (and I believe also underscore), it will not fly anytime soon. And would honestly not will to try to get only + accepted.

What do you think about from-MNIPediatricAsymCohort3 or, alternatively and potentially generating conflicts down the line, from-MNIPediatricAsym_to-T1w_desc-cohort3_xfm.h5?

@mgxd
Copy link
Collaborator Author

mgxd commented Feb 22, 2024

TBH I don't love either option - at first I figured we could just add the cohort- entity directly, but that will clobber cases of inter-cohort xfms. IMO the + seems to be the cleanest / least ambiguous...

@mgxd mgxd marked this pull request as ready for review February 27, 2024 22:20
@mgxd
Copy link
Collaborator Author

mgxd commented Feb 28, 2024

@effigies if you have a minute, would appreciate a review

@oesteban
Copy link
Member

TBH I don't love either option - at first I figured we could just add the cohort- entity directly, but that will clobber cases of inter-cohort xfms. IMO the + seems to be the cleanest / least ambiguous...

In that case, I believe space- could be used: space-MNIPediatricAsym_from-cohort1_to-cohort2_xfm.h5, but this honestly feels like a templateflow's issue, not a plausible output of sMRIPrep

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM.

pyproject.toml Outdated Show resolved Hide resolved
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@effigies
Copy link
Member

effigies commented Feb 28, 2024

Is this considered a bugfix or a feature for versioning purposes?

@mgxd
Copy link
Collaborator Author

mgxd commented Feb 28, 2024

I consider it more of a bug fix to get cohort processing / --derivatives working, as the changes will really only affect those cases. But this will invalidate the cache starting from the fit.registration workflow so maybe worth a minor bump?

@effigies
Copy link
Member

Either way. We can go ahead and jump to fmriprep 24.0 if needed.

@mgxd
Copy link
Collaborator Author

mgxd commented Feb 28, 2024

Given that we're almost in Q2 of 2024 let's cut 24.0

@effigies effigies merged commit 2355035 into nipreps:master Feb 28, 2024
17 checks passed
@mgxd mgxd deleted the fix/template-cohort branch February 28, 2024 18:48
effigies added a commit that referenced this pull request Mar 20, 2024
0.14.0 (March 11, 2024)

New feature release in the 0.14.x series.

This release restores correct handling of cohort identifiers in templates.
A feature release is warranted due to changes in the workflow structure.

* FIX: Fetch templates during workflow construction (#418)
* FIX: Re-add cohort identifier to template name (#416)
* FIX: Repair FreeSurfer Dependency in Dockerfile (tcsh) (#404)
* FIX: Invert result of skull-strip check in auto mode (#402)
* STY: Adopt ruff for linting and formatting (#397)
* CHORE: Update ruff, ignore certain rules (#419)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fmriprep error "ValueError: 'MNIPediatricAsym:cohort-3' is not in list"
3 participants