Commit f0384967 authored by jayd1860's avatar jayd1860
Browse files

v1.43.0

-- Set inactive channel data to NaN. That way they don't show up in MainGUI display. Implement this in DataClass: inactive channel is a channel for which all data is exactly zero (not approximately zero).

-- Fix an issue in ProbeClass which incorrectly upload sourcePos3D or detectorPos3D as a column vector IF AND ONLY IF it is the ONLY optode in the probe. This leads to incorrect result in at least one user function processing hmrR_OD2Conc in which the calculation of rho is sensitive to row vs column vector.

-- Fix several issues in incorrect unit tests results for Example9_SessRuns because of file naming in Simple_Probe_run* which contains '_' between Simple and Probe which are interpreted as a subject and session name. This is not how the original .nirs benchmark was processed based on the Simple_Probe*_. In order to match the original subject/session breakdown need to get rid of '_'.

-- Fix another unit test bug which has to load saved derived data in compareDcAvg.m before comparing to benchmark.

-- Fix another unit test bug in unitTest_BandpassFilt_LPF.m lpf wasn't being changed no matter what the value was because hmrR_BandpassFilter() changed to hmrR_BandpassFilter_old()

-- Add to unit tests simulation of occasional random errors (simulateDataError.m and generateErrorOddsConstant.m) to do a check of whether the unit test is really checking data against the benchmark correctly.
parent 54a831e5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -9,7 +9,8 @@ end
% with the file format's storage order.
if (~isrow(val) && ~iscolumn(val))              || ...      % Matrices
     ~isempty(findstr('multidim', options))     || ...      % Force multi-dimensional even if vector
     ~isempty(findstr('2D', options))                        % Force 2D even if vector
     ~isempty(findstr('2D', options))           || ...      % Force 2D even if vector
     ~isempty(findstr('3D', options))                       % Force 3D even if vector
    
    val = permute(val, ndims(val):-1:1);
    
+16 −2
Original line number Diff line number Diff line
@@ -576,9 +576,9 @@ classdef DataClass < FileLoadSaveClass
                        end
                    end
                end                
                
            end
            
            d = simulateDataError(d);
        end
        
        
@@ -593,6 +593,20 @@ classdef DataClass < FileLoadSaveClass
        
        
        
        % ---------------------------------------------------------
        function SetInactiveChannelData(obj)            
            for iMeas = 1:size(obj.dataTimeSeries,2)
                % We set the criteria for deciding if a channel is inactive if ALL it's 
                % data points are zero. Is this a safe assumption? Maybe we should create 
                % a config parameter for this?
                if all(obj.dataTimeSeries(:,iMeas) == 0)
                    obj.dataTimeSeries(:,iMeas) = obj.dataTimeSeries(:,iMeas)/0;
                end
            end
        end
        
        
        
        % ---------------------------------------------------------
        function SetTime(obj, val, datacheck)
            if ~exist('val','var')
+28 −3
Original line number Diff line number Diff line
@@ -169,9 +169,6 @@ classdef ProcResultClass < handle
            if isempty(filename)
                return;
            end
            if ~exist('options', 'var')
                options = '';
            end
            
            % It is important that this function can assume that the
            % filename path + '.mat' exists
@@ -188,6 +185,31 @@ classdef ProcResultClass < handle
        end
        
        
        
        % ----------------------------------------------------------------------------------
        function SetInactiveChannelData(obj)
            if isa(obj.dc, 'DataClass')
                obj.dc.SetInactiveChannelData();
            end
            if isa(obj.dod, 'DataClass')
                obj.dod.SetInactiveChannelData();
            end
            if isa(obj.dcAvg, 'DataClass')
                obj.dcAvg.SetInactiveChannelData();
            end
            if isa(obj.dodAvg, 'DataClass')
                obj.dodAvg.SetInactiveChannelData();
            end
            if isa(obj.dcAvgStd, 'DataClass')
                obj.dcAvgStd.SetInactiveChannelData();
            end
            if isa(obj.dodAvgStd, 'DataClass')
                obj.dodAvgStd.SetInactiveChannelData();
            end
        end

        
        
        % ----------------------------------------------------------------------------------
        function Save(obj, vars, filename, options)
            % options possible values:  
@@ -210,6 +232,9 @@ classdef ProcResultClass < handle
                end
            end
            
            obj.SetInactiveChannelData();
            
            
            % If file name is not an empty string, save results to file and  ree memory
            % to save memory space
            if isempty(obj.filename)
+365 B (26.1 KiB)

File changed.

No diff preview for this file type.

Loading