Home > functions > brain > vb_mean_normal_vector_4.m

vb_mean_normal_vector_4

PURPOSE ^

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

SYNOPSIS ^

function [xxn ,num]= vb_mean_normal_vector_4(Vindx,F,V,xx,xxF)

DESCRIPTION ^

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

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