JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for SPM Archives


SPM Archives

SPM Archives


SPM@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

SPM Home

SPM Home

SPM  July 2013

SPM July 2013

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: DCM.U.dt = SPM.Sess.U(1).dt;

From:

"Zeidman, Peter" <[log in to unmask]>

Reply-To:

Zeidman, Peter

Date:

Fri, 26 Jul 2013 09:38:12 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (1 lines)

I would recommend going through the DCM tutorial in the SPM manual on the SPM website, its about page 300.



Quick explanations:



> when I extract VOI's, I am asked for 'Adjust data','Which session' and

> 'Expression' in GUI and Batch.

> 1) What does it mean by adjust data? Is it trying to adjust data across

> all the four sessions (my experiment has four sessions).



This lets you mean correct the timeseries, excluding movement and other nuisance regressors from the extacted ROI.



To use this you create an F-contrast, called the 'effects of interest' contrast, which gives the effects of all your experimental conditions. When creating it, set its matrix to be the identity matrix, with 1's in the columns which are of interest to your results (i.e. not the movement parameters and any other nuisance regressors).



> 2) Rather than 'Which session', Can I do it over all the sessions.

> Because i am looking for effect of a condition which is basically based

> on activation from sum of all four sessions. My activation list is from

> t-contrast.



No. You either extract separate ROIs for each session, and therefore create separate models per session, or prior to making your design matrix, you concatenate all your sessions together into one big session, with extra regressors to handle inter-session differences (search the mailing list for how to do this). If you have enough trials per session, I'd strongly recommend separate models per session.



> 3) Why does it asks for 'Expression'?



This lets you combine ROIs. For example, if you wants activations from your SPM and that also fall within an 8mm sphere, you specify these in the batch and put i1 && i2.



Best,

Peter



> 

> I figured this VOI issue which i was mentioning DCM.U.dt file as they

> are based of SPM.Sess. Please let me know

> 

> 

> 

> Thanks

> 

> ----- Original Message -----

> From: "Peter Zeidman" <[log in to unmask]>

> To: "Kushal Kapse" <[log in to unmask]>

> Cc: [log in to unmask]

> Sent: Thursday, July 25, 2013 10:48:14 AM

> Subject: RE: DCM.U.dt   =  SPM.Sess.U(1).dt;

> 

> Regarding your question about the meaning of the fields in DCM.U...

> 

> DCM.U.dt - In your experiment you may only get a volume every 2 or 3

> seconds, but in DCM we want to model a finer time resolution than this.

> So the software splits each of your volumes into a number of time bins

> (giving us 'microtime'). So for example, if you want 16 time bins per

> volume, then dt = 1/16 = 0.0625 .

> 

> DCM.U.u - Your input regressor(s), e.g. timecourse of a stimulus

> switching on and off, in microtime, i.e. using the above dt.

> 

> 

> OK, so the key part of the error is:

> 

> > DCM.U.dt   =  SPM.Sess.U(1).dt;

> >

> > ??? Reference to non-existent field 'U'.

> 

> This tells you that either DCM.U or SPM.Sess.U does not exist, when it

> is expected to. The latter is the more likely cause. So, here's what to

> investigate...

> 

> If you look at the SPM structure loaded into the workspace, has it got

> a structure within that called Sess, and a structure within that called

> U? If not, then SPM is not an estimated model created with SPM version

> 8 or above. Did you script the creation of the SPM structure too or use

> the GUI?

> 

> Best,

> P.

> 

> > -----Original Message-----

> > From: Kushal Kapse [mailto:[log in to unmask]]

> > Sent: 25 July 2013 15:15

> > To: Zeidman, Peter

> > Cc: [log in to unmask]

> > Subject: Re: DCM.U.dt = SPM.Sess.U(1).dt;

> >

> > Hi Peter,

> >

> > Thanks for your reply. I am using the same dcm__spm8_batch script to

> > run my DCM experiment. I did make one model in GUI and went into

> > workspace to understand how DCM.U is defined. Following is what my

> > error states and below that is what my model (which i made in GUI and

> > then looked into workspace) looks like. I am not able to understand

> > what the workspace structure of DCM.U means. Please take a look below

> > and let me know where am I wrong.

