plot vertex on Analyze slice image V : Vertex 3D-coordinate [ Nvertex, 3 ] val : Amplitude at each vertex [ Nvertex, 1 ] indx : slice index in vdim-axis dz : slice width V(:,az) >= (indx-dz) & V(:,az) <= (indx+dz) vdim : slice cut direction = 'x' : Sagittal cut : Y-Z plane = 'y' : Coronal cut : X-Z plane = 'z' : Transverse (Axial) cut : X-Y plane mode : 2D plot mode for X-Y = 0 : plot without transpose = 1 : plot by transposing 2D-image matrix Msize : Marker size Mtype : Marker type Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function vb_plot_value_slice(V, val, vdim, indx, dz, Msize, mode) 0002 % plot vertex on Analyze slice image 0003 % 0004 % V : Vertex 3D-coordinate [ Nvertex, 3 ] 0005 % val : Amplitude at each vertex [ Nvertex, 1 ] 0006 % indx : slice index in vdim-axis 0007 % dz : slice width 0008 % V(:,az) >= (indx-dz) & V(:,az) <= (indx+dz) 0009 % vdim : slice cut direction 0010 % = 'x' : Sagittal cut : Y-Z plane 0011 % = 'y' : Coronal cut : X-Z plane 0012 % = 'z' : Transverse (Axial) cut : X-Y plane 0013 % mode : 2D plot mode for X-Y 0014 % = 0 : plot without transpose 0015 % = 1 : plot by transposing 2D-image matrix 0016 % Msize : Marker size 0017 % Mtype : Marker type 0018 % 0019 % Copyright (C) 2011, ATR All Rights Reserved. 0020 % License : New BSD License(see VBMEG_LICENSE.txt) 0021 0022 % written by M. Sato 2005-8-1 0023 0024 if nargin<5, dz=1.5; end; 0025 if nargin<6, Msize=1; end; 0026 if nargin<7, mode=0; end; 0027 0028 switch vdim 0029 case 'x', 0030 % 'SAG' : Sagittal cut : Y-Z plane 0031 ax = 2; 0032 ay = 3; 0033 az = 1; 0034 case 'y', 0035 % 'COR' : Coronal cut : X-Z plane 0036 ax = 1; 0037 ay = 3; 0038 az = 2; 0039 case 'z', 0040 % 'TRN' : Transverse (Axial) cut : X-Y plane 0041 ax = 1; 0042 ay = 2; 0043 az = 3; 0044 end 0045 0046 % vertex plot 0047 ix = find( V(:,az) >= (indx-dz) & V(:,az) < (indx+dz)); 0048 Nv = length(ix); 0049 0050 switch mode 0051 case 0, 0052 X = V(ix,ax); 0053 Y = V(ix,ay); 0054 case 1, 0055 X = V(ix,ay); 0056 Y = V(ix,ax); 0057 end 0058 0059 colmap=colormap('jet'); 0060 0061 val = fix(val(ix)/max(val)*63)+1; 0062 h = scatter(X,Y,Msize,colmap(val,:),'.'); 0063 0064 colormap('gray');