Dear Andy et al.,
Please find attached a script that creates models for each subject based on a template subject. You need to set the line at the top to specify the input number within the B-matrix to vary across subjects. This script demonstrates two things:
- How to use spm_dcm_voi to change the timeseries within a DCM (this can also be called from the batch)
- How to use spm_perm_mtx to create all possible models (in this case, not including parameters on self-connections)
This isn’t fully tested, please check the output carefully and use at your own risk.
Best,
Peter
From: Andy Yeung [mailto:[log in to unmask]]
Sent: 15 October 2015 23:55
To: Zeidman, Peter <[log in to unmask]>
Cc: [log in to unmask]
Subject: Re: [SPM] Automated DCM specification
Dear Peter,
Yes trial onsets are identical for each subject for the regressors I defined in the GLM for DCM.
Yes all VOIs have identical names for each subject and stored in respective subject's SPM.mat directory.
Best,
Andy
On Thu, Oct 15, 2015 at 8:40 PM, Zeidman, Peter <[log in to unmask]> wrote:
Hi Andy,
Two questions so that I can write this correctly for you:
- Are the trial onsets identical for each subject, or do you have different onsets per subject?
- Can I assume that the VOIs have identical names for each subject, stored in the same directory as each subject’s SPM.mat?
Best,
P
From: Andy Yeung [mailto:[log in to unmask]]
Sent: 15 October 2015 12:47
To: Zeidman, Peter <[log in to unmask]>
Cc: [log in to unmask]
Subject: Re: [SPM] Automated DCM specification
Dear Peter,
Yes I vary modulatory input (none, forward only, backward only, bidirectional) in each inter-node connection.
64 models. But since I do 34 subjects, that's why I mentioned 64*34 = 2176 models.
I would definitely appreciate a lot if you could help me write a script.
Best,
Andy
On Thu, Oct 15, 2015 at 5:59 PM, Zeidman, Peter <[log in to unmask]> wrote:
Dear Andy (CC mailing list),
You have two options. You can either do an automatic search over sub-models (by specifying each subject’s full model, then clicking ‘optimise’ in the DCM GUI and selecting all full models). The search conducted by this ‘post-hoc’ procedure won’t necessarily include all the models you are interested in.
If you want to manually specify the specific models, then it’s easy to write a script - I can help you with that. But I don’t understand why you have 2176 models. If you’re just varying the modulatory input, surely it’s 2^6=64 models?
Best,
P
From: Andy Yeung [mailto:[log in to unmask]]
Sent: 15 October 2015 05:43
To: Zeidman, Peter <[log in to unmask]>
Subject: Fwd: [SPM] Automated DCM specification
Dear Dr Zeidman,
I would like to know if there's a way to specify multiple DCM models for multiple subjects using a batch or script so that my model space would be complete/exhaustive.
Clicking those buttons using GUI is really excruciating and prone to error...
My hypothesis is that the driving input must be pointed at node C. While all three nodes A, B, C are bilaterally intrinsically connected, the modulatory input can be absent, feedforward, feedbackward or bidirectional between any nodes.
I've attached a figure for illustration. I've 34 subjects and already extracted VOIs from all of them.
So I guess I have 4 x 4 x 4 x 34 = 2176 models.
I came across with this script, http://www.fil.ion.ucl.ac.uk/spm/data/attention/dcm_spm8_batch.m
But I don't know how to apply it to my case... I would be really grateful if you could help.
Thank you so much for your advice.
Best,
Andy
---------- Forwarded message ----------
From: Andy Yeung <[log in to unmask]>
Date: Thu, Oct 15, 2015 at 7:07 AM
Subject: Re: [SPM] Automated DCM specification
To: "Arash Z. Sadeghi" <[log in to unmask]>
Cc: SPM <[log in to unmask]>Thank you Arash for suggesting writing a code for a single subject.
I'm no good at coding. Is there a template available in SPM or online?
Best,
Andy
On Wed, Oct 14, 2015 at 7:22 PM, Arash Z. Sadeghi <[log in to unmask]> wrote:
Hi,
If you mean specifying DCMs for a group, first you have to specify DCMs for a single subject and there is a code to automatically specify those for the whole group.
If you mean specifying DCMs for a single subject, just write a code to change the matrices and rename the mat file. It will work fine.
Best,
On Wed, Oct 14, 2015 at 1:19 PM, Andy Yeung <[log in to unmask]> wrote:
Dear all SPM users,
May I know if there's a script/method to create all/multiple possible DCMs in an automated way instead of clicking the small buttons in DCM GUI? I'm afraid of clicking the wrong buttons or naming the DCM files wrongly.
I have 3 nodes (A, B, C), all bilateral intrinsic connections, node A receiving driving input.
But the modulatory input can insert in various plausible connections.
Best,
Andy
--
Arash Z. Sadeghi
PHD candidate of Biomedical Engineering
Tehran University of Medical SciencesResearcher in Imam Hospital, Imaging Center, NIAG.