Skip to content

Replacing null with no_tap in utils_contrasts #89

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

Merged
merged 1 commit into from
Apr 25, 2025
Merged
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
10 changes: 5 additions & 5 deletions ibc_public/utils_contrasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1366,18 +1366,18 @@ def stop_nogo(design_matrix_columns):

def finger_tapping(design_matrix_columns):
""" Contrasts for finger tapping protocol"""
contrast_names = ['specified', 'chosen', 'null',
'chosen-specified', 'specified-null', 'chosen-null']
contrast_names = ['specified', 'chosen', 'no_tap',
'chosen-specified', 'specified-no_tap', 'chosen-no_tap']
if design_matrix_columns is None:
return dict([(name, []) for name in contrast_names])
con = _elementary_contrasts(design_matrix_columns)
contrasts = {
'specified': con['specified'],
'chosen': con['chosen'],
'null': con['null'],
'no_tap': con['no_tap'],
Copy link
Member

Choose a reason for hiding this comment

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

I'm afraid that this is not going to work, since con has the strings in design_matrix_columns as keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I addressed this here by renaming the entries of the event files as no_tap.

If I understood correctly, make_paradigm in utils_paradigms takes this file and gets the event info, and so far there are no adjustments needed in the post_process function for this task.

Is this what you meant ?

'chosen-specified': con['chosen'] - con['specified'],
'specified-null': con['specified'] - con['null'],
'chosen-null': con['chosen'] - con['null']}
'specified-no_tap': con['specified'] - con['no_tap'],
'chosen-no_tap': con['chosen'] - con['no_tap']}
assert((sorted(contrasts.keys()) == sorted(contrast_names)))
_append_derivative_contrast(design_matrix_columns, contrasts)
_append_effects_interest_contrast(design_matrix_columns, contrasts)
Expand Down