Home > bioelectromagnetism > elec_distance_consec.m

elec_distance_consec

PURPOSE ^

elec_distance_consec - Identify distance between nearest neighbour electrodes

SYNOPSIS ^

function [C_e, C_d] = elec_distance_consec(dist_e, dist_d)

DESCRIPTION ^

 elec_distance_consec - Identify distance between nearest neighbour electrodes
 
 Requires input data generated by 'elec_distance.m'
 Assumes using FUSA CNL electrode positions (Scan ECI-Cap)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [C_e, C_d] = elec_distance_consec(dist_e, dist_d)
0002 
0003 % elec_distance_consec - Identify distance between nearest neighbour electrodes
0004 %
0005 % Requires input data generated by 'elec_distance.m'
0006 % Assumes using FUSA CNL electrode positions (Scan ECI-Cap)
0007 %
0008 
0009 % $Revision: 1.1 $ $Date: 2004/11/12 01:32:33 $
0010 
0011 % Licence:  GNU GPL, no implied or express warranties
0012 % History:  05/2000, Darren.Weber_at_radiology.ucsf.edu
0013 %
0014 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0015 
0016   fprintf('\n%s\n\n', 'Calculating consecutive electrode distances.');
0017 
0018 
0019   End_e = strvcat('3', '5', '7', '9', '13', '22', '30', '41', '49', '54', '59', '67', '78', '86', '97', '101', '108', '110', '115', '117', '120', '124');
0020 
0021   C_e = cell(0);
0022   C_d = [];
0023 
0024 
0025   for row = 1:length(dist_d)
0026      
0027      % Check that row in dist_d matrix is non-zero
0028 
0029      NonZeroColumns = find(dist_d(row,:));
0030 
0031      if ~isempty(NonZeroColumns)
0032 
0033       % Calculate consecutive electrode distance,
0034       % excluding end electrodes defined in End_e
0035         
0036         if( (row+1) <= length(dist_e) )
0037      
0038             e = str2num(char(dist_e(row,row+1)));
0039             
0040             if(strmatch(num2str(e(1)), End_e, 'exact'))
0041     
0042                 % found end electrode, do nothing
0043             else
0044 
0045                 C_d(end + 1) = dist_d(row,row+1);
0046                                 C_e(end + 1) = {num2str(e(1))};
0047             end
0048         end
0049     end
0050   end
0051   clear r x;

Generated on Mon 15-Aug-2005 15:36:19 by m2html © 2003