average normal direction in the neighbor of vertex xxave = vb_cortex_normal_average(brainfile,areafile,areakey,coord_type) --- Input brainfile areafile areakey coord_type : = 'subj' : subject cortex normal. [default] = 'std' : standard cortex normal. In the brainfile, 'normal_stat' should be exist: normal_stat.neighbor_org : original brain neighbor index list normal_stat.normal_org : original brain normal vector --- Output xxave : average normal vector (NP x 3) M. Sato 2006-7-23 Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function xxave = vb_cortex_normal_average(brainfile,areafile,area_key,coord_type) 0002 % average normal direction in the neighbor of vertex 0003 % xxave = vb_cortex_normal_average(brainfile,areafile,areakey,coord_type) 0004 % --- Input 0005 % brainfile 0006 % areafile 0007 % areakey 0008 % coord_type : = 'subj' : subject cortex normal. [default] 0009 % = 'std' : standard cortex normal. 0010 % 0011 % In the brainfile, 'normal_stat' should be exist: 0012 % normal_stat.neighbor_org : original brain neighbor index list 0013 % normal_stat.normal_org : original brain normal vector 0014 % --- Output 0015 % xxave : average normal vector (NP x 3) 0016 % 0017 % M. Sato 2006-7-23 0018 % 0019 % Copyright (C) 2011, ATR All Rights Reserved. 0020 % License : New BSD License(see VBMEG_LICENSE.txt) 0021 0022 if ~exist('coord_type', 'var') 0023 coord_type = 'subj'; 0024 end 0025 normal_stat = vb_load_normal_statics(brainfile, coord_type); 0026 0027 % 0028 % --- Average normal vector 0029 % 0030 fprintf('--- Average normal vector\n') 0031 xxave = vb_calc_normal_average(normal_stat.neighbor_org, normal_stat.normal_org); 0032 0033 % 0034 % select area 0035 % 0036 if exist('areafile','var') & exist('area_key','var') ... 0037 & ~isempty(areafile) & ~isempty(area_key), 0038 Area = vb_get_area([areafile], area_key); 0039 ix = Area.Iextract; 0040 xxave = xxave(ix,:); 0041 end