Home > vbmeg > functions > brain > vb_parent_std_brain_file_get.m

vb_parent_std_brain_file_get

PURPOSE ^

get template standard brain file path of specified brain_file.

SYNOPSIS ^

function std_brain_file = vb_parent_std_brain_file_get(brain_file)

DESCRIPTION ^

 get template standard brain file path of specified brain_file.
 [Usage]
    std_brain_file = vb_parent_std_brain_file_get(brain_file);

 [Input]
        brain_file : VBMEG Cortical model file(.brain.mat)

 [Output]
    std_brain_file : Template standard brain path of brain_file.

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function std_brain_file = vb_parent_std_brain_file_get(brain_file)
0002 % get template standard brain file path of specified brain_file.
0003 % [Usage]
0004 %    std_brain_file = vb_parent_std_brain_file_get(brain_file);
0005 %
0006 % [Input]
0007 %        brain_file : VBMEG Cortical model file(.brain.mat)
0008 %
0009 % [Output]
0010 %    std_brain_file : Template standard brain path of brain_file.
0011 %
0012 % Copyright (C) 2011, ATR All Rights Reserved.
0013 % License : New BSD License(see VBMEG_LICENSE.txt)
0014 
0015 
0016 %
0017 % --- Previous check
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 % --- Main Procedure
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

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005