get_multi_meas

PURPOSE ^

function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);

SYNOPSIS ^

function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);

DESCRIPTION ^

function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);

The function can be used in the occasions where plane current patterns 
(adjacent or polar) are adopted for systems with more planes, i.e. set by
set_multi_currents function. Only non-current carrying electrodes are 
involved in the measurements.
 


protocol= The selected protocol '{op}' or '{ad}'
elec    = The electrodes
no_pl   = The number of planes
I       = The RHS vectors, i.e., the current patterns padded with zeroes 
          for the forward calculations
V       = The forward solution
voltage = The array of measureemnts according to the selected protocol
ind     = The index of the measurements

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);
0002 %function [voltage,ind,df] = get_multi_meas(protocol,elec,V,I,vtx,no_pl);
0003 %
0004 %The function can be used in the occasions where plane current patterns
0005 %(adjacent or polar) are adopted for systems with more planes, i.e. set by
0006 %set_multi_currents function. Only non-current carrying electrodes are
0007 %involved in the measurements.
0008 %
0009 %
0010 %
0011 %protocol= The selected protocol '{op}' or '{ad}'
0012 %elec    = The electrodes
0013 %no_pl   = The number of planes
0014 %I       = The RHS vectors, i.e., the current patterns padded with zeroes
0015 %          for the forward calculations
0016 %V       = The forward solution
0017 %voltage = The array of measureemnts according to the selected protocol
0018 %ind     = The index of the measurements
0019 
0020 
0021 if size(V,2)~= size(I,2)
0022     error('Unmatched pattens')
0023 end
0024 
0025 
0026 no_el = size(elec,1);
0027 el_pp = no_el/no_pl;
0028 
0029 I = I(size(vtx,1)+1:end,:);  %Lower chunk
0030 Vm = V(size(vtx,1)+1:end,:); %Lower chunk
0031 
0032 
0033 voltage = [];
0034 ind = [];
0035 df = [];
0036 
0037 d = size(I,2); %Injections
0038 
0039 for i=1:d %for each injection
0040    
0041 cn = 0;
0042  
0043 L = [];
0044 fst = 0;
0045 kk=0;
0046 
0047 for ej=1:el_pp:no_el
0048    
0049    kk=ej-1;
0050    
0051    for ei=1:el_pp-1
0052       if ei==1
0053          fst = ej;
0054       end
0055       L = [L;[kk+ei kk+(ei+1)]];
0056    end
0057    L = [L;[fst fst+16-1]];
0058 end
0059 
0060 LMP = []; %Exclude measurements engaging electrodes from different electrodes
0061 
0062 for j=1:size(L,1)
0063    
0064    if ceil(L(j,1)/el_pp) == ceil(L(j,2)/el_pp)
0065       
0066       LMP = [LMP;L(j,:)];
0067    end
0068 end
0069 
0070 el_in = find(I(:,i)~=0); % The current carring electrodes
0071 
0072 LM =[];
0073 
0074 for k=1:size(LMP,1)
0075    if ismember(LMP(k,:),el_in) == [0 0]
0076       LM = [LM;LMP(k,:)]; %Modified list current carring electrodes removed.
0077    end
0078 end
0079 
0080 lf = size(LM,1);
0081 dd = lf/no_pl;
0082 
0083 LN = [];
0084 
0085 k=0;
0086 
0087 for in=1:dd:lf %   1    13    25    37
0088    
0089    k = k+1;
0090 
0091    th_LM = LM(in:in+dd-1,:); %size(th_LM) = (12 2)
0092    
0093    if protocol == '{op}'
0094           for j=1:size(th_LM,1)
0095           if th_LM(j,1)== intersect(find(I(:,i)>0),in:k*el_pp)+1
0096              LN = [th_LM(j:end,:);th_LM(1:j-1,:)];
0097            break;
0098           end
0099        end
0100    elseif protocol =='{ad}'
0101       for j=1:size(th_LM,1)
0102          if th_LM(j,1)== intersect(find(I(:,i)<0),in:k*el_pp)+1
0103              LN = [th_LM(j:end,:);th_LM(1:j-1,:)];
0104            break;
0105           end
0106        end
0107    else
0108       error('Protocol needs to be {op} or {ad}');
0109    end 
0110    
0111 for u=1:size(LN,1)
0112   voltage = [voltage; (Vm(LN(u,1),i)- Vm(LN(u,2),i))];
0113 end
0114 
0115    
0116    ind = [ind;LN];
0117    cn = cn+1;
0118       
0119 end %for in
0120 
0121 df = [df;cn];
0122 end %for injections
0123 
0124 
0125 
0126 
0127 
0128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0129 % This is part of the EIDORS suite.
0130 % Copyright (c) N. Polydorides 2003
0131 % Copying permitted under terms of GNU GPL
0132 % See enclosed file gpl.html for details.
0133 % EIDORS 3D version 2.0
0134 % MATLAB version 5.3 R11
0135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0136 
0137 
0138 
0139

Generated on Tue 09-Aug-2011 11:38:31 by m2html © 2005