Hi,
I am trying to run a batch of slice timing correction in SPM8 with Matlab R2011a. For the following command, STC runs with the correct TR listed in the Matlab window.
spm('defaults','fmri');
spm_jobman('initcfg');
%
matlabbatch{1}.spm.temporal.st.scans = {fmri};
%
matlabbatch{1}.spm.temporal.st.nslices = 33;
matlabbatch{1}.spm.temporal.st.tr = TR;
matlabbatch{1}.spm.temporal.st.ta = TR-(TR/33);
matlabbatch{1}.spm.temporal.st.so = [1:2:33 2:2:33];
matlabbatch{1}.spm.temporal.st.refslice = 16;
matlabbatch{1}.spm.temporal.st.prefix = 'a';
spm_jobman('run',matlabbatch);
However, when I change any of the "33" into a variable as follows, the TR is displayed as to 0 or 0.1 depending on which line is changed:
nslices = 33;
spm('defaults','fmri');
spm_jobman('initcfg');
%
matlabbatch{1}.spm.temporal.st.scans = {fmri};
%
matlabbatch{1}.spm.temporal.st.nslices = nslices;
matlabbatch{1}.spm.temporal.st.tr = TR;
matlabbatch{1}.spm.temporal.st.ta = TR-(TR/nslices);
matlabbatch{1}.spm.temporal.st.so = [1:2:nslices 2:2:nslices];
matlabbatch{1}.spm.temporal.st.refslice = 16;
matlabbatch{1}.spm.temporal.st.prefix = 'a';
spm_jobman('run',matlabbatch);
The interesting thing is that if I look at matlabbatch{1,1}.spm.temporal.st, it lists both nslices correctly at 33, and tr at 2, ta 1.9394 as expected, and so a 1 x 33 vector...
What am I doing wrong???
Any help appreciated.
Thanks,
Harry
|