get_3d_meas

PURPOSE ^

GET_3D_MEAS: extracts multiplane voltage measurements from a calculated

SYNOPSIS ^

function [voltageH,voltageV,indH,indV,df] = get_3d_meas(elec,vtx,V,Ib,no_pl);

DESCRIPTION ^

 GET_3D_MEAS: extracts multiplane voltage measurements from a calculated
 3D nodal potential distribution V inside a tank with (no_pl) electrode
 planes. Each plane holds the same number of electrodes. Only the
 non-current carring electrodes at the time are involved in the
 measurements.

 [voltageH,voltageV,indH,indV,df]=get_3d_meas(elec,vtx,V,Ib,no_pl);

elec      = The electrodes matrix
vtx       = The vertices
V         = The calculated forward solution
Ib        = The current patterns without the zeroes patch
no_pl     = The number of planes

voltage_H = Horrisontal (local plane) measurements
indH      = The two column matrix indicating the indices of the electrodes
            involved in voltage_H, e.g. indH = [2 3; 3 4; 4 5;...] implies
            voltage_H(1) = voltage(2) - volatge(3), etc
df        = Array indexing the (numbero of) measurements to their corresponding
                 current patterns.
voltage_V = Vertical interplanar measurements
indV      = ...

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [voltageH,voltageV,indH,indV,df] = get_3d_meas(elec,vtx,V,Ib,no_pl);
0002 % GET_3D_MEAS: extracts multiplane voltage measurements from a calculated
0003 % 3D nodal potential distribution V inside a tank with (no_pl) electrode
0004 % planes. Each plane holds the same number of electrodes. Only the
0005 % non-current carring electrodes at the time are involved in the
0006 % measurements.
0007 %
0008 % [voltageH,voltageV,indH,indV,df]=get_3d_meas(elec,vtx,V,Ib,no_pl);
0009 %
0010 %elec      = The electrodes matrix
0011 %vtx       = The vertices
0012 %V         = The calculated forward solution
0013 %Ib        = The current patterns without the zeroes patch
0014 %no_pl     = The number of planes
0015 %
0016 %voltage_H = Horrisontal (local plane) measurements
0017 %indH      = The two column matrix indicating the indices of the electrodes
0018 %            involved in voltage_H, e.g. indH = [2 3; 3 4; 4 5;...] implies
0019 %            voltage_H(1) = voltage(2) - volatge(3), etc
0020 %df        = Array indexing the (numbero of) measurements to their corresponding
0021 %                 current patterns.
0022 %voltage_V = Vertical interplanar measurements
0023 %indV      = ...
0024 
0025 
0026 warning('EIDORS:deprecated','GET_3D_MEAS is deprecated as of 06-Jun-2012. ');
0027 
0028 if size(V,2)~= size(Ib,2)
0029    error('Unmatched pattens')
0030 end
0031 
0032 [el_no,q] = size(elec);
0033 
0034 el_pp = el_no/no_pl;
0035 
0036 a=1:el_no;
0037 
0038 X = reshape(a,el_pp,no_pl)';
0039 
0040 
0041 Vm = V(size(vtx,1)+1:size(V,1),:); %Lower chunk of forward solution (complete electrode model)
0042 
0043 voltageH = [];
0044 indH = [];
0045 
0046 df = [];
0047 
0048 for w=1:size(Vm,2) %For each column of Vm
0049 
0050    cn = 0; %RESET the count of measurements per injection
0051 
0052    this_inj = Vm(:,w); %(no_of_electrodes x 1) vector
0053 
0054    for vv = 1:el_pp:el_no %i.e. 1 17 33 49 for 4 planes of 16 electrodes
0055 
0056       for t=vv:vv+(el_pp-1)-1 %t=1:15
0057 
0058          if Ib(t,w) == 0  && Ib(t+1,w) == 0   %Electrode not in the drive pair
0059 
0060             voltageH = [voltageH; (this_inj(t)-this_inj(t+1))];
0061             indH = [indH;[t , t+1]];
0062             cn = cn+1;
0063          end
0064 
0065          if t == vv+(el_pp-1)-1 && Ib(vv,w) == 0 && Ib(t+1,w) == 0
0066 
0067             voltageH = [voltageH; (this_inj(t+1))-this_inj(vv)]; %or is it vv=1;
0068             indH = [indH;[t+1, vv]];
0069             cn = cn+1;
0070          end
0071 
0072       end %for t -Measurements of the one plane
0073 
0074    end %for vv -Measurements for all electrode planes
0075 
0076    df = [df;cn];
0077 
0078    voltageV = [];
0079    indV = [];
0080 
0081    Y = reshape(X,el_no,1);
0082 
0083 
0084    cn = 0;
0085    wc = w;
0086 
0087 
0088    this_inj = Vm(:,wc); %(no_of_electrodes x 1) vector
0089 
0090    for ee = 1:no_pl:el_no
0091 
0092       this_chunk = Y(ee:ee+no_pl-1);
0093 
0094       for jj=1:length(this_chunk)-1
0095 
0096          if Ib(this_chunk(jj),wc) == 0 && Ib(this_chunk(jj+1),wc) == 0 %Electrodes not involved in currents
0097 
0098             voltageV = [voltageV; ((this_inj(this_chunk(jj)))- this_inj(this_chunk(jj+1)))];
0099             indV = [indV;[this_chunk(jj),this_chunk(jj+1)]];
0100             cn = cn+1;
0101          end
0102 
0103       end
0104 
0105    end
0106    df = [df;cn];
0107 end
0108 
0109 
0110 %voltage = [voltageH;voltageV];
0111 
0112 %ind = [indH;indV];
0113 
0114 % Separate df (Horrizontal / Vertical electrode combinations per current pattern as)
0115 % dfh = df(1:2:end);
0116 % dfv = df(2:2:end);
0117 
0118 
0119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0120 % This is part of the EIDORS suite.
0121 % Copyright (c) N. Polydorides 2003
0122 % Copying permitted under terms of GNU GPL
0123 % See enclosed file gpl.html for details.
0124 % EIDORS 3D version 2.0
0125 % MATLAB version 5.3 R11
0126 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0127

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