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

backport fix copy of dseg.tsv following templateflow update for LTS #421

Open
wants to merge 1 commit into
base: maint/0.7.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion smriprep/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ def _warn_redirect(message, category, filename, lineno, file=None, line=None):
if opts.run_reconall:
from templateflow import api
from niworkflows.utils.misc import _copy_any
dseg_tsv = str(api.get('fsaverage', suffix='dseg', extension=['.tsv']))
dseg_tsv = str(
api.get('fsaverage', hemi=None, atlas=None, suffix='dseg', extension=['.tsv'])
)
_copy_any(dseg_tsv,
str(Path(output_dir) / 'smriprep' / 'desc-aseg_dseg.tsv'))
_copy_any(dseg_tsv,
Comment on lines +250 to 255
Copy link
Member

Choose a reason for hiding this comment

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

We'll need an associated PR against the fMRIPrep LTS branch. At least the Docker container pins the specific templateflow version, so this line either needs to be one that works for versions 0.7.1 and 24.1.0 or we'll need to check the version.

https://github.com/nipreps/fmriprep/blob/maint/20.2.x/docker/files/environment.yml#L202

Copy link
Member

Choose a reason for hiding this comment

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

Given that the valid query parameters changed in 24.1, I don't think we can do this reliably across versions with a single command. I would suggest for the LTS:

dseg_LUTs = api.get(OLD_PARAMS)
if isinstance(dseg_LUTs, list):
    dseg_LUTs = api.get(NEW_PARAMS)  # Requires tf 24.1+
if isinstance(dseg_LUTs, list):
    dseg_LUTs = dseg_LUTs[0]
dseg_tsv = str(dseg_LUTs)

Expand Down