0001 function std_brain_file = vb_parent_std_brain_file_get(brain_file)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 if nargin ~= 1
0020 error('Please check function usage.');
0021 end
0022 if exist(brain_file, 'file') ~= 2
0023 error('Specified file not found.');
0024 end
0025
0026
0027
0028
0029 load(brain_file, 'brain_parm');
0030 if ~exist('brain_parm', 'var')
0031 vb_disp('Specified brain file is created by VBMEG v1.');
0032 std_brain_file = brain_file;
0033 return;
0034 else
0035 [a] = vb_set_icbm152(brain_parm.Nvertex);
0036 child_dir = strrep(a.brain_file, '.brain.mat', '');
0037 std_brain_file = fullfile(a.std_dir, child_dir, a.brain_file);
0038 if exist(std_brain_file, 'file') ~= 2
0039 error('Original standard brain not found in VBMEG %s', std_brain_file);
0040 end
0041 end