help
help > RE: Mismatched dimensions of 1st-level covariates
Mar 10, 2022 01:03 AM | Alfonso Nieto-Castanon - Boston University
RE: Mismatched dimensions of 1st-level covariates
Hi Suneel
Could you please clarify what you mean by "the SPM condition was applied to the wrong Session"? My impression is that, irrespective of how the sessions are ordered, the fMRIprep import procedure should always maintain the correct association between the functional files and their associated conditions and covariates (e.g. perhaps for one subject session1 is task and session2 is rest while for another session1 is rest and session2 is task, but that association should be correctly encoded by the information in the Setup.Conditions tab, not by the order of the runs/sessions, and in all cases the session1 covariates should be associated with the session1 functionals -irrespective of what condition that session1 represents-). Please let me know if that was not the case in your experience.
Best
Alfonso
Originally posted by Suneel Banerjee:
Could you please clarify what you mean by "the SPM condition was applied to the wrong Session"? My impression is that, irrespective of how the sessions are ordered, the fMRIprep import procedure should always maintain the correct association between the functional files and their associated conditions and covariates (e.g. perhaps for one subject session1 is task and session2 is rest while for another session1 is rest and session2 is task, but that association should be correctly encoded by the information in the Setup.Conditions tab, not by the order of the runs/sessions, and in all cases the session1 covariates should be associated with the session1 functionals -irrespective of what condition that session1 represents-). Please let me know if that was not the case in your experience.
Best
Alfonso
Originally posted by Suneel Banerjee:
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!
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
Title | Author | Date |
---|---|---|
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 | |