help > RE: Design setup for multi-session experiment
Feb 11, 2017  01:02 AM | Alfonso Nieto-Castanon - Boston University
RE: Design setup for multi-session experiment
Hi Nicole,

First, regarding importing SPM.mat files, if you are using the latest CONN release it should allow you to simply enter multiple SPM.mat files for each subject. Each of the individual SPM.mat files may define a single or multiple sessions. In Setup.Import, simply select each subject in the 'subjects' list, and then select all of the SPM.mat files associated with that subject and click 'select' to import all of those files simultaneously. From your description it is likely that only the first subject data and conditions were imported, leaving the rest of your subjects without any info.

In any way, since this is likely a bit tedious and error-prone (and later you would have to manually edit the condition info anyway to define your desired 9 conditions from the three conditions defined in those SPM.mat files) I would recommend using instead a short script like the following: (note: here I am assuming your SPM.mat files are organized in folders of the form /data/subject#/session#/SPM.mat, modify the code to reflect your actual folder structure):

spmfiles={};
for nsub=1:15, % number of subjects
   for nses=1:6, % number of sessions
     spmfiles{nsub}{nses}=sprintf( '/data/subject%d/session%d/SPM.mat' , nsub , nses); % location of SPM.mat file
   end
end
conn_importspm( spmfiles, 'breakconditionsbysession');

That will import all of the condition info into your current CONN project and it will also break down the three conditions defined in those SPM.mat files (rest/0-back/2-back) by session, so you end up directly with your 18 conditions.

Let me know if you run into any issues
Best
Alfonso

Originally posted by Nicole Nissim:
Thank you for your reply, Alfonso.

I tried this and have another question about the setup -  I created a new experiment with N=16 subjects and I set up 6 runs per subject. It was randomized at which visit subjects received active v sham stimulation, but I added the first 3 sessions to always correspond to active stimulation (pre, during, and post) and the last 4-5-6 to correspond with sham (pre, during, and post).
I had 6 SPM.mat files per person (one for each run) and in one single file it had the timing info for 2-Back, 0-Back, and rest. When I tried to import the SPM.mat file for each subject, it would not allow me to import all 6 at once per person, and replicated the first SPM file into the other sessions, so I copied the timing info in for each session separately.

When I defined the conditions, I defined all 18 conditions, the first session corresponding to:
ses1
pre-active rest,
pre-active 0-back
pre-active 2-back
ses2
during-active rest
during-active 0-back
during-active 2-back
ses3
post-active rest
post-active 0-back
post-active 2-back
... and so on for all the sham ses4, 5, 6 conditions.
For the sessions that did not apply to the conditions, I did not fill any timing information in but kept kept [] in place.
Preprocessing completed with no errors. When I moved on to click done in set-up, to move into the denosing step, it pointed out there was missing data. In the 2nd-level conditions tab, I found that there was no data in the scrubbing tab, for all subjects (except subject 1).
Do you have any idea why these files were not created? Also, is there a better way to import timing files for multiple sessions, or should I have created the SPM.mat files differently?

Thank you for your help! 

-Nicole

Threaded View

TitleAuthorDate
Nicole Nissim Jan 26, 2017
Alfonso Nieto-Castanon Jan 27, 2017
Nicole Nissim Jun 21, 2017
Nicole Nissim Feb 10, 2017
RE: Design setup for multi-session experiment
Alfonso Nieto-Castanon Feb 11, 2017