Dear Benedetta,

I wrote this specifically for someone who had identical input timing for each subject. Is that the case for you?

 

Best,

Peter

 

From: SPM (Statistical Parametric Mapping) [mailto:[log in to unmask]] On Behalf Of Benedetta Vai
Sent: 16 October 2015 19:22
To: [log in to unmask]
Subject: Re: [SPM] Automated DCM specification

 

Dear Peter and Andy,

 

thanks for the script.

 

I have just used it and no problem in specifying models.

Actually, when I try to estimate them from the GUI, or with a script, I have this error message.

 

Warning: Convergence failure - invoking keyboard. 

> In spm_nlsi_GN at 371

  In spm_dcm_estimate at 230

  In spm_dcm_ui at 144

 

I tried to specifying part of the same model space with the GUI and no problem in estimating the models. 

 

The automated specification would help me a lot. Is there anything that I can do to fix this problem? 

 

Best,

Benedetta

 

 

Benedetta Vai, PhD Student

 

Experimental Psychologist

Libera Università Maria S.S. Assunta

Scientific Institute Ospedale San Raffaele

Department of Clinical Neurosciences

 

E-mail: [log in to unmask]

             [log in to unmask]        


Date: Fri, 16 Oct 2015 19:17:42 +0800
From: [log in to unmask]
Subject: 
To: [log in to unmask]

Thanks Peter! I start estimating the models, hopefully it's done after this weekend.

 

On Fri, Oct 16, 2015 at 7:15 PM, Zeidman, Peter <[log in to unmask]> wrote:

Perfect J

 

From: Andy Yeung [mailto:[log in to unmask]]
Sent: 16 October 2015 12:03


To: Zeidman, Peter <[log in to unmask]>
Cc: [log in to unmask]
Subject: Re: [SPM] Automated DCM specification

 

 

So I have 2 regressors, I said yes and yes, and 1st regressor is driving while 2nd is modulatory.

I'm correct to type idx = 2?

 

Best,

Andy

 

On Fri, Oct 16, 2015 at 6:55 PM, Zeidman, Peter <[log in to unmask]> wrote:

Great! And just to be clear – idx = 2 if it’s the second input you said “Yes” to, which you can confirm using by typing DCM.U.name.

 

Best,

P

 

From: Andy Yeung [mailto:[log in to unmask]]
Sent: 16 October 2015 11:29


To: Zeidman, Peter <[log in to unmask]>
Cc: [log in to unmask]
Subject: Re: [SPM] Automated DCM specification

 

Dear Peter,

 

Thank you for your help. There's no error now, and my idx = 2 (because my modulatory input is represented by the 2nd column in design matrix).

I can generate 64 models for each subject as you designed. Thanks a lot!!

 

Best,

Andy

 

On Fri, Oct 16, 2015 at 5:35 PM, Zeidman, Peter <[log in to unmask]> wrote:

Dear Andy,

When you specified your DCM, you were asked to choose the inputs for your DCM – “Yes” or “No” for each column in your design matrix. These inputs were placed, in order, in the DCM. When you look at the b-matrix (a matrix called DCM.b), you will find it is of size [n x n x j], where ‘n’ is the number of regions and j is the input. Element DCM.b(x,y,j) indicates whether modulatory input j influences the connection from y to x.

 

The variable in the script asks which input, j, you wish to vary across subjects. To find out the order of inputs in your model, load the model into the Matlab workspace, then type:

 

DCM.U.name

 

As for the error message, it seems you have an old version of this function – a relevant change to it was made in 2014. I’ve updated your script, attached, to make it backward-compatible with this older version.

 

Best,

Peter.

 

From: Andy Yeung [mailto:[log in to unmask]]
Sent: 16 October 2015 09:27


To: Zeidman, Peter <[log in to unmask]>
Cc: [log in to unmask]
Subject: Re: [SPM] Automated DCM specification

 

Dear Peter,

 

Thank you so much for your script.

What do you mean by "input number within the B-matrix"? I did not touch/ arbitrarily changed the number, and the error message popped out after I chose VOIs following the order chosen for the template DCM.

 

Error using spm_dcm_voi

Too many output arguments.

 

Error in duplicate_dcms (line 57)

    DCM = spm_dcm_voi(DCM_template,subject_vois);

 

Best,

Andy

 

On Fri, Oct 16, 2015 at 3:25 PM, Zeidman, Peter <[log in to unmask]> wrote:

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.

 

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 Sciences

Researcher in Imam Hospital, Imaging Center, NIAG.