help > Mismatched dimensions of 1st-level covariates
Feb 22, 2022  08:02 PM | Suneel Banerjee
Mismatched dimensions of 1st-level covariates
Hi Alfonso,

I have recently imported a multimodal dataset from fMRIprep into CONN along with corresponding SPM.mat files to import the conditions. There was an issue where the SPM condition was applied to the wrong 'Session' within CONN, but I was able to fix this with the following script. I have 174 subjects and this incorrect assignment begins on the 91st, and there are 44 covariates from fMRIprep. 

%reorder sessions

for i = 91:174
y= CONN_x.Setup.functional{1,i};
y = flip(y);
CONN_x.Setup.functional{1,i} = y;
end

%reorder covariates

for j = 91:174
for h = 1:44
m = CONN_x.Setup.l1covariates.files{1,j}{1,h};
m = flip(m);
CONN_x.Setup.l1covariates.files{1,j}{1,h} = m;
end
end


Afterwards, I was able to see in the 'Setup' tab that the SPM conditions were applied to the correct Sessions, and that each session contained the correct functional scan (task or rest). For subject 91 below, I am attaching a screenshot of Session 1, the 'task' session. My understanding is that Session 1 contains the correct functional volume with 838 scans. When attempting to run the Setup step, I get the following error for each 1st level covariate and each subject after 91. 

ERROR DESCRIPTION:

ERROR: Subject 91 Session 1 first-level covariate realignment mismatched dimensions (838 rows, while functional data has 266 scans; the number of rows of a first-level covariate should equal the number of scans for this subject/session)


It seems that somewhere, the batch file still has the sessions flipped. As always, your help would be sincerely appreciated. Thanks so much in advance!

Threaded View

TitleAuthorDate
Mismatched dimensions of 1st-level covariates
Suneel Banerjee Feb 22, 2022
Alfonso Nieto-Castanon Mar 10, 2022
Suneel Banerjee May 21, 2022
Suneel Banerjee Apr 26, 2022
Suneel Banerjee Mar 2, 2022