Home > functions > brain > vb_cortex_normal_average.m

vb_cortex_normal_average

PURPOSE ^

average normal direction in the neighbor of vertex

SYNOPSIS ^

function xxave = vb_cortex_normal_average(brainfile,areafile,areakey)

DESCRIPTION ^

 average normal direction in the neighbor of vertex
  xxave = vb_cortex_normal_average(brainfile,areafile,areakey)
 --- Input
 brainfile
 areafile
 areakey

 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)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005