-
Notifications
You must be signed in to change notification settings - Fork 307
ENH: Add dedicated session filtering, alternative anatomical template options #3495
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
base: master
Are you sure you want to change the base?
Conversation
processing_groups = None | ||
"""List of tuples (participant, session(s)) that will be preprocessed.""" |
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 is derived from participant_label
, session_label
and subject_anatomical_reference
. Might be handy for reporting, but it does mean that the config object state can be inconsistent.
IMO it would be better just to calculate the groups when needed with a well-isolated function rather than deal with (de)serialization and consistency.
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 also considered omitting, but decided to include it since having that provenance is nice. session_label
is only populated if --session-label
is used, otherwise all sessions pertaining to that subject are queried from the layout (and that information is not currently being stored). the config object should never be changed, just the dict representation of it (and when dump
ing to toml).
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3495 +/- ##
==========================================
+ Coverage 73.50% 73.62% +0.11%
==========================================
Files 60 60
Lines 4582 4750 +168
Branches 585 616 +31
==========================================
+ Hits 3368 3497 +129
- Misses 1085 1110 +25
- Partials 129 143 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 just have a couple of minor documentation-related suggestions for now.
Co-authored-by: Taylor Salo <[email protected]>
1096fce
to
1ea9211
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.
Sorry for taking so long. I think this is mostly good to go.
fmriprep/cli/parser.py
Outdated
if not sessions: | ||
raise RuntimeError( | ||
'`--subject-anatomical-reference sessionwise` was requested, but no sessions ' | ||
f'found for subject {subject}.' | ||
) |
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 seems like it shouldn't be an error. No sessions is the same as a single session, so I would expect it to work the same. I think changing this to:
if subject_anatomical_reference == 'sessionwise' and sessions:
subject_session_list.extend((subject, session) for session in sessions)
else:
subject_session_list.append((subject, sessions))
should cover your use cases... That said, this isn't tested, so it's hard to figure out what's happening.
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.
was maintaining the logic first implemented in smriprep, but i agree that raising an error is a bit too strict - imo, a warning would suffice.
Co-authored-by: Chris Markiewicz <[email protected]>
Builds off nipreps/smriprep#480
Adds new arguments:
--session-label
for a more streamlined way to filter sessions--subject-anatomical-reference
to determine how the reference anatomical should be constructed.