help > RE: mismatched number of scans and covariate datapoints
Mar 8, 2023  01:03 AM | Alfonso Nieto-Castanon - Boston University
RE: mismatched number of scans and covariate datapoints
Hi Melanie,

The problem seems to be that your secondary dataset #1 (unsmoothed volumes) lists the files:

/data/7T_hunt/Melanie_HD_fMRI/fmri/b4473_t12317_fmri.nii

(e.g. containing 100 scans for subject 1), while your functional data lists the files:
'/data/7T_hunt/Melanie_HD_fMRI/fmri/swub4473_t12317_fmri.nii,3 '
'/data/7T_hunt/Melanie_HD_fMRI/fmri/swub4473_t12317_fmri.nii,4 '
'/data/7T_hunt/Melanie_HD_fMRI/fmri/swub4473_t12317_fmri.nii,5 '
'/data/7T_hunt/Melanie_HD_fMRI/fmri/swub4473_t12317_fmri.nii,6 '

...
'/data/7T_hunt/Melanie_HD_fMRI/fmri/swub4473_t12317_fmri.nii,100'
(e.g. containing 98 scans for subject 1, after the first two scans were removed from the dataset)

You should be able to fix this issue simply defining your secondary dataset #1 (unsmoothed volumes) using the the option 'secondary dataset is implicitly related to functional data: same filenames without leading 's'' instead of selecting those files manually (or alternatively, by selecting the files excluding the first two scans, to match the number of scans in the functional data and in the 1st-level covariates)

Hope this helps
Alfonso

Originally posted by Melanie Morrison:
Hi Alfonso,

For some reason I keep getting this error after the preprocessing stage. Have never seen this before. Reproducible across conn & matlab versions. I thought it was related to a new atlas I am trying to load but that doesn't seem to be the problem. Another older thread suggested replacing the rex file I believe but that was from v2017. Attaching .mat file.


Error using rex>rex_do (line 766)
mismatched number of scans and covariate datapoints ([100 1] vs. [98 8])
Error in rex (line 192)
[params.ROIdata,params.ROInames,params.ROIinfo.basis,params.ROIinfo.voxels,params.ROIinfo.files,params.ROIinfo.select,params.ROIinfo.trans]=rex_do(params,1);
Error in conn_rex (line 8)
[varargout{1:nargout}]=rex(varargin{:});
Error in conn_process (line 934)
else [data{nroi1},namesroi{nroi},params]=conn_rex(Vsourcethis,Vmask{nroi}{min(nses,nsesstemp)},'summary_measure','eigenvariate','dims',CONN_x.Setup.rois.dimensions{nroi},'conjunction_mask',mask,'level',level,'scaling',scalinglevel,'select_clusters',0,'covariates',entercovariates,'fsanatomical',fsanatomical,'output_type',outputtype,'output_rex',filenamerex,'output_folder',filepath);
Error in conn_process (line 16)
case 'setup', conn_disp(['CONN: RUNNING SETUP STEP']); conn_process([0:4,4.5,5]);
Error in conn (line 5743)
else conn_process(processname); ispending=false;
Error in conn_menumanager (line 121)
feval(CONN_MM.MENU{n0}.callback{n1}{1},CONN_MM.MENU{n0}.callback{n1}{2:end});
CONN20.a
SPM12
Matlab v.2018a
project: CONN19.c
storage: 573.7Gb available

spm @ /netopt/share/lib/matlab/spm12
conn @ /data/morrison/software/conn

Thanks,
Melanie

Threaded View

TitleAuthorDate
Melanie Morrison Mar 6, 2023
RE: mismatched number of scans and covariate datapoints
Alfonso Nieto-Castanon Mar 8, 2023