Dear Alexandre,
I would recommend to use the spm_select() function to find files and
directories instead of dir(). If your files are all 3D, you also don't
need to add the trailing ',1' at the end of NIfTI filenames.
Now the error is indeed at lines 56 and 58, where I put an X:
cfg_dep('Slice Timing: Slice Timing Corr. Images (Sess 1)',
substruct('.','val', '{}',{X}, '.','val', '{}',{1}, '.','val',
'{}',{1}), substruct('()',{1}, '.','files'))
X should be 1 and not 2 such that the dependencies relate to the first
module (slice timing correction).
Using spm_jobman('interactive',matlabbatch) and View: Show .m code might
be useful when debugging batch scripts.
Best regards,
Guillaume.
On 03/02/17 12:52, Alexandre Obert wrote:
> Dear all,
>
> I'm very new at scripting and I'm trying to build one from a .m batch
> file but it does not work...
>
> Slice timing seems working properly but I've got an error at the realign
> step.
> (No executable modules, but still unresolved dependencies or incomplete
> module inputs.)
>
> After several test, I guess that the error comes from the line 56 and 58 :
>
> matlabbatch{2}.spm.spatial.realignunwarp.data(1).scans(1) =
> cfg_dep('Slice Timing: Slice Timing Corr. Images (Sess 1)',
> substruct('.','val', '{}',{2}, '.','val', '{}',{1}, '.','val',
> '{}',{1}), substruct('()',{1}, '.','files'));
>
> This is probably due to a simple error in my script but I don't see it...
>
> Any advice?
>
> Thank,
>
> Alexandre
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|