Commit 48ea9bf4 authored by jayd1860's avatar jayd1860
Browse files

v1.48.4

-- Fix time exclusion and motion correction by channel having incorrect channel order. Modify tIncCh to include measurement list info about sources, detectors  and data type.
-- Fix display of time exclusion and motion correction by channel showing incorrect channels. Clean up and rewrite DisplayExcludedTime() function.
-- Improve speed of display function GetMeasurementList to use ml matrices instead of structures. Change definitions of GetMeasurementList() functions to be uniform and compatible with each other up and down the call stack, as well as having separate arguments for matrixOption ('matrix') and dataType ('dod', 'dc', dcAvg', etc).
-- Minor graphics adjustment to MainGUI datatype listboxes for wavelength and HbType to be exactly overlapping
parent f82ef896
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -670,7 +670,7 @@ classdef NirsClass < AcqDataClass & FileLoadSaveClass
        
        
        % ---------------------------------------------------------
        function ml = GetMeasurementList(obj, ~)
        function ml = GetMeasurementList(obj, ~, ~)
            ml = MeasListClass();
            for ii = 1:size(obj.SD.MeasList,1)
                ml(ii).sourceIndex = obj.SD.MeasList(ii,1);
+27 −18
Original line number Diff line number Diff line
@@ -390,18 +390,24 @@ classdef DataClass < FileLoadSaveClass
        
        
        % ---------------------------------------------------------
        function ml = GetMeasurementList(obj, option)
        function ml = GetMeasurementList(obj, matrixMode, reshape)
            ml = [];
            if ~exist('option','var')
                option = '';
            if ~exist('matrixMode','var')
                matrixMode = '';
            end
            if ~exist('reshape', 'var')
                reshape = '';
            end            
            hbTypes         = {'hbo','hbr','hbt'};
            if isempty(option)
            if isempty(matrixMode)
                ml = obj.measurementList;
            elseif strncmp(option,'matrix',length('matrix'))
            elseif strncmp(matrixMode,'matrix',length('matrix'))
                if ~isempty(obj.cache) && ~isempty(obj.cache.measurementListMatrix)
                    if strcmp(option,'matrix')
                    if strcmp(matrixMode,'matrix')
                        ml = obj.cache.measurementListMatrix;
                        if strcmp(reshape, 'reshape')
                            ml = sortrows(ml);
                        end
                        return
                    end
                end
@@ -423,6 +429,10 @@ classdef DataClass < FileLoadSaveClass
                
                % Cache the results to avoid recalculating
                obj.cache.measurementListMatrix = ml;
                if strcmp(reshape, 'reshape')
                    ml = sortrows(ml);
                end
                
            end
        end
        
@@ -448,7 +458,6 @@ classdef DataClass < FileLoadSaveClass
        
        % ---------------------------------------------------------
        function t = GetTime(obj)            
            
            t = obj.time;
        end
        
+5 −2
Original line number Diff line number Diff line
@@ -992,8 +992,11 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
        
        
        % ---------------------------------------------------------
        function ml = GetMeasurementList(obj, iBlk)
        function ml = GetMeasurementList(obj, matrixMode, iBlk)
            ml = [];
            if ~exist('matrixMode','var')
                matrixMode = '';
            end
            if ~exist('iBlk','var') || isempty(iBlk)
                iBlk = 1;
            end
@@ -1001,7 +1004,7 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
                return;
            end
            for ii = 1:length(iBlk)
                ml = [ml; obj.data(ii).measurementList];
                ml = [ml; obj.data(ii).GetMeasurementList(matrixMode)];
            end
        end
        
+28 −20
Original line number Diff line number Diff line
@@ -118,8 +118,8 @@ classdef ProcStreamClass < handle

        % ----------------------------------------------------------------------------------
        function B = isequal(obj, obj2)
            B = 0;
            if isa(obj2, 'ProcStream')
            B = false;
            if isa(obj2, 'ProcStreamClass')
                for ii=1:length(obj.fcalls)
                    if ii>length(obj2.fcalls)
                        return
@@ -167,8 +167,10 @@ classdef ProcStreamClass < handle
                        return;
                    end
                end
            else
                return
            end
            B = 1;
            B = true;
        end

        
@@ -1422,38 +1424,44 @@ classdef ProcStreamClass < handle
        
        
        % ---------------------------------------------------------
        function ml = GetMeasurementList(obj, options, iBlk)
        function ml = GetMeasurementList(obj, matrixMode, iBlks, dataType)
            ml = [];
            if ~exist('options','var')
                options = 'conc';
            if ~exist('matrixMode','var')
                matrixMode = '';
            end
            if ~exist('iBlk','var') || isempty(iBlk)
                iBlk = 1;
            if ~exist('iBlks','var') || isempty(iBlks)
                iBlks = 1;
            end
            for ii = 1:length(iBlk)
                switch(lower(options))
            if ~exist('dataType','var')
                dataType = 'conc';
            end
            for iBlk = 1:length(iBlks)
                switch(lower(dataType))
                    case 'od'
                        if ii <= length(obj.output.dod)
                            ml = [ml; obj.output.dod(ii).measurementList];
                        if iBlk <= length(obj.output.dod)
                            ml = [ml; obj.output.dod(iBlk).GetMeasurementList(matrixMode)];
                        end
                        break;
                    case {'conc','hb','hbo','hbr','hbt'}
                        if ii <= length(obj.output.dc)
                            ml = [ml; obj.output.dc(ii).measurementList];
                        if iBlk <= length(obj.output.dc)
                            ml = [ml; obj.output.dc(iBlk).GetMeasurementList(matrixMode)];
                        end
                        break;
                    case {'od hrf','od_hrf'}
                        if ii <= length(obj.output.dodAvg)
                            ml = [ml; obj.output.dodAvg(ii).measurementList];
                        if iBlk <= length(obj.output.dodAvg)
                            ml = [ml; obj.output.dodAvg(iBlk).GetMeasurementList(matrixMode)];
                        end
                        break;
                    case {'hb hrf','conc hrf','hb_hrf','conc_hrf'}
                        if ii <= length(obj.output.dcAvg)
                            ml = [ml; obj.output.dcAvg(ii).measurementList];
                        if iBlk <= length(obj.output.dcAvg)
                            ml = [ml; obj.output.dcAvg(iBlk).GetMeasurementList(matrixMode)];
                        end
                        break;
                end
            end
        end        
                
        
        
        % ---------------------------------------------------------
        function t = GetTHRF(obj, iBlk)
            t = [];
+15 −16
Original line number Diff line number Diff line
@@ -562,29 +562,28 @@ classdef TreeNodeClass < handle
        
        
        % ---------------------------------------------------------
        function ml = GetMeasurementList(obj, options, iBlk)
        function ml = GetMeasurementList(obj, matrixMode, iBlks, dataType)
            ml = [];
            if ~exist('options','var')
                options = 'RAW';
            if ~exist('matrixMode','var')
                matrixMode = '';
            end
            if ~exist('iBlk','var') || isempty(iBlk)
                iBlk = 1;
            if ~exist('dataType','var')
                dataType = 'raw';
            end
            for ii = 1:length(iBlk)
                switch(lower(options))
            if ~exist('iBlk','var') || isempty(iBlks)
                iBlks = 1;
            end
            for iBlk = 1:length(iBlks)
                switch(lower(dataType))
                    case 'raw'
                        if isempty(obj.acquired)
                            continue
                        end
                        ml = [ml; obj.acquired.GetMeasurementList(ii)]; %#ok<*AGROW>
                    case 'od'
                        ml = [ml; obj.procStream.GetMeasurementList('od',ii)];
                    case {'conc','hb','hbo','hbr','hbt'}
                        ml = [ml; obj.procStream.GetMeasurementList('conc',ii)];
                    case {'od hrf','od_hrf'}
                        ml = [ml; obj.procStream.GetMeasurementList('od hrf',ii)];
                    case {'hb hrf','conc hrf','hb_hrf','conc_hrf'}
                        ml = [ml; obj.procStream.GetMeasurementList('conc hrf',ii)];
                        ml = [ml; obj.acquired.GetMeasurementList(matrixMode, iBlk)]; %#ok<*AGROW>
                        break
                    otherwise
                        ml = [ml; obj.procStream.GetMeasurementList(matrixMode, iBlk, dataType)];
                        break
                end
            end
        end
Loading