Print

Print


Dear all,

I am currently trying to preprocess resting-state fMRI data using the batch on SPM12 (v6906), and I get the following error after realignment is done:


Done    'Realign: Estimate & Reslice'
Item 'Session', field 'val': Number of matching files (1) less than required (2).
Error using harvest (line 47)
Dependencies resolved, but not suitable for this item.
In item Session:
Dependency 1: Realign: Estimate & Reslice: Realigned Images (Sess 1)
(out.sess(1).rfiles)
    '/projects/pbic1036/sara/bids_m1_data/derivatives/preprocessing/sub-03/s...'


Error in harvest (line 62)
Error in harvest (line 49)
Error in harvest (line 51)
Error in cfg_util>local_runcj (line 1723)
Error in cfg_util (line 959)
Error in spm_jobman>fill_run_job (line 458)
Error in spm_jobman (line 247)
Error in preprocessing_lets_try (line 29)


This error disappears if I run the batch script again without deleting the output from previous attempts, but will always appear if I deleted the previously generated realigned files (so if I keep the original raw data only).

Here below my first part of the preprocessing pipeline (Realign: Estimate & Reslice and Slice Timing):


matlabbatch{1}.cfg_basicio.file_dir.dir_ops.cfg_cd.dir = '/projects/pbic1036/sara/bids_m1_data/derivatives/preprocessing/sub-03/ses-01lung';
matlabbatch{2}.spm.spatial.realign.estwrite.data = {'/projects/pbic1036/sara/bids_m1_data/derivatives/preprocessing/sub-03/ses-01lung/func/sub-03_ses-01lung_task-rest_bold.nii,1'};
matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.quality = 0.9;
matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.sep = 4;
matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.fwhm = 5;
matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.rtm = 1;
matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.interp = 2;
matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.wrap = [0 0 0];
matlabbatch{2}.spm.spatial.realign.estwrite.eoptions.weight = '';
matlabbatch{2}.spm.spatial.realign.estwrite.roptions.which = [0 1];
matlabbatch{2}.spm.spatial.realign.estwrite.roptions.interp = 4;
matlabbatch{2}.spm.spatial.realign.estwrite.roptions.wrap = [0 0 0];
matlabbatch{2}.spm.spatial.realign.estwrite.roptions.mask = 1;
matlabbatch{2}.spm.spatial.realign.estwrite.roptions.prefix = 'r';
matlabbatch{3}.spm.temporal.st.scans{1}(1) = cfg_dep('Realign: Estimate & Reslice: Realigned Images (Sess 1)', substruct('.','val', '{}',{2}, '.','val', '{}',{1}, '.','val', '{}',{1}, '.','val', '{}',{1}), substruct('.','sess', '()',{1}, '.','cfiles'));
matlabbatch{3}.spm.temporal.st.nslices = 34;
matlabbatch{3}.spm.temporal.st.tr = 2;
matlabbatch{3}.spm.temporal.st.ta = 1.94117647058824;
matlabbatch{3}.spm.temporal.st.so = [1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34];
matlabbatch{3}.spm.temporal.st.refslice = 1;
matlabbatch{3}.spm.temporal.st.prefix = 'a';


I have checked the dependency between the two steps many times, it is definitely in the batch but somehow it does not work properly.
Does anyone have an idea of how to solve this? 

Many thanks

Best regards,
Sara