Plot surface on MRI slice image -- Syntax vb_plot_slice_surf( B, V, F, indx, vdim) h = vb_plot_slice_surf( B, V, F, indx, vdim, Nfig, Mtype, dmax, xymode, Msize) -- Input B : 3D-image if B = [], only surface section is plotted V : vertex coordinate in analyze_right voxcel coordinate F : patch index --- Optinal Input ( = Default) indx : slice index to plot ( = [140:10:190]) vdim : axis to cut slice ( = 'z') : 'x' or 'y' or 'z' Nfig : # of subplot ( = [3, 3]) Mtype : Line style ( = 'y-') Msize : Line width ( = 1) dmax : search distance from cut slice ( = 5) xymode : 2D plot mode for X-Y ( = 0) = 0 : plot without transpose = 1 : plot by transposing 2D-image matrix -- Output h : figure handle --- Related function vb_plot_slice( B, V, zindx, vertex_mode, Nsubfig, Msize) 2006/10/20 M. Sato Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function fh = vb_plot_slice_surf(B,V,F,indx,vdim,Nsubfig,Mtype,dmax,xymode,Msize) 0002 % Plot surface on MRI slice image 0003 % -- Syntax 0004 % vb_plot_slice_surf( B, V, F, indx, vdim) 0005 % h = vb_plot_slice_surf( B, V, F, indx, vdim, Nfig, Mtype, dmax, xymode, Msize) 0006 % 0007 % -- Input 0008 % B : 3D-image 0009 % if B = [], only surface section is plotted 0010 % V : vertex coordinate in analyze_right voxcel coordinate 0011 % F : patch index 0012 % --- Optinal Input ( = Default) 0013 % indx : slice index to plot ( = [140:10:190]) 0014 % vdim : axis to cut slice ( = 'z') 0015 % : 'x' or 'y' or 'z' 0016 % Nfig : # of subplot ( = [3, 3]) 0017 % Mtype : Line style ( = 'y-') 0018 % Msize : Line width ( = 1) 0019 % dmax : search distance from cut slice ( = 5) 0020 % xymode : 2D plot mode for X-Y ( = 0) 0021 % = 0 : plot without transpose 0022 % = 1 : plot by transposing 2D-image matrix 0023 % -- Output 0024 % h : figure handle 0025 % --- Related function 0026 % vb_plot_slice( B, V, zindx, vertex_mode, Nsubfig, Msize) 0027 % 0028 % 2006/10/20 M. Sato 0029 % 0030 % Copyright (C) 2011, ATR All Rights Reserved. 0031 % License : New BSD License(see VBMEG_LICENSE.txt) 0032 0033 if ~exist('vdim'), vdim = 'z'; end 0034 if ~exist('indx'), indx = [140:10:190]; end 0035 if ~exist('Nsubfig'), Nsubfig = [3, 3] ; end 0036 if ~exist('Mtype'), Mtype = 'y-'; end 0037 if ~exist('Msize'), Msize = 1; end 0038 if ~exist('dmax'), dmax = 5; end 0039 if ~exist('xymode','var'), xymode = 0; end; 0040 0041 NX=Nsubfig(1); 0042 NY=Nsubfig(2); 0043 0044 Nfig = length(indx); 0045 0046 if ~isempty(B) 0047 nfig = NX*NY; 0048 else 0049 nfig = 0; 0050 end 0051 0052 fh = []; 0053 0054 for n=1:Nfig 0055 if nfig==NX*NY, 0056 h = figure; nfig=1; fh = [fh, h]; 0057 else 0058 nfig=nfig+1; 0059 end; 0060 0061 subplot(NY,NX,nfig); 0062 0063 % MRI slice plot 0064 if ~isempty(B) 0065 vb_plot_3d_image(B, indx(n), vdim, xymode); 0066 axis('equal'); 0067 axis('tight'); 0068 title([vdim '-slice (' num2str(indx(n),3) ')']) 0069 colormap(gray); 0070 hold on 0071 end 0072 % xlabel('X'); 0073 % ylabel('Y'); 0074 0075 % Plot intersection of surface 0076 if ~isempty(V) 0077 vb_plot_cross_section(V,F,indx(n),vdim,dmax,Msize,Mtype,xymode); 0078 end 0079 end; 0080 0081 colormap(gray); 0082 %colormap(jet); 0083 0084