> >

> > ERROR----------------------------------------------------------------

> -

> > -

> > -----------------------------------------------------------------

> >

> >

> > ??? Field reference for multiple structure elements that is followed

> > by more reference blocks is an error.

> >

> > Error in ==> script at 80

> > DCM.U.dt   =  SPM.Sess.U(1).dt;

> >

> > ??? Reference to non-existent field 'U'.

> >

> > DCM.U structure--------------------------% this is when i did one

> > model in GUI and checked it in workspace

> >

> >

> > DCM.U <1x1 struct>

> > dt    0.1563          % i didnt understand where this number comes

> from

> > name  <1x1 cell>      %this is my condition called pictures

> > u     <1808x1 double> % i didnt understand this at all

> > (124,1) 1

> > .

> > .

> > .

> > .

> > (1747x1) 1

> >

> > ---------------------------------------------------------------------

> -

> > -

> > ---------------------------------------------------------------------

> -

> >

> > my doubts:

> >

> > 1- i theoretically understand that dt is time bin (sec), but how is

> it

> > calculated? How can i calculate that specifically for my experiment

> > 2- DCM.U.u is stimulus function matrix. But where does those matrix

> > numbers come from

> >

> > I am changing the dcm_spm8_batch.m script starting from extracting

> > VOI's. Following is the script where i have made the changes so far.

> >

> > -------------------------------Changes made to dcm__spm8_batch.m for

> > replicating my

> > experiment----------------------------------------------

> > ---

> >

> >

> >

> > % Directory containing the attention data

> > %--------------------------------------------------------------------

> -

> > -

> > ----

> > data_path='Z:\datapath\';

> >

> > % Initialise SPM

> > %--------------------------------------------------------------------

> -

> > -

> > ----

> > spm('Defaults','fMRI');

> > spm_jobman('initcfg');

> > spm_get_defaults('cmdline',1);

> >

> >

> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

> > %

> > %%%%

> > % VOLUMES OF INTEREST

> >

> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

> > %

> > %%%%

> >

> > % EXTRACTING TIME SERIES: A

> > %--------------------------------------------------------------------

> -

> > -

> > ----

> > clear matlabbatch

> > matlabbatch{1}.spm.util.voi.spmmat =

> > cellstr(fullfile(data_path,'SPM.mat'));

> > matlabbatch{1}.spm.util.voi.adjust = 0;  % "effects of ...."

> > F-contrast matlabbatch{1}.spm.util.voi.session = 1; % session 1

> > matlabbatch{1}.spm.util.voi.name = 'A';

> > matlabbatch{1}.spm.util.voi.roi{1}.spm.spmmat = {''}; % using SPM.mat

> > above matlabbatch{1}.spm.util.voi.roi{1}.spm.contrast = 3;  % "pic

> > minus scrambled" T-contrast

> > matlabbatch{1}.spm.util.voi.roi{1}.spm.threshdesc = 'none';

> > matlabbatch{1}.spm.util.voi.roi{1}.spm.thresh = 0.001;

> > matlabbatch{1}.spm.util.voi.roi{1}.spm.extent = 0;

> > matlabbatch{1}.spm.util.voi.roi{2}.sphere.centre = [-63 -27 21] %

> > arbitrary matlabbatch{1}.spm.util.voi.roi{2}.sphere.radius = 5;

> > %matlabbatch{1}.spm.util.voi.roi{2}.sphere.move.global.spm = 1; %

> > global max

> %matlabbatch{1}.spm.util.voi.roi{2}.sphere.move.global.mask

> > = ''; % none matlabbatch{1}.spm.util.voi.expression = 'i1 & i2';

> > spm_jobman('run',matlabbatch);

> >

> > % EXTRACTING TIME SERIES: B

> > %--------------------------------------------------------------------

> -

> > -

> > ----

> > clear matlabbatch

> > matlabbatch{1}.spm.util.voi.spmmat =

> > cellstr(fullfile(data_path,'SPM.mat'));

> > matlabbatch{1}.spm.util.voi.adjust = 0;  % "effects of ...."

> > F-contrast matlabbatch{1}.spm.util.voi.session = 2; % session 1

> > matlabbatch{1}.spm.util.voi.name = 'B';

