-
Notifications
You must be signed in to change notification settings - Fork 530
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
SPM model - how to implement orthogonolise option for parametric modulation? #2811
Comments
This is what I resorted to, implementing additional interface to use the matlab script to go through the SPM.mat object produced by SPM's I was then creating a node calling this interface and putting it in between the design and estimation nodes: l1orth = Node(SetOrth(), name = "l1orth")
l1orth.inputs.orth = "No"
l1analysis = Workflow(name = 'l1analysis')
l1analysis.base_dir = os.path.join(dir_neurodata_proc, 'nipype_work')
l1analysis.connect([
(l1model, l1design, [('session_info', 'session_info')]),
(l1design, l1orth, [('spm_mat_file', 'spm_mat_file')]),
(l1orth, l1estimate, [('spm_mat_file', 'spm_mat_file')]),
(l1estimate, l1contrasts, [
('spm_mat_file', 'spm_mat_file'),
('beta_images', 'beta_images'),
('residual_image', 'residual_image')]
)
]) I hate the solution, but I really couldn't understand the code in Also, when implementing this I first followed the documentation here, but that was returning errors. Then I followed this instead and that worked. Is the documentation on the main website up to date? I also tried writing a simple function through which the output of design node would be passed before forwarding it to the estimation node. I used scipy to load the SPM.mat file created by the design node, that works fine but it seems object is in a strange format and it wouldn't want to save it back, even if the object is unchanged. This is much cleaner solution, but couldn't figure out why scipy was complaining about the SPM object. Anyhow, |
@hstojic - are and then updating the session structure returned here: https://github.com/nipy/nipype/blob/master/nipype/algorithms/modelgen.py#L618 with something along the lines of:
regarding source of documentation, we are doing some reorganization. @miykael and @djarecka are updating the jupyter notebooks to take over bulk of the training material and resolving such issues. |
Ok, took some time but I implemented it following @satra suggestion and it works as far as I can tell. Instead of supplying it as an additional input it seemed better to implement it as a part of sessioninfo. Submitted PR for it. |
Hi @hstojic, I am interested in using niype to analyse my fMRI data and am figuring out a way to turn orthogonalization for parametric modulation off. Is there any reason why your implementation has not yet been merged to the latest Nipype version yet? (I saw that it got blocked). I changed the source code locally by myself by looking at your code at it seems to work. Based on my understanding, the issue seem to be that it only works with SPM12 (not SPM8), and for the final release, we will just need to perform a SPM version check before your modified code, right? Best, |
I am using parametric modulation, using SPM. SPM 12 has an option to switch off the default orthogonolisation of regressors, but it seems that option cannot be set from Nipype.
Is nipype setting it to false by default by any chance? I was trying to look under the hood in modelgen.py, but there is nothing there about exact commands sent to SPM - what code in the library I should look up for that?
I could hack the spm code to achieve that, but I would rather try finding a way to do it from nipype and perhaps send a pull request. How would one go about that? It's definitely an important option to be able to set.
According to the matlab batch file,
orth
is the option in addition totmod
andpmod
so we should enable that SPM specific option in the subject_info, along the
tmod
andpmod
.The text was updated successfully, but these errors were encountered: