emphasize_electrode_text

PURPOSE ^

EMPHASIZE_ELECTRODE_TEXT: ephazise the electrode

SYNOPSIS ^

function emphasize_electrode_text(elecs);

DESCRIPTION ^

 EMPHASIZE_ELECTRODE_TEXT: ephazise the electrode
   text on a "show_fem" plot
 emphasize_electrode_text(elecs)
   elecs => which elecs to emphasize (default, all)

 (C) 2005-2018 Andy Adler. License: GPL version 2 or version 3
 $Id: emphasize_electrode_text.m 6047 2019-12-31 20:15:47Z aadler $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function emphasize_electrode_text(elecs);
0002 % EMPHASIZE_ELECTRODE_TEXT: ephazise the electrode
0003 %   text on a "show_fem" plot
0004 % emphasize_electrode_text(elecs)
0005 %   elecs => which elecs to emphasize (default, all)
0006 %
0007 % (C) 2005-2018 Andy Adler. License: GPL version 2 or version 3
0008 % $Id: emphasize_electrode_text.m 6047 2019-12-31 20:15:47Z aadler $
0009 
0010 % FIXME: the view matrix is not easy to interpret. Fix dirn
0011 
0012 if (nargin>=1) && ischar(elecs) && strcmp(elecs,'UNIT_TEST'); do_unit_test; return; end
0013 
0014 hh = get(gca,'Children'); axis vis3d
0015 
0016 bgcolour = [1,1,1];
0017 % Don't really understand the view matrix
0018 %tmp = inv(view);
0019  tmp = view;
0020 dirn = tmp(1:3,3); dirn =  dirn'/norm(dirn);
0021 
0022 if nargin==0;
0023   elecs= 1:length(hh)'; % all of them
0024 end
0025 
0026 k=0;for hi = hh(:)'; k=k+1;
0027   if ~strcmp(get(hi,'Type'),'text'); 
0028      continue;
0029   end
0030   if ~any(str2num(get(hi,'String'))==elecs);
0031       continue;
0032   end
0033   set(hi, 'BackgroundColor', bgcolour);
0034   set(hi, 'FontSize', 12);
0035   pn = get(hi, 'Position');
0036   set(hi, 'Position', pn + dirn*10);
0037 end
0038 
0039 function do_unit_test
0040   fmdl = getfield(mk_common_model('n3r2',[16,2]),'fwd_model');
0041   subplot(221);
0042   show_fem(fmdl,[0,1]); view(0,0);
0043   emphasize_electrode_text();
0044   subplot(222);
0045   show_fem(fmdl,[0,1]); view(0,80);
0046   emphasize_electrode_text();
0047   subplot(223);
0048   show_fem(fmdl,[0,1]); view(50,80);
0049   emphasize_electrode_text();

Generated on Tue 31-Dec-2019 17:03:26 by m2html © 2005