Unverified Commit 2eee17d4 authored by stephen scott tucker's avatar stephen scott tucker Committed by GitHub
Browse files

-- Update homer2 output for unit test with new versions of hmrR_OD2Conc and...


-- Update homer2 output for unit test with new versions of hmrR_OD2Conc and hmrR_MotionArtifact user functions (#27)

Co-authored-by: default avatarJay Dubb <jayd1860@gmail.com>
parent 563346d0
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -28,17 +28,20 @@
% Delta_OD_to_Conc: dc = hmrR_OD2Conc_new_Nirs( dod, SD, ppf )
%
% PARAMETERS:
% ppf: [1.0, 1.0]
% ppf: [1.0, 1.0, 1.0]
%
function dc = hmrR_OD2Conc_new_Nirs( dod, SD, ppf )

dc = [];
nWav = length(SD.Lambda);
ml = SD.MeasList;

if length(ppf)~=nWav
    errordlg('The length of PPF must match the number of wavelengths in SD.Lambda');
    dc = zeros(size(dod,1),3,length(find(ml(:,4)==1)));
    return
if length(ppf) < nWav
    errordlg('WARNING: Data contains more than 3 wavelengths. Using PPF value of 1 for all wavelengths.');
    ppf = ones(1, nWav);
elseif length(ppf) > nWav
    d = length(ppf)-nWav;
    ppf(end-d+1:end) = [];
end

if ~isempty(find(ppf==1))
+4 −1
Original line number Diff line number Diff line
@@ -46,6 +46,9 @@ for ii=1:length(dod)
    if length(ppf) < nWav
        errordlg('WARNING: Data contains more than 3 wavelengths. Using PPF value of 1 for all wavelengths.');
        ppf = ones(1, nWav);
    elseif length(ppf) > nWav
        d = length(ppf)-nWav;
        ppf(end-d+1:end) = [];
    end
    
    if ~isempty(find(ppf==1))
@@ -68,7 +71,7 @@ for ii=1:length(dod)
        if ppf(1)~=1
            y2(:,k:k+1) = ( einv * (y(:,[idx1 idx2'])./(ones(nTpts,1)*rho*ppf))' )';
        else
            y2(:,k:k+1) = ( einv * (y(:,[idx1 idx2'])./(ones(nTpts,nWav)))' )';
            y2(:,k:k+1) = ( einv * (y(:,[idx1 idx2'])./(ones(nTpts,1)))' )';
        end
        y2(:,k+2) = y2(:,k) + y2(:,k+1);
        dc(ii).AddChannelHbO(ml(idx1,1), ml(idx1,2));
Loading