0

I am trying to load in .nii files for some smoothed/preprocessed fMRI images to run first level analyses using a batch script in SPM. But when I use spm_select to do so the stats.scans() line sends me an error. This is despite the fact that the structure of the cell array from my spm_select code I wrote is identical to the structure that results when I run the import code from the batch script I exported from the SPM GUI (which ran just fine). Both are 218x1 cell arrays where each cell is a string with the exact same number of characters. Error code

This is the spm_select code I wrote:

run1{1,1}=spm_select('ExtFPList', 'D:\Smooth\', ['swr',subject,'_ses-7_task-Gram_acq_run-01_bold.nii.*'], 1);
    
for q=2:218
        
    run1{q,1} = spm_select('ExtFPList', 'D:\Smooth\',['swr',subject,'_ses-7_task-Gram_acq_run-01_bold.nii.*'], q);
   
end
  
matlabbatch{1}.spm.stats.fmri_spec.sess(1).scans(1) = run1;

When I replace the final line with "=cellstr(run1)" I get the same error message...I'm at a loss- any help is appreciated!

anamarz
  • 1
  • 1

0 Answers0