Home > vbmeg > functions > brain > vb_find_no_overlap.m

vb_find_no_overlap

PURPOSE ^

try to find no overlap mapping

SYNOPSIS ^

function [d1, overlap, ddmin, Indx, iter] =vb_find_no_overlap(d,overlap,Rmax)

DESCRIPTION ^

 try to find no overlap mapping
 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    [d1, overlap, ddmin, Indx, iter] = ...
0002     vb_find_no_overlap(d,overlap,Rmax)
0003 % try to find no overlap mapping
0004 % Copyright (C) 2011, ATR All Rights Reserved.
0005 % License : New BSD License(see VBMEG_LICENSE.txt)
0006 
0007 % d = Dinv = vb_sparse_inv_distance(Vref,Vnew, Rmax);
0008 % inverse distances between Vref and Vnew
0009 
0010 d1=d;
0011 dinv_max=1/Rmax;
0012 
0013 maxiter = 1000;
0014 
0015 for iter = 1: maxiter
0016     for n = 1:overlap.Noverlap
0017         % overlaped Vref index
0018         ix_ref = overlap.Ovlist(n);
0019            % Multiplicity of overlaped index
0020         Nmulti = overlap.Nmulti(n);
0021         % index list of new vertex for ix_ref
0022         ix_new = overlap.Inew{n};
0023         
0024         for m=1:Nmulti
0025             [tmp, b]  = max(d1(ix_ref,ix_new));
0026             ix_new(b) = [];
0027             d1(ix_ref,ix_new) = dinv_max;
0028         end
0029     end
0030     
0031     % find overlap index
0032     [overlap, ddmin, Indx] = vb_find_overlap(d1);
0033     
0034     if overlap.Noverlap == 0, break; end
0035 end
0036 
0037 %fprintf('iter = %d, Noverlap = %d\n',iter, overlap.Noverlap),
0038 
0039 return;
0040 
0041 if overlap.Noverlap == 0, 
0042     %dd_max2 = overlap.dmin;
0043     fprintf('dmax(pre) = %g, dmax(poat) = %g, iter = %d\n',...
0044         dd_max1,dd_max2,iter)
0045 else
0046     fprintf('iter = %d, Noverlap = %d\n',iter, overlap.Noverlap), 
0047 end
0048 
0049 return;

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005