FORMAT subjroot = get_subjroot() Gets the root path for the example data. Looks first for an environment variable, if not defined, uses GUI
0001 function subjroot = get_subjroot() 0002 % FORMAT subjroot = get_subjroot() 0003 % 0004 % Gets the root path for the example data. 0005 % Looks first for an environment variable, if not defined, uses GUI 0006 subjroot = getenv('MARSBAR_EG_DATAPATH'); 0007 % Otherwise fetch via the GUI 0008 if isempty(subjroot) 0009 subjroot = spm_get(-1, '', 'Root directory of example data'); 0010 end 0011 if ~exist(fullfile(subjroot, 'sess1'), 'dir') 0012 error(sprintf('Expecting "sess1" directory in %s', subjroot)) 0013 end 0014 return