edge_refined_node_mapper

PURPOSE ^

EDGE_REFINED_NODE_MAPPER:

SYNOPSIS ^

function [index_vtx] = edge_refined_node_mapper(mdl_coarse, mdl_dense);

DESCRIPTION ^

 EDGE_REFINED_NODE_MAPPER:
      maps a dense mesh verticies array onto a more coarse mesh verticies
      array.  The closest vertex on the dense mesh to the objective vertex on
      the coarse mesh is found.

 Usage:
  [index_vtx] = edge_refined_node_mapper(mdl_coarse, mdl_dense);

 mdl_coarse  = fwd_model of coarse mesh
 mdl_dense   = fwd_model of dense mesh

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [index_vtx] = edge_refined_node_mapper(mdl_coarse, mdl_dense);
0002 % EDGE_REFINED_NODE_MAPPER:
0003 %      maps a dense mesh verticies array onto a more coarse mesh verticies
0004 %      array.  The closest vertex on the dense mesh to the objective vertex on
0005 %      the coarse mesh is found.
0006 %
0007 % Usage:
0008 %  [index_vtx] = edge_refined_node_mapper(mdl_coarse, mdl_dense);
0009 %
0010 % mdl_coarse  = fwd_model of coarse mesh
0011 % mdl_dense   = fwd_model of dense mesh
0012 
0013 warning('EIDORS:deprecated','EDGE_REFINED_NODE_MAPPER is deprecated as of 06-Jun-2012. ');
0014 
0015 index_vtx = eidors_obj('get-cache', mdl_dense, 'index_vtx', mdl_coarse);
0016 if ~isempty(index_vtx)
0017    eidors_msg('edge_refined_node_mapper: using cached value', 2);
0018    return
0019 end
0020 
0021 vtx_dense  = mdl_dense.nodes;
0022 simp_dense = mdl_dense.elems;
0023 vtx_coarse  = mdl_coarse.nodes;
0024 simp_coarse = mdl_coarse.elems;
0025 
0026 index=zeros(size(vtx_coarse,1),2);
0027 
0028 
0029 % Down to business ...
0030 
0031 h = waitbar(0,'Calculating Verticies Map');
0032 
0033 for ic=1:size(vtx_coarse,1);   % for all coarse verticies
0034 
0035    waitbar(ic/size(vtx_coarse,1))
0036 
0037    dx=vtx_dense(:,1)-vtx_coarse(ic,1);   % find the x co-ord difference
0038    dy=vtx_dense(:,2)-vtx_coarse(ic,2);   % find the y co-ord difference
0039    dz=vtx_dense(:,3)-vtx_coarse(ic,3);   % find the z co-ord difference
0040 
0041    % distance between points for each dense vertex and the ic'th coarse vertex
0042    dist=sqrt((dx.^2)+(dy.^2)+(dz.^2));
0043 
0044    [m,index(ic,1)]=min(dist);   % index out the minimum distance from the dense mesh to the ic'th vertex
0045 
0046    index(ic,2)=m;   % write the actual minimum distance (as a quality control procedure)
0047 
0048 end
0049 
0050 close(h)
0051 
0052 index_vtx=index;
0053 
0054 % Cache the restult - it depends on both dense and coarse mdl
0055 eidors_obj('set-cache', mdl_dense, 'index_vtx', index_vtx, mdl_coarse);
0056 eidors_msg('edge_refined_node_mapper: setting cached value', 2);
0057 
0058 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0059 % This is part of the EIDORS suite.
0060 % Copyright (c) D.R Stephenson 2004
0061 % Copying permitted under terms of GNU GPL
0062 % See enclosed file gpl.html for details.
0063 % EIDORS 3D version XXX
0064 % MATLAB Version 6.5.0.180913a (R13)
0065 % MATLAB License Number: 1560
0066 % Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 1)
0067 % Java VM Version: Java 1.3.1_01 with Sun Microsystems Inc. Java HotSpot(TM) Client VM
0068 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Generated on Wed 21-Jun-2017 09:29:07 by m2html © 2005