help > RE: second-level analyses using existing connectivity matrices in CONN
May 24, 2023  09:05 PM | Alfonso Nieto-Castanon - Boston University
RE: second-level analyses using existing connectivity matrices in CONN
Hi Warren,


I believe there may be a couple of different issues here:

1) the data in the allsub*.nii file does not appear to be concatenated correctly. For example if you run:

   [a,b]=conn_mtx_read('allsubses01ses02_threedim_connmat.mat.nii');
   figure;
   imagesc(a(:,:,1))

that should display the 400x400 connectivity matrix for subject #1 session #1, but the resulting plot does not show the expected diagonal 1's matrix. This probably indicates that the data was likely concatenated across the wrong dimension, when combining the matrices across all subjects and sessions. Perhaps relatedly it is unclear how the 23 subjects (14 in group 1 and 9 in group 2) got transformed into 48 elements in this file (combining 23 subjects and 2 sessions)

and 2) If I am interpreting correctly your design matrix should be a [23 x 2] matrix, instead of the [48 x 1] vector that you are currently entering in the 'design_matrix' field. I would try the syntax:

X = [1 0;1 0;1 0;1 0;1 0;1 0;1 0;1 0;1 0;1 0;1 0;1 0;1 0;1 0;0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1;0 1];  % design matrix (e.g. #subjects x #groups) 

conn_module('GLM',...
   'design_matrix', X, ...
   'data',{'allsubses01ses02_threedim_connmat.mat.nii'},...
   'contrast_between',[-1 1],...
   'contrast_within',[-1 1]);



Hope this helps
Alfonso
Originally posted by Warren Logge:
Hi there,

I'm trying to use CONN to analyse post-processed ROI-to-ROI connectivity matrices that were processed using xcp-d (processed using fmriprep pre-processed data). 

I've followed the strategy supplied in this previous post (https://www.nitrc.org/forum/message.php?...) as best I could. 

1. I've converted the matrix data of 23 subjects in two groups (treatmentgp 1 = 14; treatmentgp 2 =9) with 2 sessions (pre-treatment = ses-01/post-treatment = ses-02), so that each subject has two 400x400 matrices (based on the Schaefer atlas) which I concatenated into a 4D array using 

conn_mtx_write

which created a 400:400:48 4D array (:,:,1 to :,:,24 were all subjects ses-01, :,:,25 to :,:,48 were all subjects ses-02)

2. I then attempted to conduct the group-level analyses with the following script    


conn_module('GLM',...
'design_matrix',[1;0;1;0;1;0;0;1;1;0;1;0;0;1;0;1;1;0;1;0;1;0;1;0;1;0;0;1;0;1;1;0;0;1;0;1;1;0;0;1;1;0;0;1;1;0;0;1;],...
'data',{'allsubses01ses02_threedim_connmat.mat.nii'},...
'contrast_between',[-1 1],...
'contrast_within',[-1 1]);

but it ran into an error - I'm guessing that my contrasts are incorrect, and/or there is an issue reading my 4D nifti file. 

Here was the output
conn_module options:
design_matrix: [48×1 double]
data: {'allsubses01ses02_threedim_connmat.mat.nii'}
contrast_between: [-1 1]
contrast_within: [-1 1]

Error using conn_module (line 655)
mismatch number of columns in #contrast_within (2) and number of measures in #data (1)

I want to evaluate the differences between the two treatment groups (between contrast), and differences between the sessions (within contrast); I also want to examine the interaction but I haven't built it up so far yet as I'm having issues at the main effects stage.

Any assistance appreciated - I've attached a zip of the nifti and json files created through conn_write_mtx as well 

Thanks in advance,

Best
Warren

Threaded View

TitleAuthorDate
Warren Logge May 19, 2023
RE: second-level analyses using existing connectivity matrices in CONN
Alfonso Nieto-Castanon May 24, 2023
Warren Logge May 25, 2023