> > matlabbatch{1}.spm.util.voi.roi{1}.spm.spmmat = {''}; % using SPM.mat

> > above matlabbatch{1}.spm.util.voi.roi{1}.spm.contrast = 3;  % "pic

> > minus scrambled" T-contrast

> > matlabbatch{1}.spm.util.voi.roi{1}.spm.thresh = 0.001;

> > matlabbatch{1}.spm.util.voi.roi{1}.spm.extent = 0;

> > matlabbatch{1}.spm.util.voi.roi{2}.sphere.centre = [21 -6 42] %

> > arbitrary matlabbatch{1}.spm.util.voi.roi{2}.sphere.radius = 5;

> > %matlabbatch{1}.spm.util.voi.roi{2}.sphere.move.global.spm = 1; %

> > global max

> %matlabbatch{1}.spm.util.voi.roi{2}.sphere.move.global.mask

> > = ''; % none matlabbatch{1}.spm.util.voi.expression = 'i1 & i2';

> > spm_jobman('run',matlabbatch);

> >

> >

> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

> > %

> > %%%%

> > % DYNAMIC CAUSAL MODELLING

> >

> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

> > %

> > %%%%

> >

> > clear DCM

> >

> > % SPECIFICATION DCM "A to B"

> > %--------------------------------------------------------------------

> -

> > -

> > ----

> > load(fullfile(data_path,'SPM.mat'));

> >

> > load(fullfile(data_path,'VOI_A_1.mat'),'xY');

> > DCM.xY(1) = xY;

> > load(fullfile(data_path,'VOI_B_1.mat'),'xY');

> > DCM.xY(2) = xY;

> >

> > DCM.n = length(DCM.xY);      % number of regions

> > DCM.v = length(DCM.xY(1).u); % number of time points

> > matlabbatch{1}.spm.stats.fmri_spec.timing.RT    = 2.5;

> > DCM.Y.dt  = SPM.xY.RT;

> > DCM.Y.X0  = DCM.xY(1).X0;

> > for i = 1:DCM.n

> >     DCM.Y.y(:,i)  = DCM.xY(i).u;

> >     DCM.Y.name{i} = DCM.xY(i).name;

> > end

> >

> > DCM.Y.Q    = spm_Ce(ones(1,DCM.n)*DCM.v);

> >

> >

> > DCM.U.dt   =  SPM.Sess.U(1).dt;

> > DCM.U.name = [SPM.Sess.U.name(1)];

> > DCM.U.u    = [SPM.Sess.U(1).u(33:end,1)];

> >

> > DCM.delays = repmat(SPM.xY.RT,2,1);

> > DCM.TE     = 0.04;

> >

> > DCM.options.nonlinear  = 0;

> > DCM.options.two_state  = 0;

> > DCM.options.stochastic = 0;

> > DCM.options.nograph    = 1;

> >

> > DCM.a = [1 1; 1 1];

> > DCM.b = zeros(2,2);  DCM.b(1,1) = 1;  DCM.b(1,1) = 0; DCM.c = [0

> > 0;1,0]; DCM.d = zeros(2,2);

> >

> > save(fullfile(data_path,'model-1.mat'),'DCM');

> >

> >

> > % SPECIFICATION DCM "B to A"

> > %--------------------------------------------------------------------

> -

> > -

> > ----

> > DCM.b = zeros(2,2);  DCM.b(1,1) = 0;  DCM.b(1,1) = 1; DCM.c = [1

> > 0;0,0] save(fullfile(data_path,'model-2.mat'),'DCM');

> >

> > % ESTIMATION

> > %--------------------------------------------------------------------

> -

> > -

> > ----

> > DCM_model1 = spm_dcm_estimate(fullfile(data_path,'model-1.mat'));

> > DCM_model2 = spm_dcm_estimate(fullfile(data_path,'model-2.mat'));

> >

> >

> >

> > Please advice me on how to understand DCM.U structure and where am i

> > misleading so that i can make those changes.

> >

> >

> > Thanks a lot

> >

> >

> >

> > ----- Original Message -----

> > From: "Peter Zeidman" <[log in to unmask]>

> > To: "Kushal Kapse" <[log in to unmask]>

