Shell information of specified head_file. [Usage] shell_info = vb_load_head_shell_info(head_file); [Input] head_file : VBMEG head model file(.head.mat) [Output] shell_info : information of the specified head_file. .Nshell : The number of shells. (e.g. 3) .tags : Shell tags. (e.g. {'CSF', 'Skull', 'Scalp'}) .Nvertex : The number of vertices (e.g. [2000, 2000, 2000]) .Nface : The number of patches (e.g. [4000, 4000, 4000]) Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function shell_info = vb_load_head_shell_info(head_file) 0002 % Shell information of specified head_file. 0003 % [Usage] 0004 % shell_info = vb_load_head_shell_info(head_file); 0005 % [Input] 0006 % head_file : VBMEG head model file(.head.mat) 0007 % [Output] 0008 % shell_info : information of the specified head_file. 0009 % .Nshell : The number of shells. (e.g. 3) 0010 % .tags : Shell tags. (e.g. {'CSF', 'Skull', 'Scalp'}) 0011 % .Nvertex : The number of vertices (e.g. [2000, 2000, 2000]) 0012 % .Nface : The number of patches (e.g. [4000, 4000, 4000]) 0013 % 0014 % Copyright (C) 2011, ATR All Rights Reserved. 0015 % License : New BSD License(see VBMEG_LICENSE.txt) 0016 0017 0018 % 0019 % --- Previous check 0020 % 0021 if ~exist('head_file', 'var') 0022 error('head_file is a required.'); 0023 end 0024 if exist(head_file, 'file') ~= 2 0025 error('Specified file not found.'); 0026 end 0027 0028 % 0029 % --- Main Procedure 0030 % 0031 shell_info = struct; 0032 0033 Nshell = vb_head_get_layer_num(head_file); 0034 tmp_info = cell(0); 0035 for k=1:Nshell 0036 tmp_info{k} = vb_head_get_specified_headinfo(head_file, k); 0037 end 0038 % There is a case that the 1shell model doesn't have LayerTag. 0039 if Nshell == 1 && ~isfield(tmp_info{1}, 'LayerTag') 0040 tmp_info{1}.LayerTag = {'CSF'}; 0041 end 0042 0043 % Create infomation structure 0044 shell_info.Nshell = Nshell; 0045 shell_info.tags = cell(1, Nshell); 0046 shell_info.Nvertex = zeros(1, Nshell); 0047 shell_info.Nface = zeros(1, Nshell); 0048 0049 for k=1:Nshell 0050 shell_info.tags{k} = tmp_info{k}.LayerTag; 0051 shell_info.Nvertex(k) = size(tmp_info{k}.Vhead, 1); 0052 shell_info.Nface(k) = size(tmp_info{k}.Fhead, 1); 0053 end