help > conn_module & conn_display - scripting - error message - Incorrect dimensions for matrix multiplication.
Jul 20, 2022  04:07 PM | Ricardo Martins - University of Coimbra
conn_module & conn_display - scripting - error message - Incorrect dimensions for matrix multiplication.
Hi everyone,

I am using CONN v21a and trying to use the scripting functions to replicate and display using an ROI-to-ROI 2nd level analysis previously performed using the graphical user interface.

I am trying this as a first step to perform some 2nd level matrix analysis using the averaged (upper/lower triangle) ROI-to-ROI matrix .
By now I am testing the pipeline with a raw ROI-to-ROI matrix (without doing the averaged ROI-to-ROI matrix) to check if everything gives the same results as using the graphical user interface.

I'm following the steps described here
https://www.nitrc.org/forum/message.php?...

Step 1 and step 3 outputs the expected results/files. I have checked that the results stored in spmF_mv.nii are the same as the results presented by the graphical interface (without scripting).

However, the visualization of the results using the conn_module function or the conn_display function gives an error (see error message below)

60 participants (20 Group A, 20 Group B, 20 group C)

4 within subjects conditions


MY CODE/DESIGN:

X=zeros(60,3);
X(1:20,1)=1;
X(21:40,2)=1;
X(41:60,3)=1;

C=[1 -1 0; 0 -1 1];

M=[0.25 0.25 0.25 0.25];

conn_module( 'glm' , 'data', 'gPPI_average_ctrl_schz_bpld_social_noCovars_my.nii', 'design_matrix', X, 'contrast_between', C, 'contrast_within', M, 'folder', 'C:\Users\Ricardo\Desktop\out\script', 'data_labels',{'indifferent','linear','positive','negative'},'design_labels',{'CTRL','SCHZ','BPLD'});



The gPPI_average_ctrl_schz_bpld_social_noCovars_my.nii file is a 4D nifti file:38x38x1x240.





Do you have any suggestion regarding this error message related with the visualization of the results?
The results seem to be ok.



ERROR MESSAGE:

"Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise
multiplication, use '.*'.

Error in conn_displayroi>conn_displayroi_clusters (line 3796)
xyz2t=xyz2t*diag([2,1,1]); % bias x-dir
Error in conn_displayroi (line 1935)
data=conn_displayroi_clusters(data);
Error in conn_displayroi (line 465)
conn_displayroi(hfig,[],'displayreduced');
Error in conn_display (line 206)
hfigure=conn_displayroi('initspm',fullfile(filepath,[filename,fileext]),varargin{:});
Related documentation"

Threaded View

TitleAuthorDate
conn_module & conn_display - scripting - error message - Incorrect dimensions for matrix multiplication.
Ricardo Martins Jul 20, 2022
Alfonso Nieto-Castanon Jul 21, 2022