Home > functions > plotfunc > vb_plot_fit_scan.m

vb_plot_fit_scan

PURPOSE ^

Plot face & marker fit

SYNOPSIS ^

function vb_plot_fit_scan(V,F,Coord,Head,trans_mat,imagefile)

DESCRIPTION ^

 Plot face & marker fit
  vb_plot_fit_scan(V,F,Coord,Head,trans_mat,imagefile)

 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    vb_plot_fit_scan(V,F,Coord,Head,trans_mat,imagefile)
0002 % Plot face & marker fit
0003 %  vb_plot_fit_scan(V,F,Coord,Head,trans_mat,imagefile)
0004 %
0005 % Copyright (C) 2011, ATR All Rights Reserved.
0006 % License : New BSD License(see VBMEG_LICENSE.txt)
0007 
0008 fwgcolor   = 'none';
0009 edgecolor  = 'r';
0010 msize     = 10;
0011 mtype     = '.r';
0012 
0013 % Digitizer face surface
0014 FV = vb_affine_trans(Coord.FV, trans_mat);
0015 % Head position
0016 HV = vb_affine_trans(Head, trans_mat);
0017 
0018 %view([180, 0]);    % Front view (from +Y axis)
0019 %view([ 90, 0]);    % Right view (from +X axis)
0020 %view([-90, 0]);    % Left view  (from -X axis)
0021 %view([  0, 90]);    % Top view   (from +Z axis)
0022 
0023 figure;
0024 
0025 % Right view
0026 subplot(2,2,1)
0027 vb_plot_surf(V,F,[0.8 0.7 0.6],'none',1);
0028 alpha(0.7)
0029 hold on
0030 vb_plot_surf(FV, Coord.FF, fwgcolor,edgecolor);
0031 plot3(HV(:,1),HV(:,2),HV(:,3),mtype,'MarkerSize',msize)
0032 view([90 0]); axis tight;
0033 
0034 % Front view
0035 subplot(2,2,2)
0036 vb_plot_surf(V,F,[0.8 0.7 0.6],'none',1);
0037 alpha(0.7)
0038 hold on
0039 vb_plot_surf(FV, Coord.FF, fwgcolor,edgecolor);
0040 plot3(HV(:,1),HV(:,2),HV(:,3),mtype,'MarkerSize',msize)
0041 view([180 0]); axis tight;
0042 
0043 % Top view
0044 subplot(2,2,3)
0045 vb_plot_surf(V,F,[0.8 0.7 0.6],'none',1);
0046 alpha(0.7)
0047 hold on
0048 vb_plot_surf(FV, Coord.FF, fwgcolor,edgecolor);
0049 plot3(HV(:,1),HV(:,2),HV(:,3),mtype,'MarkerSize',msize)
0050 view([0 90]); axis tight;
0051 
0052 % view
0053 subplot(2,2,4)
0054 vb_plot_surf(V,F,[0.8 0.7 0.6],'none',1);
0055 alpha(0.7)
0056 hold on
0057 vb_plot_surf(FV, Coord.FF, fwgcolor,edgecolor);
0058 plot3(HV(:,1),HV(:,2),HV(:,3),mtype,'MarkerSize',msize)
0059 view([120 30]); axis tight;
0060 
0061 % 元の画像に抽出した曲面を重ね合わせ
0062 
0063 % スライス画像表示の Z-座標リスト
0064 zindx = [40:20:200];
0065 % subplot の 数
0066 Nfig  = [3, 3];
0067 % Marker type
0068 Msize = 1;
0069 Mtype = 'y-';
0070 % triangle search distance from cut slice [mm]
0071 dmax = 10;
0072 %  2D plot mode for X-Y
0073 xymode = 1;
0074 
0075 if exist('imagefile','var')&&~isempty(imagefile)
0076     % Load 3D MRI image to analyze_right_hand coordinate
0077     [B, Vdim, Vsize] = vb_load_analyze_to_right(imagefile);
0078     FV = vb_spm_right_to_analyze_right( [FV], Vdim, Vsize);
0079     
0080     % Plot scan surface on MRI slice
0081     vb_plot_slice_surf(B, FV,Coord.FF, zindx,'z', Nfig,Mtype,dmax,xymode,Msize);
0082 end

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