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 6311 2022-04-20 18:44:44Z 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 6311 2022-04-20 18:44:44Z 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 = [0,0,1,0]*tmp; % move into view's z dir
0021 dirn = dirn(1:3);
0022 dirn = -dirn(:)'/norm(dirn);
0023 
0024 if nargin==0;
0025   elecs= 1:length(hh)'; % all of them
0026 end
0027 
0028 k=0;for hi = hh(:)'; k=k+1;
0029   if ~strcmp(get(hi,'Type'),'text'); 
0030      continue;
0031   end
0032   if ~any(str2num(get(hi,'String'))==elecs);
0033       continue;
0034   end
0035   set(hi, 'BackgroundColor', bgcolour);
0036   set(hi, 'FontSize', 12);
0037   pn = get(hi, 'Position');
0038   set(hi, 'Position', pn + dirn*1 );
0039 end
0040 
0041 function do_unit_test
0042   fmdl = getfield(mk_common_model('n3r2',[16,2]),'fwd_model');
0043   subplot(221);
0044   show_fem(fmdl,[0,1]); view(0,0); drawnow
0045 
0046   emphasize_electrode_text();
0047   subplot(222);
0048   show_fem(fmdl,[0,1]); view(0,80); drawnow
0049 
0050   emphasize_electrode_text();
0051   subplot(223);
0052   show_fem(fmdl,[0,1]); view(50,80); drawnow
0053 
0054   emphasize_electrode_text();

Generated on Fri 30-Dec-2022 19:44:54 by m2html © 2005