Dear Sergio,
the preprocessing figures will only be saved in a PostScript file if the
Graphics window is open and CmdLine mode is not activated. This is to
give the option to prevent the Graphics window to repeatedly take the
focus when running batches.
Your solution to initialise batches with:
spm('defaults','fmri');
spm_get_defaults('cmdline',false); % default
spm_jobman('initcfg');
spm_figure('GetWin','Graphics');
seems fine by me.
Best regards,
Guillaume.
On 14/01/16 13:49, Sergio Maffioletti wrote:
> Dear SPM developers/support
>
> One of our user has been exporting an SPM Matlab script from the GUI
> interface and run through Matlab CLI.
> Though the outcome result is somewhat different and I could not get my
> head around the possible causes (I'm not very expert nor in SPM nor in
> how to properly run it through the Matlab CLI).
>
> The inconsistency in the results is that when running SPM from the
> Matlab CLI, the Image realignment graphs (translation and rotation) as
> well as the Normalised Mutual Information Coregistration graphs are
> not generated (or at least are not included in the result document).
> While the rest of the graphs are produced as expected.
>
> Unfortunately I cannot share the original script, but I'll try to
> explain it as better as I can:
>
> In the original exported SPM script we have the following init statements:
> spm fmri
> spm('defaults', 'FMRI');
>
> The steps taken in the script:
> matlabbatch{1}.spm.tools.fieldmap.phasemag
> matlabbatch{2}.spm.spatial.realignunwarp
> matlabbatch{3}.spm.temporal.st
> matlabbatch{4}.spm.spatial.coreg
> matlabbatch{5}.spm.spatial.preproc
> matlabbatch{6}.spm.util.defs.comp
>
> For each of them a corresponding
> spm_jobman ('run', matlabbatch( ));
>
> is provided.
>
> We have a modified version of the script where we replaced the init
> statements with:
> spm('defaults','fmri');
> spm_jobman('initcfg');
> spm_figure('GetWin','Graphics');
>
>
> The replacement was introduced for 2 reasons:
> 1. Whit the `spm fmri` statement, the SPM GUI was attempted to start
> irrespective on the "defaults.cmdline = true;" statement in
> spm_defaults.m file.
> 2. Graphs were not properly saved in any output file if the statement
> "spm_figure('GetWin','Graphics');" was not provided.
>
> We are running SPM12 on Matlab R2015b.
>
> thanks for any troughs/suggestion/hints
>
> Regards,
> Sergio
>
> [log in to unmask]
> S3IT: Service and Support for ScienceIT
> http://www.s3it.uzh.ch/
> Office: Y11F62
> University of Zurich
> Winterthurerstrasse 190
> CH-8057 Zurich Switzerland
> Tel: +41 44 635 4209
>
--
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG
|