Home > functions > common > coordinate > vb_check_fitting.m

vb_check_fitting

PURPOSE ^

Check fitting

SYNOPSIS ^

function [dmin, Vmap] = vb_check_fitting(facefile, V, trans_mat)

DESCRIPTION ^

   Check fitting 
   [dmin, Vmap] = vb_check_fitting(facefile, V, trans_mat)
 ---- Input 
 facefile   : MRI face-file          (*.face.mat)
 V          = Head points by digitizer
 trans_mat  = transformation matrix

 ---- Output
 dmin   = distance between head points and face
 Vmap   = posision of head points mapped onto face surface

 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    [dmin, Vmap] = vb_check_fitting(facefile, V, trans_mat)
0002 %   Check fitting
0003 %   [dmin, Vmap] = vb_check_fitting(facefile, V, trans_mat)
0004 % ---- Input
0005 % facefile   : MRI face-file          (*.face.mat)
0006 % V          = Head points by digitizer
0007 % trans_mat  = transformation matrix
0008 %
0009 % ---- Output
0010 % dmin   = distance between head points and face
0011 % Vmap   = posision of head points mapped onto face surface
0012 %
0013 % Copyright (C) 2011, ATR All Rights Reserved.
0014 % License : New BSD License(see VBMEG_LICENSE.txt)
0015 
0016 % Minimun distance search radius
0017 Rmax   = 0.003; 
0018 
0019 %
0020 % --- Load MRI face data
0021 %
0022 load(facefile ,'surf_face');
0023 
0024 %
0025 % ---- Check fitting ----
0026 %
0027 
0028 % fitting distance
0029 V = vb_affine_trans( V, trans_mat);
0030 
0031 [ix ,dmin] = vb_find_nearest_point(surf_face.V, V, Rmax);
0032 
0033 dmin  = dmin*1000;
0034 Vmap  = surf_face.V(ix,:);
0035 Nall  = length(dmin);
0036 dmean = sum(dmin)/Nall;
0037 
0038 fprintf('Mean distance for %d points = %f [mm]\n',Nall, dmean)
0039 
0040 return
0041 %
0042 % ---- END ----
0043 %

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