Home > functions > brain > vb_mean_normal_vector_3.m

vb_mean_normal_vector_3

PURPOSE ^

xxn : 平均法線方向 = 自分の周りの頂点の法線方向の平均

SYNOPSIS ^

function xxn = vb_mean_normal_vector_3(Vindx,F,V,xx,xxF)

DESCRIPTION ^

    xxn     : 平均法線方向 = 自分の周りの頂点の法線方向の平均

   Vindx    : 法線方向を計算するダイポールの頂点番号
  V(n, 1:3) : ダイポールの位置
 xx(n, 1:3) : ダイポールの方向(nx,ny,nz)
 xxF{n}     : 隣接近傍インデックス

 Ver 1.0 written by M. Sato  2003-3-15

 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    xxn = vb_mean_normal_vector_3(Vindx,F,V,xx,xxF)
0002 %    xxn     : 平均法線方向 = 自分の周りの頂点の法線方向の平均
0003 %
0004 %   Vindx    : 法線方向を計算するダイポールの頂点番号
0005 %  V(n, 1:3) : ダイポールの位置
0006 % xx(n, 1:3) : ダイポールの方向(nx,ny,nz)
0007 % xxF{n}     : 隣接近傍インデックス
0008 %
0009 % Ver 1.0 written by M. Sato  2003-3-15
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 NV     = length(Vindx);% Number of points
0015 
0016 xxn  = zeros(NV,3);% Average direction
0017 
0018 % Average and interpolate normal direction
0019 for i=1:NV,
0020     n          = Vindx(i);
0021     % 点 'n' 隣接近傍インデックス
0022     indx      = [xxF{n} ; n];
0023 
0024     JJ          = xx(indx,:);        % Current direction at neighbor
0025     
0026     % Average normal direction
0027     Jave      = sum(JJ);
0028     Jave      = Jave/sqrt(sum(Jave.^2));
0029     xxn(i,:)  = Jave;
0030 end;

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