-
Notifications
You must be signed in to change notification settings - Fork 533
ENH: Enable orthogonalization in SPM models via SpecifyModel #2870
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?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,15 +331,19 @@ class SpecifyModel(BaseInterface): | |
- amplitudes : lists of amplitudes for each event. This will be ignored by | ||
SPM's Level1Design. | ||
|
||
The following two (tmod, pmod) will be ignored by any Level1Design class | ||
other than SPM: | ||
The following three (tmod, pmod, orth) will be ignored by any Level1Design class other than SPM: | ||
|
||
- tmod : lists of conditions that should be temporally modulated. Should | ||
default to None if not being used. | ||
- pmod : list of Bunch corresponding to conditions | ||
- name : name of parametric modulator | ||
- param : values of the modulator | ||
- poly : degree of modulation | ||
- orth : lists of instructions to orthogonolise parametric regressors or | ||
not. Same as in SPM, use 'Yes' to indicate orthogonalisation, and 'No' | ||
to explicitly prevent it. Use None for conditions where it is not being | ||
used. Note that by default SPM will orthogonalise parametric regressors | ||
in the order in which they are entered. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we enable the option where order does not matter? this was the fix in spm12. it's not actually fine to create orthogonalization options where order is important. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's possible this is the default, in which case the sentence above should be fixed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default == independent orthogonalization There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I know in SPM12 order still matters bcs orthogonalisation is done with respect to regressors entered previously. SPM8 was doing orthogonalisation automatically and switching it off required a hacky solution, while SPM12 does it by default, but now you can instruct it not to do it. I know this type of orthogonalisation is not necessarily OK, here I am simply implementing this option to switch it off. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. according to this: problem here: https://www.youtube.com/watch?v=HA_yjX868Ro&feature=youtu.be&t=915 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gllmflndn - is there a way to enable this programmatically? |
||
|
||
Alternatively, you can provide information through event files. | ||
|
||
|
@@ -369,7 +373,7 @@ class SpecifyModel(BaseInterface): | |
None]) | ||
>>> evs_run3 = Bunch(conditions=['cond1', 'cond2'], onsets=[[20, 120], [80, 160]], \ | ||
durations=[[0], [0]], pmod=[Bunch(name=['amp'], poly=[2], param=[[1, 2]]), \ | ||
None]) | ||
None], orth=['No', None]) | ||
>>> s.inputs.subject_info = [evs_run2, evs_run3] | ||
|
||
""" | ||
|
@@ -414,6 +418,12 @@ def _generate_standard_design(self, | |
if hasattr(info, 'tmod') and info.tmod and \ | ||
len(info.tmod) > cid: | ||
sessinfo[i]['cond'][cid]['tmod'] = info.tmod[cid] | ||
|
||
if hasattr(info, 'orth') and info.orth: | ||
if info.orth[cid] == 'Yes': | ||
sessinfo[i]['cond'][cid]['orth'] = 1 | ||
elif info.orth[cid] == 'No': | ||
sessinfo[i]['cond'][cid]['orth'] = 0 | ||
hstojic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if hasattr(info, 'pmod') and info.pmod and \ | ||
len(info.pmod) > cid: | ||
|
Uh oh!
There was an error while loading. Please reload this page.