help > Error "Index exceeds the number of array elements. Index must not exceed 2." in preprocessing step
Showing 1-2 of 2 posts
Display:
Results per page:
Sep 21, 2026  11:09 AM | Hyunjun Park
Error "Index exceeds the number of array elements. Index must not exceed 2." in preprocessing step

Dear users,


I'm preprocessing my fMRI datasets using CONN connectivity.
My datasets consist of two sessions and two different conditions were assigned to each session.
I designed the script for it. While uploading images and setting up conditions were okay, I got the error message below during the preprocessing. Would you mind letting me know how I can fix this error, or sharing any previous posts regarding it, please?


---------------------------- [ Error Message ] ----------------------------
Step 7/7: Updating Denoising variables
Index exceeds the number of array elements. Index must not exceed 2.


Error in conn_process (line 1226)
for n1=1:N2, CONN_x.Preproc.variables.dimensions{N1+n1}=max(CONN_x.Preproc.variables.dimensions{N1+n1},size(x2.data{n1},2)*ones(1,2)); end
^^^^^^^^^^^
Error in conn_process (line 55)
case 'setup', conn_disp(['CONN: RUNNING SETUP STEP']); conn_process([0:4,4.5,5]);
^^^^^^^^^^^^^^^^^^^^^^^^^
Error in conn_batch (line 1361)
conn_process Setup;
^^^^^^^^^^^^
Error in GBA_prepro_Batch_v1 (line 29)
conn_batch('filename', projectFile, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


------------------------------------------------------------------------


  Edited (Sep 22, 2026  11:09 AM)
5 hours ago | Alfonso Nieto-Castanon - Boston University
RE: Error "Index exceeds the number of array elements. Index must not exceed 2." in preprocessing step

Dear Hyunjun,


Not sure what this may be about, it could potentially indicate a mismatch between the number of ROIs or first-level covariates defined across different subjects (e.g. as if different subjects were run through the Setup step with different settings each time?). If you could please share the script or more details about the procedure that you followed leading to this error that may be helpful.


Best


Alfonso


Originally posted by Hyunjun Park:



Dear users,


I'm preprocessing my fMRI datasets using CONN connectivity.
My datasets consist of two sessions and two different conditions were assigned to each session.
I designed the script for it. While uploading images and setting up conditions were okay, I got the error message below during the preprocessing. Would you mind letting me know how I can fix this error, or sharing any previous posts regarding it, please?


---------------------------- [ Error Message ] ----------------------------
Step 7/7: Updating Denoising variables
Index exceeds the number of array elements. Index must not exceed 2.


Error in conn_process (line 1226)
for n1=1:N2, CONN_x.Preproc.variables.dimensions{N1+n1}=max(CONN_x.Preproc.variables.dimensions{N1+n1},size(x2.data{n1},2)*ones(1,2)); end
^^^^^^^^^^^
Error in conn_process (line 55)
case 'setup', conn_disp(['CONN: RUNNING SETUP STEP']); conn_process([0:4,4.5,5]);
^^^^^^^^^^^^^^^^^^^^^^^^^
Error in conn_batch (line 1361)
conn_process Setup;
^^^^^^^^^^^^
Error in GBA_prepro_Batch_v1 (line 29)
conn_batch('filename', projectFile, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


------------------------------------------------------------------------