Plot scan face on MRI slice to check fitting vb_plot_slice_fit(digitizerfile,imagefile,trans_mat) --- Input digitizerfile imagefile trans_mat : Afine matrix to transform digitizer to MRI coordinate 2006/10/20 M. Sato Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function vb_plot_slice_fit(digitizerfile,imagefile,trans_mat) 0002 % Plot scan face on MRI slice to check fitting 0003 % vb_plot_slice_fit(digitizerfile,imagefile,trans_mat) 0004 % --- Input 0005 % digitizerfile 0006 % imagefile 0007 % trans_mat : Afine matrix to transform digitizer to MRI coordinate 0008 % 0009 % 2006/10/20 M. Sato 0010 % 0011 % Copyright (C) 2011, ATR All Rights Reserved. 0012 % License : New BSD License(see VBMEG_LICENSE.txt) 0013 0014 % スライス画像表示の Z-座標リスト 0015 zindx = [40:20:200]; 0016 % subplot の 数 0017 Nfig = [3, 3]; 0018 % Marker size 0019 Msize = 4; 0020 Mtype = 'y-'; 0021 % search distance from cut slice [mm] 0022 dmax = 10; 0023 % 2D plot mode for X-Y 0024 xymode = 1; 0025 0026 % 0027 % --- Load digitizer head position 0028 % 0029 load(digitizerfile,'digitizer','Coord') 0030 0031 % Transform head position 0032 if isfield(digitizer,'head'), 0033 HV = vb_affine_trans(digitizer.head.pos, trans_mat); 0034 else 0035 HV = []; 0036 end 0037 0038 % Transform digitizer face surface 0039 if exist('Coord','var'), 0040 FV = vb_affine_trans(Coord.FV, trans_mat); 0041 else 0042 FV = []; 0043 end 0044 0045 % 元の画像に抽出した曲面を重ね合わせ 0046 0047 % Load 3D MRI image to analyze_right_hand coordinate 0048 [B, Vdim, Vsize] = vb_load_analyze_to_right(imagefile); 0049 0050 if ~isempty(HV) 0051 % Change vertex coordinate to analyze_right_hand coordinate 0052 HV = vb_spm_right_to_analyze_right( HV, Vdim, Vsize); 0053 end 0054 if ~isempty(FV) 0055 % Change vertex coordinate to analyze_right_hand coordinate 0056 FV = vb_spm_right_to_analyze_right( FV, Vdim, Vsize); 0057 end 0058 0059 % Plot head position on MRI slice 0060 vb_plot_slice( B, HV, zindx, xymode, Nfig, Msize); 0061 0062 % Plot digitizer face surface on MRI slice 0063 vb_plot_slice_surf([], FV,Coord.FF, zindx,'z', Nfig, Mtype, dmax, xymode); 0064