help
help > conditions setup issue
Jul 24, 2021 06:07 PM | Walker Pedersen
conditions setup issue
Im working on a batch processing command (below), and am running
into an error having to do with setting up the conditions:
"testIndex exceeds the number of array elements (2).
Error in conn_batch (line 1131)
t1=batch.Setup.conditions.onsets{nconditions}{isub}{nses};
Error in CONNsmDenoiseMNIvol (line 58)"
If I run this without the code related to conditions, I can confirm in the GUI that the number of subjects and sessions are correct, and that the functionals and structural are getting loaded.
clear batch;
batch.filename=fullfile(output_dir,'conn.mat');
% CONN Setup
batch.Setup.isnew=1;
batch.Setup.nsubjects=1;
batch.Setup.RT=3; % TR (seconds)
batch.Setup.functionals{1}{1}=preTMSrun1Func;
batch.Setup.functionals{1}{2}=preTMSrun2Func;
batch.Setup.functionals{1}{3}=postTMSrun1Func;
batch.Setup.functionals{1}{4}=postTMSrun2Func;
batch.Setup.structurals{1}=structural; % Point to anatomical volumes for each subject
batch.Setup.masks.Grey.files{1}=[fmriprep_dir subj_id '/anat/' subj_id '_label-GM_probseg.nii.gz']
batch.Setup.masks.White.files{1}=[fmriprep_dir subj_id '/anat/' subj_id '_label-WM_probseg.nii.gz']
batch.Setup.masks.CSF.files{1}=[fmriprep_dir subj_id '/anat/' subj_id '_label-CSF_probseg.nii.gz']
batch.Setup.voxelresolution=2; % default 2mm isotropic voxels analysis space
batch.Setup.conditions.names{1}='preTMS';
batch.Setup.conditions.names{2}='postTMS';
batch.Setup.conditions.onsets{1}{1}{1}=[0];
batch.Setup.conditions.onsets{1}{1}{2}=[0];
batch.Setup.conditions.onsets{2}{1}{3}=[0];
batch.Setup.conditions.onsets{2}{1}{4}=[0];
batch.Setup.conditions.durations{1}{1}{1}=[inf];
batch.Setup.conditions.durations{1}{1}{2}=[inf];
batch.Setup.conditions.durations{2}{1}{3}=[inf];
batch.Setup.conditions.durations{2}{1}{4}=[inf];
conn_batch(batch);
"testIndex exceeds the number of array elements (2).
Error in conn_batch (line 1131)
t1=batch.Setup.conditions.onsets{nconditions}{isub}{nses};
Error in CONNsmDenoiseMNIvol (line 58)"
If I run this without the code related to conditions, I can confirm in the GUI that the number of subjects and sessions are correct, and that the functionals and structural are getting loaded.
clear batch;
batch.filename=fullfile(output_dir,'conn.mat');
% CONN Setup
batch.Setup.isnew=1;
batch.Setup.nsubjects=1;
batch.Setup.RT=3; % TR (seconds)
batch.Setup.functionals{1}{1}=preTMSrun1Func;
batch.Setup.functionals{1}{2}=preTMSrun2Func;
batch.Setup.functionals{1}{3}=postTMSrun1Func;
batch.Setup.functionals{1}{4}=postTMSrun2Func;
batch.Setup.structurals{1}=structural; % Point to anatomical volumes for each subject
batch.Setup.masks.Grey.files{1}=[fmriprep_dir subj_id '/anat/' subj_id '_label-GM_probseg.nii.gz']
batch.Setup.masks.White.files{1}=[fmriprep_dir subj_id '/anat/' subj_id '_label-WM_probseg.nii.gz']
batch.Setup.masks.CSF.files{1}=[fmriprep_dir subj_id '/anat/' subj_id '_label-CSF_probseg.nii.gz']
batch.Setup.voxelresolution=2; % default 2mm isotropic voxels analysis space
batch.Setup.conditions.names{1}='preTMS';
batch.Setup.conditions.names{2}='postTMS';
batch.Setup.conditions.onsets{1}{1}{1}=[0];
batch.Setup.conditions.onsets{1}{1}{2}=[0];
batch.Setup.conditions.onsets{2}{1}{3}=[0];
batch.Setup.conditions.onsets{2}{1}{4}=[0];
batch.Setup.conditions.durations{1}{1}{1}=[inf];
batch.Setup.conditions.durations{1}{1}{2}=[inf];
batch.Setup.conditions.durations{2}{1}{3}=[inf];
batch.Setup.conditions.durations{2}{1}{4}=[inf];
conn_batch(batch);
Threaded View
Title | Author | Date |
---|---|---|
Walker Pedersen | Jul 24, 2021 | |
Alfonso Nieto-Castanon | Jul 24, 2021 | |
Walker Pedersen | Jul 25, 2021 | |