> > Cc: [log in to unmask]

> > Sent: Thursday, July 25, 2013 5:29:25 AM

> > Subject: RE: DCM.U.dt   =  SPM.Sess.U(1).dt;

> >

> > Dear Kushal,

> > Sorry, I don't fully understand the problem you're facing.

> >

> > It seems you're trying to create a DCM by writing a script. I suggest

> > you look at the example script at:

> >

> > http://www.fil.ion.ucl.ac.uk/spm/data/attention/dcm_spm8_batch.m

> >

> > Alternatively, if you're unsure of the format to use DCM.U, I suggest

> > generating a DCM model using the GUI, then loading it into the Matlab

> > workspace and having a look at what's inside it.

> >

> > Feel free to ask again if you're still stuck.

> >

> > Best,

> > Peter.

> >

> > > -----Original Message-----

> > > From: Kushal Kapse [mailto:[log in to unmask]]

> > > Sent: 24 July 2013 22:38

> > > To: Zeidman, Peter

> > > Cc: [log in to unmask]

> > > Subject: DCM.U.dt = SPM.Sess.U(1).dt;

> > >

> > > Hi peter and other SPM users,

> > >

> > > I am going through same issue for DCM. But my experiment is

> > different.

> > > I am not able to understand how would i change code(see below), for

> > my

> > > experiment. I went through spm_get_ons.m and spm_dcm_estimate.m to

> > > figure this out. but wasnt successful.

> > >

> > > DCM.U.dt   =  SPM.Sess.U(1).dt;

> > > DCM.U.name = [SPM.Sess.U.name(1)];

> > > DCM.U.u    = [SPM.Sess.U(1).u(33:end,1)];

> > >

> > > I saw one more post on this which stated

> > > https://www.jiscmail.ac.uk/cgi-

> > >

> >

> bin/webadmin?A2=ind1004&L=SPM&F=&S=&X=61A0FC0F022B49A505&Y=analysisthr

> > > e

> > > ad%40gmail.com&P=580450

> > >

> > > "The DCM.U.u field contains the inputs (i.e., input vectors and

> > > modulatory vectors resampled into microtime). Microtime is the

> > > number of bins each TR is split into, and is specified by

> > > defaults.stats.fmri.fmri_t. The offset is specified in spm_get_ons.

> > > See around line 238. Therefore, if you you are using a design that

> > has

> > > been setup by SPM, you should index it exactly as shown in the code

> > > you listed below: SPM.Sess.U(k).u(33:end,1) and so on, where k =

> > > condition you are indexing."

> > >

> > >

> > > BUT, I am still not able to figure out how i change those three

> > > lines for my experiment.

> > > I am changing the SPM-DCM code for first time for my experiment and

> > > hence if anyone of you guys can give me feedback on this, it would

> > > be helpful.

> > >

> > >

> > > Thanks in advance

> > > Kushal

> > >

> > >

> > > ----- Original Message -----

> > > From: "Peter Zeidman" <[log in to unmask]>

> > > To: [log in to unmask]

> > > Sent: Monday, April 15, 2013 10:17:00 AM

> > > Subject: Re: [SPM] DCM - batch

> > >

> > > Hi Carmen,

> > > (I'm CC'ing the mailing list in case anyone else is following this

> > > question.)

> > >

> > > Your models are different because the one produced using the batch

> > > editor has mean-centring switched on, and the one using the GUI

> does

> > > not. Not only will this change your DCM.U.u (changing the mean to

> > > zero), but it also alters the interpretation of your DCM results.

> > > See the previous message I have pasted below from Karl.

> > >

