#!/usr/bin/octave -fqH # # Command Line Interface for SPM # SPM: http://www.fil.ion.ucl.ac.uk/spm/ # # Copyright (C) 2017 Wellcome Trust Centre for Neuroimaging # # Guillaume Flandin # $Id: spm12-octave 7053 2017-04-03 11:04:13Z guillaume $ spm_dir = getenv ("SPM_HOME"); if (isempty (spm_dir)) spm_dir = mfilename ("fullpath"); sts = false; while ! (sts) [out, sts] = readlink (spm_dir); if ! (sts) if ! (is_absolute_filename (out)) spm_dir = fullfile (fileparts (spm_dir), out); else spm_dir = out; endif endif endwhile spm_dir = fullfile (fileparts (spm_dir), ".."); endif addpath (canonicalize_file_name (spm_dir)); try spm ("Ver"); catch printf (["error: Cannot find the SPM directory. " ... "Set SPM_HOME environment variable.\n"]); exit (1); end spm_standalone (argv (){:}); H = get (0, "CurrentFigure"); if ! (isempty (H)), waitfor (H); endif