


Get/set the defaults values associated with an identifier FORMAT defaults = prt_get_defaults Return the global "defaults" variable defined in prt_defaults.m. FORMAT defval = prt_get_defaults(defstr) Return the defaults value associated with identifier "defstr". Currently, this is a '.' subscript reference into the global "prt_def" variable defined in prt_defaults.m. FORMAT prt_get_defaults(defstr, defval) Sets the defaults value associated with identifier "defstr". The new defaults value applies immediately to: * new modules in batch jobs * modules in batch jobs that have not been saved yet This value will not be saved for future sessions of PRoNTo. To make persistent changes, edit prt_defaults.m. The structure and content of this file are largely inspired by SPM & Matlabbatch. http://www.fil.ion.ucl.ac.uk/spm http://sourceforge.net/projects/matlabbatch/ __________________________________________________________________________ Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory


0001 function varargout = prt_get_defaults(defstr, varargin) 0002 % Get/set the defaults values associated with an identifier 0003 % 0004 % FORMAT defaults = prt_get_defaults 0005 % Return the global "defaults" variable defined in prt_defaults.m. 0006 % 0007 % FORMAT defval = prt_get_defaults(defstr) 0008 % Return the defaults value associated with identifier "defstr". 0009 % Currently, this is a '.' subscript reference into the global 0010 % "prt_def" variable defined in prt_defaults.m. 0011 % 0012 % FORMAT prt_get_defaults(defstr, defval) 0013 % Sets the defaults value associated with identifier "defstr". The new 0014 % defaults value applies immediately to: 0015 % * new modules in batch jobs 0016 % * modules in batch jobs that have not been saved yet 0017 % This value will not be saved for future sessions of PRoNTo. To make 0018 % persistent changes, edit prt_defaults.m. 0019 % 0020 % The structure and content of this file are largely inspired by SPM & 0021 % Matlabbatch. 0022 % http://www.fil.ion.ucl.ac.uk/spm 0023 % http://sourceforge.net/projects/matlabbatch/ 0024 %__________________________________________________________________________ 0025 % Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory 0026 0027 % Originally written by Volkmar Glauche 0028 % Then modified for use with the PRoNTo toolbox by Christophe Phillips 0029 % $Id: prt_get_defaults.m 135 2011-10-11 10:21:27Z amarquan $ 0030 0031 global prt_def; 0032 if isempty(prt_def) 0033 prt_defaults; 0034 end 0035 0036 if nargin == 0 0037 varargout{1} = prt_def; 0038 return 0039 end 0040 0041 % construct subscript reference struct from dot delimited tag string 0042 tags = textscan(defstr,'%s', 'delimiter','.'); 0043 subs = struct('type','.','subs',tags{1}'); 0044 0045 if nargin == 1 0046 varargout{1} = subsref(prt_def, subs); 0047 else 0048 prt_def = subsasgn(prt_def, subs, varargin{1}); 0049 end