Home > functions > plotfunc > vb_plot_fit_vivid.m

vb_plot_fit_vivid

PURPOSE ^

Plot Vivid face fit

SYNOPSIS ^

function vb_plot_fit_vivid(V,F,Coord,trans_mat,imagefile)

DESCRIPTION ^

 Plot Vivid face fit
   vb_plot_fit_vivid(V,F,Coord,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_vivid(V,F,Coord,trans_mat,imagefile)
0002 % Plot Vivid face fit
0003 %   vb_plot_fit_vivid(V,F,Coord,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 
0011 LV = []; LF = [];
0012 RV = []; RF = [];
0013 FV = []; FF = [];
0014 
0015 if isfield(Coord,'LV')
0016     LV = vb_affine_trans(Coord.LV, trans_mat);
0017     LF = Coord.LF;
0018 end
0019 if isfield(Coord,'RV')
0020     RV = vb_affine_trans(Coord.RV, trans_mat);
0021     RF = Coord.RF;
0022 end
0023 if isfield(Coord,'FV')
0024     FV = vb_affine_trans(Coord.FV, trans_mat);
0025     FF = Coord.FF;
0026 end
0027 
0028 %view([180, 0]);    % Front view (from +Y axis)
0029 %view([ 90, 0]);    % Right view (from +X axis)
0030 %view([-90, 0]);    % Left view  (from -X axis)
0031 %view([  0, 90]);    % Top view   (from +Z axis)
0032 
0033 figure;
0034 
0035 % Right view
0036 subplot(2,2,1)
0037 vb_plot_surf(V,F,[0.8 0.7 0.6],'none',1);
0038 alpha(0.7)
0039 hold on
0040 vb_plot_surf(LV, LF, fwgcolor,edgecolor);
0041 vb_plot_surf(RV, RF, fwgcolor,edgecolor);
0042 vb_plot_surf(FV, FF, fwgcolor,edgecolor);
0043 view([90 0]); axis tight;
0044 
0045 % Front view
0046 subplot(2,2,2)
0047 vb_plot_surf(V,F,[0.8 0.7 0.6],'none',1);
0048 alpha(0.7)
0049 hold on
0050 vb_plot_surf(LV, LF, fwgcolor,edgecolor);
0051 vb_plot_surf(RV, RF, fwgcolor,edgecolor);
0052 vb_plot_surf(FV, FF, fwgcolor,edgecolor);
0053 view([180 0]); axis tight;
0054 
0055 % Top view
0056 subplot(2,2,3)
0057 vb_plot_surf(V,F,[0.8 0.7 0.6],'none',1);
0058 alpha(0.7)
0059 hold on
0060 vb_plot_surf(LV, LF, fwgcolor,edgecolor);
0061 vb_plot_surf(RV, RF, fwgcolor,edgecolor);
0062 vb_plot_surf(FV, FF, fwgcolor,edgecolor);
0063 view([0 90]); axis tight;
0064 
0065 % view
0066 subplot(2,2,4)
0067 vb_plot_surf(V,F,[0.8 0.7 0.6],'none',1);
0068 alpha(0.7)
0069 hold on
0070 vb_plot_surf(LV, LF, fwgcolor,edgecolor);
0071 vb_plot_surf(RV, RF, fwgcolor,edgecolor);
0072 vb_plot_surf(FV, FF, fwgcolor,edgecolor);
0073 view([120 30]); axis tight;
0074 
0075 % 元の画像に抽出した曲面を重ね合わせ
0076 
0077 % スライス画像表示の Z-座標リスト
0078 zindx = [40:20:200];
0079 % subplot の 数
0080 Nfig  = [3, 3];
0081 % Marker type
0082 Mtype = 'y-';
0083 % triangle search distance from cut slice [mm]
0084 dmax = 10;
0085 %  2D plot mode for X-Y
0086 xymode = 1;
0087 
0088 if exist('imagefile','var')&&~isempty(imagefile)
0089     % Load 3D MRI image to analyze_right_hand coordinate
0090     [B, Vdim, Vsize] = vb_load_analyze_to_right(imagefile);
0091     
0092     % Plot Vivid surface on MRI slice
0093     if ~isempty(LV)
0094         LV = vb_spm_right_to_analyze_right( [LV], Vdim, Vsize);
0095         vb_plot_slice_surf(B, LV, LF, zindx,'z', Nfig, Mtype, dmax, xymode);
0096     end
0097     if ~isempty(RV)
0098         RV = vb_spm_right_to_analyze_right( [RV], Vdim, Vsize);
0099         vb_plot_slice_surf(B, RV, RF, zindx,'z', Nfig, Mtype, dmax, xymode);
0100     end
0101     if ~isempty(FV)
0102         FV = vb_spm_right_to_analyze_right( [FV], Vdim, Vsize);
0103         vb_plot_slice_surf(B, FV, FF, zindx,'z', Nfig, Mtype, dmax, xymode);
0104     end
0105 end

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