help > Concatenation problem (spm_fmri_concatenate)
Showing 1-8 of 8 posts
Display:
Results per page:
Aug 14, 2017  09:08 AM | Dmit Filin
Concatenation problem (spm_fmri_concatenate)
Dear gPPI users,

I have 2 sessions with 3 conditions. In the session#1 there are conditionA1, conditionB1, conditionC1. In in the session#2 there are conditionA2, condtitionB2, conditionC2. I want to compare conditions: A1 vs A2, B1 vs B2, C1 vs C2.

1) When I use one SPM model with two sessions gPPI works properly. Should I use P.ConcatR=1 if I have >40 trial by condition? (manual says: "use concatenated approach to deal with low # trials (<10 events)/event type").

For this SPM model: "nscans = [450 470]" and "Sess=[1x2 struct]".

2) When I use one SPM model with concatenated sessions gPPI gives me this error message:

"VOI has 7 voxels in 3x3x3 space. This is in the the same space as the input data and functional mask.
ERROR: VOI timeseries is not the correct size. Must either be N same size as SPM.nscan or SPM.nscan*NT"

To concatenate two sessions I changed the onsets and rp*.txt files. And also I used this function:
"scans = [450 470];
spm_fmri_concatenate('SPM.mat', scans);"

It made two Constant regressors for two sessions.
According to the description of this function: "This will change your GLM in several respects. It will replace the usual mean column in the design matrix with regressors modelling each session - you can check this using the 'Review' button in the main SPM window. It will also correct the high-pass filter and temporal non-sphericity calculations to account for the original session lengths."

But after "spm_fmri_concatenate" gPPI doesnt work properly.

For this new SPM model: "nscans = [450 470]" and "Sess=[1x1 struct]".

When I change in SPM.mat "nscan" from [450 470] to [920] gPPI works well. But in the gPPI model I can see only one Constant regressor instead of two.

As I can understand the problem is in Sess=[1x1 struct]. How to solve this problem?

Thank you in advance
Aug 24, 2017  01:08 PM | Haeme Park
Following up on this problem
Hi Dmit,

I was wondering if you've solved your problem at all as I have exactly the same question! Otherwise, if anyone else has any ideas on how to get around this problem (changing 'nscans' to the total number of scans to make gPPI work results in one constant regressor, when multiple constants are needed to define the concatenated sessions), it would be greatly appreciated if you could share.
Thank you!
Aug 24, 2017  01:08 PM | Donald McLaren
RE: Concatenation problem (spm_fmri_concatena
See inline responses below.
Originally posted by Dmit Filin:
Dear gPPI users,

I have 2 sessions with 3 conditions. In the session#1 there are conditionA1, conditionB1, conditionC1. In in the session#2 there are conditionA2, condtitionB2, conditionC2. I want to compare conditions: A1 vs A2, B1 vs B2, C1 vs C2.

1) When I use one SPM model with two sessions gPPI works properly. Should I use P.ConcatR=1 if I have >40 trial by condition? (manual says: "use concatenated approach to deal with low # trials (<10 events)/event type").

RESPONSE: There is no need to concatenate the model in your case.

For this SPM model: "nscans = [450 470]" and "Sess=[1x2 struct]".

2) When I use one SPM model with concatenated sessions gPPI gives me this error message:

"VOI has 7 voxels in 3x3x3 space. This is in the the same space as the input data and functional mask.
ERROR: VOI timeseries is not the correct size. Must either be N same size as SPM.nscan or SPM.nscan*NT"

To concatenate two sessions I changed the onsets and rp*.txt files. And also I used this function:
"scans = [450 470];
spm_fmri_concatenate('SPM.mat', scans);"

It made two Constant regressors for two sessions.
According to the description of this function: "This will change your GLM in several respects. It will replace the usual mean column in the design matrix with regressors modelling each session - you can check this using the 'Review' button in the main SPM window. It will also correct the high-pass filter and temporal non-sphericity calculations to account for the original session lengths."

But after "spm_fmri_concatenate" gPPI doesnt work properly.

For this new SPM model: "nscans = [450 470]" and "Sess=[1x1 struct]".

When I change in SPM.mat "nscan" from [450 470] to [920] gPPI works well. But in the gPPI model I can see only one Constant regressor instead of two.

As I can understand the problem is in Sess=[1x1 struct]. How to solve this problem?

>> The solution to this problem is not to concatenate the first level model, but to use the 2 session SPM model and have gPPI do the concatenation on its own. Otherwise the input fields aren't correct.


Thank you in advance
Aug 24, 2017  01:08 PM | Donald McLaren
RE: Following up on this problem
The solution to this problem is not to concatenate the first level model, but to use the 2 session SPM model and have gPPI do the concatenation on its own. Otherwise the input fields aren't correct.
Aug 24, 2017  02:08 PM | Dmit Filin
RE: Following up on this problem
Thanks for the answer, Dr. McLaren!

But what should I do if in the next study I need to concatenate the sessions?

Maybe I should not use "spm_fmri_concatenate.mat", but, for example, add a block regressors for sessions with 1 and 0 values as it is done in the SPM manual (page 330)? 
Or are there other common ways of concatenating sessions for further gPPI analysis?
Aug 24, 2017  03:08 PM | Donald McLaren
RE: Following up on this problem
Hi Dmit,

You should not use spm_fmri_concatenate.mat. gPPI wasn't built to use modified SPM.mat files.

Rather, start with your unconcatenated first level SPM model, run it through gPPI P.ConcatR=1, and it will concatenate the model properly for you at the PPI step.

Best,
Donald
Aug 24, 2017  03:08 PM | Dmit Filin
RE: Following up on this problem
Thank you very much, Dr. McLaren!
Jan 25, 2021  02:01 PM | Robin P
RE: Concatenation problem (spm_fmri_concatenate)
Originally posted by Dmit Filin:

To concatenate two sessions I changed the onsets and rp*.txt files. And also I used this function:
"scans = [450 470];
spm_fmri_concatenate('SPM.mat', scans);"


Dear Dmit,

i would like to know how you changed the onsets and rp*.txt files. I'm quite new to SPM and want to use spm_fmri_concatenate('SPM.mat', scans). 

Thanks in advance!