Home > functions > job > job_edit_area_dir > job_edit_area_plotbrain.m

job_edit_area_plotbrain

PURPOSE ^

SYNOPSIS ^

function job_edit_area_plotbrain(plot_parm,V,F,inf_C,Iextract)

DESCRIPTION ^

 Plot brain model


 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:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function job_edit_area_plotbrain(plot_parm,V,F,inf_C,Iextract)
0002 %
0003 % Plot brain model
0004 %
0005 %
0006 % Copyright (C) 2011, ATR All Rights Reserved.
0007 % License : New BSD License(see VBMEG_LICENSE.txt)
0008 
0009 if isfield(plot_parm,'color') & ~isempty(plot_parm.color)
0010   fclr = plot_parm.color;
0011 else
0012   fclr = [0.8 0.8 0.8];
0013 end
0014 
0015 % Left/Right hemisphere
0016 switch plot_parm.LRflag
0017  case 'L'
0018   F0 = F.F3L;
0019  case 'R'
0020   F0 = F.F3R;
0021  case 'LR'
0022   F0 = F.F3;
0023 end
0024 
0025 % Select visible patches
0026 index = plot_parm.index;
0027 if length(index) == 0, FF = F0;
0028 else FF = vb_patch_select2(index,F0,size(V,1)); end; 
0029 
0030 if isempty(inf_C)
0031   % Display patches
0032   patch('Faces',FF,'Vertices',V,'FaceColor',fclr,...
0033     'FaceLighting','phong','EdgeColor','none');
0034   
0035   % Headlight
0036   camlight headlight
0037 else
0038   c = repmat(fclr,[length(inf_C) 1]) ...
0039       -0.4*[fclr(1)*inf_C fclr(2)*inf_C fclr(3)*inf_C];
0040   patch('Faces',FF,'Vertices',V,'FaceColor','interp',...
0041     'EdgeColor','none','FaceVertexCData',c);
0042 end
0043 material dull;
0044 hold on;
0045 
0046 % Display area
0047 plot_area(plot_parm,V,F0,Iextract);
0048 
0049 function plot_area(plot_parm,V,F0,Iextract);
0050 %
0051 % Îΰè¤Îɽ¼¨
0052 %
0053 alpha = 0.7;
0054 ix = Iextract;
0055 ix2 = intersect(ix,unique(F0(:)));
0056 FF = vb_patch_select2(ix,F0,size(V,1));
0057 patch('Faces',FF,'Vertices',V,'FaceAlpha',alpha,...
0058       'FaceColor','b','EdgeColor','none','FaceLighting','none');

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