> > > (I can't guarantee there are no other differences in your models,

> > > but that's the most obvious one!)

> > >

> > > All the best,

> > > Peter.

> > >

> > > ...

> > > If you centre the input, it will have a mean of zero. This means

> > > that the modulating input will increase and decrease the extrinsic

> > > connectivity (A parameter); as opposed to just increasing it, if

> the

> > > input is always positive. The interpretation of the B parameter

> > > therefore changes in a subtle way, and becomes closer to a

> classical

> > > interaction.

> > >

> > > I hope that this helps.

> > > With very best wishes,

> > > Karl

> > >

> > > > -----Original Message-----

> > > > From: SPM (Statistical Parametric Mapping)

> > > [mailto:[log in to unmask]]

> > > > On Behalf Of carmen

> > > > Sent: 15 April 2013 09:29

> > > > To: [log in to unmask]

> > > > Subject: [SPM] DCM - batch

> > > >

> > > > Dear SPM-list,

> > > > I still don’t understand what exactly DCM.U.u is and why the

> > > > values differ between a DCM-model created by GUI and the same

> > > > model

> > created

> > > > by the batch code. Probably resulting from the differences here,

> > the

> > > > values for DCM.Ep.A, DCM.Ep.B and DCM.Ep.C differ as well.

> > > > This is the code I use (model with 4 VOIs and two conditions as

> > > input):

> > > >

> > > >

> > >

> >

> load(fullfile('D:\fMRI\Cannabis\Auswertung_Cannabis\Drona_R30\DCM\DCM_

> > > > 3

> > > > \GLM','SPM.mat'));

> > > >

> > > >

> > >

> >

> load(fullfile('D:\fMRI\Cannabis\Auswertung_Cannabis\Drona_R30\DCM\DCM_

> > > > 3

> > > > \GLM','VOI_Thalamus_R_1.mat'),'xY');

> > > > DCM.xY(1) = xY;

> > > >

> > >

> >

> load(fullfile('D:\fMRI\Cannabis\Auswertung_Cannabis\Drona_R30\DCM\DCM_

> > > > 3

> > > > \GLM','VOI_S2_R_1.mat'),'xY');

> > > > DCM.xY(2) = xY;

> > > >

> > >

> >

> load(fullfile('D:\fMRI\Cannabis\Auswertung_Cannabis\Drona_R30\DCM\DCM_

> > > > 3

> > > > \GLM','VOI_Amygdala_L_1.mat'),'xY');

> > > > DCM.xY(3) = xY;

> > > >

> > >

> >

> load(fullfile('D:\fMRI\Cannabis\Auswertung_Cannabis\Drona_R30\DCM\DCM_

> > > > 3 \GLM','VOI_Hippocampus_R_1.mat'),'xY');

> > > > DCM.xY(4) = xY;

> > > >

> > > > DCM.n = length(DCM.xY);

> > > > DCM.v = length(DCM.xY(1).u);

> > > >

> > > > DCM.Y.dt  = SPM.xY.RT;

> > > > DCM.Y.X0  = DCM.xY(1).X0;

> > > > for i = 1:DCM.n

> > > >     DCM.Y.y(:,i)  = DCM.xY(i).u;

> > > >     DCM.Y.name{i} = DCM.xY(i).name; end

> > > >

> > > > DCM.Y.Q    = spm_Ce(ones(1,DCM.n)*DCM.v);

> > > >

> > > > DCM.U.dt   =  SPM.Sess.U(1).dt;

> > > > DCM.U.name = cellstr([SPM.Sess.U(1).name, SPM.Sess.U(2).name]);

> > > > DCM.U.u    = [SPM.Sess.U(1).u(33:end,1) ...

> > > >               SPM.Sess.U(2).u(33:end,1)];

> > > >

> > > > DCM.delays = repmat(SPM.xY.RT,DCM.n,1);

> > > > DCM.TE     = 0.04;

> > > >

> > > > DCM.options.nonlinear  = 0;

> > > > DCM.options.two_state  = 0;

> > > > DCM.options.stochastic = 0;

> > > > DCM.options.nograph    = 1;

> > > >

> > > > DCM.a = [1 0 0 0 ; 1 1 0 0 ; 1 1 1 0 ; 0 0 1 1 ]; DCM.b =

> > > > zeros(4,4,2);  DCM.b(3,1,2) = 1; DCM.c = [1 0 ; 0 0; 0 0; 0

> 0DCM.d

> > =

> > > > zeros(4,4,0);

> > > >

> > > >

> > >

> >

> save(fullfile('D:\fMRI\Cannabis\Auswertung_Cannabis\Drona_R30\DCM\DCM_

> > > > 3

> > > > \GLM','DCM_Model1_batch.mat'),'DCM');

> > > >

> > > >

> > > > Thanks a lot!!

> > >

> >

> 



Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager