-
Notifications
You must be signed in to change notification settings - Fork 588
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] Allow preprocessed data in native space in load_confounds
#3531
Conversation
👋 @htwangtw Thanks for creating a PR! Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft. Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
We will review it as quick as possible, feel free to ping us with questions if needed. |
Codecov Report
@@ Coverage Diff @@
## main #3531 +/- ##
=======================================
Coverage 91.01% 91.01%
=======================================
Files 133 133
Lines 15384 15392 +8
Branches 3212 3214 +2
=======================================
+ Hits 14001 14009 +8
Misses 819 819
Partials 564 564
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
suffix = "_space-" + nii_file.split("space-")[1] | ||
entities = parse_bids_filename(nii_file) | ||
subject_label = f"sub-{entities['sub']}" | ||
if "session" in entities: |
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.
Still wrapping my head around how nilearn deals with BIDS things but isn't that supposed to be
if "ses" in entities:
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.
Yes, and the test is missing this line. Will fix it
"nii.gz": "_space-.*_desc-preproc_bold.nii.gz", | ||
"dtseries.nii": "_space-.*_bold.dtseries.nii", | ||
"func.gii": "_space-.*_hemi-[LR]_bold.func.gii", | ||
"nii.gz": "(_space-.*)?_desc-preproc_bold\.nii\.gz", |
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.
Just curious: what is the effects of \
in the string ?
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 think it escapes the . as a wildcard character in regular expressions
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, thx.
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 @htwangtw! I think this is worth a whatsnew entry
@htwangtw since I made a prerelease earlier this week the |
Co-authored-by: Yasmin <63292494+ymzayek@users.noreply.github.com>
97b7c4d
to
24436a1
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.
LGTM thx @htwangtw !
…learn#3531) * [ADD/BREAK]Use BIDS entity to look up confound file * FIX correctly detect native space * [TEST]session and run in file name * Update nilearn/interfaces/fmriprep/load_confounds_utils.py Co-authored-by: Yasmin <63292494+ymzayek@users.noreply.github.com> * Update latest * FIX extra symbols? * typo... * remove \. escape to avoid deprecation warning * move update to dev section --------- Co-authored-by: Yasmin <63292494+ymzayek@users.noreply.github.com>
Closes #3479.
Changes proposed in this pull request:
nilearn.interfaces.bids.parse_bids_filename
to parse and construct file names that fits fMRIPrep doc better