Dear Manfred and Wiktor,
The issue here is with 4D files. The slice timing correction batch
interface was changed in r6918 to allow the input to be a single 4D file:
spm12> svn log -r6918
------------------------------------------------------------------------
r6918 | guillaume | 2016-11-02 14:33:11 +0000 (Wed, 02 Nov 2016) | 5 lines
Enhancements:
* allow unexpanded 4D file in slice timing correction batch interface.
------------------------------------------------------------------------
spm12> svn diff config/spm_cfg_st.m -c6918
Index: config/spm_cfg_st.m
===================================================================
--- config/spm_cfg_st.m (revision 6917)
+++ config/spm_cfg_st.m (revision 6918)
@@ -14,7 +14,7 @@
scans.help = {'Select images to slice-time correct.'};
scans.filter = 'image';
scans.ufilter = '.*';
-scans.num = [2 Inf];
+scans.num = [1 Inf];
scans.preview = @(f) spm_check_registration(char(f));
%--------------------------------------------------------------------------
This change should be available to you if you are using the latest
version of SPM12. Otherwise you can apply the modification manually.
An alternative is to create a list of all the frames within the 4D file.
Use either
spm_select('expand','sub_ ... _bold.nii')
or the batch module SPM > Util > Expand image frames.
Best regards,
Guillaume.
On 19/01/18 08:09, Manfred Klöbl wrote:
> Dear Wiktor,
>
> for slice timing correction, you need to provide at least two frames /
> images but it looks like you only specified a single one (the algorithms
> uses an FFT time shift, which does not work if you have only one time
> point).
>
> Best regards,
> Manfred
>
>
> Am 18.01.2018 um 18:06 schrieb Wiktor Olszowy:
>> Dear SPMers,
>>
>> I am struggling to conduct slice timing correction with batch. I have used part of the template 'face_rep_spm12_batch.m' from http://www.fil.ion.ucl.ac.uk/spm/data/face_rep/
>>
>> For the following batch script:
>>
>> nslices = 32;
>> TR = 1.97;
>> spm('Defaults', 'fMRI');
>> spm_jobman('initcfg');
>> clear matlabbatch;
>> matlabbatch{1}.spm.spatial.realign.estwrite.data{1} = cellstr('sub_ ... _bold.nii');
>> matlabbatch{2}.spm.temporal.st.scans{1} = cellstr('rsub_ ... _bold.nii');
>> matlabbatch{2}.spm.temporal.st.nslices = nslices;
>> matlabbatch{2}.spm.temporal.st.tr = TR;
>> matlabbatch{2}.spm.temporal.st.ta = TR - (TR/nslices);
>> matlabbatch{2}.spm.temporal.st.so = nslices:-1:1;
>> matlabbatch{2}.spm.temporal.st.refslice = round(nslices/2);
>> spm_jobman('run', matlabbatch);
>>
>> the following error appears:
>>
>> Item 'Session', field 'val': Number of matching files (1) less than required (2).
>> Error using spm_jobman>fill_run_job (line 461)
>> No executable modules, but still unresolved dependencies or incomplete module
>> inputs.
>> Error in spm_jobman (line 247)
>> sts = fill_run_job('run', cjob, varargin{3:end});
>>
>> It seems that the only difference between my script and the SPM template is that I use '.nii' rather than '.img' files. The solution is probably very easy... Sorry for bothering you!
>>
>> Best,
>>
>> Wiktor
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|