Home > functions > brain > vb_smooth_filter_norm.m

vb_smooth_filter_norm

PURPOSE ^

smooth filter with normalization

SYNOPSIS ^

function CW = vb_smooth_filter_norm(parm,Rradius,Rmax,Iextract)

DESCRIPTION ^

 smooth filter with normalization
  CW = vb_smooth_filter_norm(parm,Rradius,Rmax,Iextract)

 Ver 1.0 written by M. Sato  2003-4-15
 Modified by Taku Yoshioka 2003-08-12

 Iextract: 部分脳モデルのインデックス


 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    CW = vb_smooth_filter_norm(parm,Rradius,Rmax,Iextract)
0002 % smooth filter with normalization
0003 %  CW = vb_smooth_filter_norm(parm,Rradius,Rmax,Iextract)
0004 %
0005 % Ver 1.0 written by M. Sato  2003-4-15
0006 % Modified by Taku Yoshioka 2003-08-12
0007 %
0008 % Iextract: 部分脳モデルのインデックス
0009 %
0010 %
0011 % Copyright (C) 2011, ATR All Rights Reserved.
0012 % License : New BSD License(see VBMEG_LICENSE.txt)
0013 
0014 dir = parm.dir ;
0015 file = parm.file;
0016 
0017 % 部分脳モデルの近傍情報
0018 load([dir.brain file.brain],'nextDD','nextIX');
0019 [nextIXNew,nextDDNew] = ...
0020     vb_reduce_neighbor_data(Iextract,nextIX,nextDD);
0021 nextDD = nextDDNew;
0022 nextIX = nextIXNew;
0023 clear nextDDNew nextIXNew;
0024 
0025 %%%%%%% Smoothing Filter calculation %%%%%%%
0026 Nvertex = size(nextIX,1);
0027 
0028 val     = [];            % Filter value
0029 ipoint    = [];            % Center point index
0030 inext    = [];            % Neighbor index
0031 
0032 if Rradius > 0,
0033   for i=1:Nvertex,
0034     dd0 = nextDD{i};        % Neighbor distance
0035     inx = find( dd0 <= Rmax );    % Find neighbor within Rmax
0036     
0037     ix    = nextIX{i}(inx);    % Neighbor index within Rmax
0038     dd    = dd0(inx);         % Distance from point-i to 'ix'
0039         
0040     ipoint = [ ipoint ; repmat( i ,[length(ix) 1] ) ];
0041     inext  = [ inext  ; ix ];
0042     val    = [ val    ; exp( - (dd/Rradius).^2 ) ];
0043   end;
0044 
0045   CW = sparse( ipoint , inext , val , Nvertex, Nvertex, length(ipoint) ) ;
0046   CW = spdiags( ones(Nvertex,1), 0, CW);
0047   
0048   % Symmetrize matrix by shorter path length
0049   CW = max( CW , CW' );
0050   wnorm = sqrt(sum( CW.^2 , 2));
0051 
0052   % Normalize filter matrix
0053   CW = CW./repmat( wnorm ,[ 1 Nvertex ]);
0054 else
0055   CW = sparse(eye(Nvertex,Nvertex));
0056 end;
0057

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