Commit ab0fe489 authored by jayd1860's avatar jayd1860
Browse files

v1.48.0

-- Fix very slow processing at the group, subject and session levels and slow display. All were caused by the same issue: very inefficient DataClass.GetDataTimeSeries('reshape') method. Changed it's code to be much more efficient.
-- Fix typo in plotProbeAndSetProperties.m causing matlab-generated error
-- Minor improvement to display of location of current processing in MainGUI listboxGroupTree when calculating provcessing stream
parent 150061c6
Loading
Loading
Loading
Loading
+27 −57
Original line number Diff line number Diff line
@@ -488,6 +488,7 @@ classdef DataClass < FileLoadSaveClass
            nWavelengths    = length(wavelengths);
            nDataTypeLabels = length(dataTypeLabels);
            nCond           = length(conditions);
            measurementList = obj.GetMeasurementList('matrix');            
            ml              = obj.GetMeasListSrcDetPairs('reshape');
            
            kk = 1;
@@ -497,24 +498,17 @@ classdef DataClass < FileLoadSaveClass
                    for iS = 1:length(srcs)
                        for iD = 1:length(dets)
                            
                            for ii = 1:length(obj.measurementList)
                                if obj.measurementList(ii).sourceIndex == srcs(iS) && ...
                                   obj.measurementList(ii).detectorIndex == dets(iD) &&  ...
                                   obj.measurementList(ii).wavelengthIndex == iWl
                                    
                            k = find(measurementList(:,1)==srcs(iS) & measurementList(:,2)==dets(iD) & measurementList(:,4)==iWl);
                            if ~isempty(k)
                                iSrcDetPair = find(ml(:,1)==srcs(iS) & ml(:,2)==dets(iD));
                                    d(:, iWl, iSrcDetPair) = obj.dataTimeSeries(:,ii); %#ok<*FNDSB>
                                    
                                    order(kk) = ii;
                                d(:, iWl, iSrcDetPair) = obj.dataTimeSeries(:,k); %#ok<*FNDSB>
                                order(kk) = k;
                                kk = kk+1;
                                    break;

                            end
                            
                        end
                    end
                end
                end
                
            elseif nWavelengths > 0 && nCond > 0 
                
@@ -523,20 +517,12 @@ classdef DataClass < FileLoadSaveClass
                        for iD = 1:length(dets)
                            for iCond = 1:nCond
                            
                                for ii = 1:length(obj.measurementList)
                                    if obj.measurementList(ii).sourceIndex == srcs(iS) && ...
                                       obj.measurementList(ii).detectorIndex == dets(iD) &&  ...
                                       obj.measurementList(ii).wavelengthIndex == iWl && ...
                                       obj.measurementList(ii).dataTypeIndex == iCond
                                        
                                k = find(measurementList(:,1)==srcs(iS) & measurementList(:,2)==dets(iD) & measurementList(:,3)==iCond &  measurementList(:,4)==iWl);
                                if ~isempty(k)
                                    iSrcDetPair = find(ml(:,1)==srcs(iS) & ml(:,2)==dets(iD));
                                        d(:, iWl, iSrcDetPair, iCond) = obj.dataTimeSeries(:,ii);
                                        
                                        order(kk) = ii;
                                    d(:, iWl, iSrcDetPair, iCond) = obj.dataTimeSeries(:,k);
                                    order(kk) = k;
                                    kk = kk+1;
                                        break;

                                    end
                                end

                            end     
@@ -550,20 +536,12 @@ classdef DataClass < FileLoadSaveClass
                    for iS = 1:length(srcs)
                        for iD = 1:length(dets)
                            
                            for ii = 1:length(obj.measurementList)
                                if obj.measurementList(ii).sourceIndex == srcs(iS) && ...
                                   obj.measurementList(ii).detectorIndex == dets(iD) && ...
                                   ~isempty(strfind(lower(obj.measurementList(ii).dataTypeLabel), hbTypes{iHbType}))

                            k = find(measurementList(:,1)==srcs(iS) & measurementList(:,2)==dets(iD) & measurementList(:,4)==iHbType);
                            if ~isempty(k)
                                iSrcDetPair = find(ml(:,1)==srcs(iS) & ml(:,2)==dets(iD));
                                    d(:, iHbType, iSrcDetPair) = obj.dataTimeSeries(:,ii);

                                    order(kk) = ii;
                                d(:, iHbType, iSrcDetPair) = obj.dataTimeSeries(:,k);
                                order(kk) = k;
                                kk = kk+1;
                                    break;

                                end

                            end
                            
                        end
@@ -577,20 +555,12 @@ classdef DataClass < FileLoadSaveClass
                        for iD = 1:length(dets)
                            for iCond = 1:nCond

                                for ii = 1:length(obj.measurementList)
                                    if obj.measurementList(ii).sourceIndex == srcs(iS) && ...
                                       obj.measurementList(ii).detectorIndex == dets(iD) &&  ...
                                       ~isempty(strfind(lower(obj.measurementList(ii).dataTypeLabel), hbTypes{iHbType})) && ...
                                       obj.measurementList(ii).dataTypeIndex == iCond
                                        
                                k = find(measurementList(:,1)==srcs(iS) & measurementList(:,2)==dets(iD) & measurementList(:,3)==iCond &  measurementList(:,4)==iHbType);
                                if ~isempty(k)
                                    iSrcDetPair = find(ml(:,1)==srcs(iS) & ml(:,2)==dets(iD));
                                        d(:, iHbType, iSrcDetPair, iCond) = obj.dataTimeSeries(:,ii);
                                        
                                        order(kk) = ii;
                                    d(:, iHbType, iSrcDetPair, iCond) = obj.dataTimeSeries(:,k);
                                    order(kk) = k;
                                    kk = kk+1;
                                        break;

                                    end
                                end
                                
                            end     
+5 −6
Original line number Diff line number Diff line
@@ -579,6 +579,10 @@ classdef GroupClass < TreeNodeClass
                tHRF_common = obj.subjs(iSubj).procStream.output.GeneratetHRFCommon(tHRF_common);
            end
           
            % Update call application GUI using it's generic Update function
            if ~isempty(obj.updateParentGui)
                obj.updateParentGui('DataTreeClass', [obj.iGroup, obj.iSubj, obj.iSess, obj.iRun]);
            end
                        
            % Load all the output valiraibles that might be needed by procStream.Calc() to calculate proc stream for this group
            obj.LoadInputVars(tHRF_common); 
@@ -590,11 +594,6 @@ classdef GroupClass < TreeNodeClass
                obj.logger.Write('\n');
            end
            
            % Update call application GUI using it's generic Update function
            if ~isempty(obj.updateParentGui)
                obj.updateParentGui('DataTreeClass', [obj.iGroup, obj.iSubj, obj.iSess, obj.iRun]);
            end
            
        end
        
        
+5 −6
Original line number Diff line number Diff line
@@ -332,6 +332,10 @@ classdef SessClass < TreeNodeClass
                tHRF_common = obj.runs(iRun).procStream.output.GeneratetHRFCommon(tHRF_common);
            end
            
            % Update call application GUI using it's generic Update function 
            if ~isempty(obj.updateParentGui)
                obj.updateParentGui('DataTreeClass', [obj.iGroup, obj.iSubj, obj.iSess, obj.iRun]);
            end
            
            % Load all the variables that might be needed by procStream.Calc() to calculate proc stream for this session
            obj.LoadInputVars(tHRF_common);
@@ -343,11 +347,6 @@ classdef SessClass < TreeNodeClass
                fprintf('\n');
            end
                        
            % Update call application GUI using it's generic Update function 
            if ~isempty(obj.updateParentGui)
                obj.updateParentGui('DataTreeClass', [obj.iGroup, obj.iSubj, obj.iSess, obj.iRun]);
            end
            
        end
               
        
+5 −6
Original line number Diff line number Diff line
@@ -363,6 +363,10 @@ classdef SubjClass < TreeNodeClass
                tHRF_common = obj.sess(iSess).procStream.output.GeneratetHRFCommon(tHRF_common);
            end
            
            % Update call application GUI using it's generic Update function 
            if ~isempty(obj.updateParentGui)
                obj.updateParentGui('DataTreeClass', [obj.iGroup, obj.iSubj, obj.iSess, obj.iRun]);
            end
            
            % Load all the variables that might be needed by procStream.Calc() to calculate proc stream for this subject
            obj.LoadInputVars(tHRF_common);
@@ -374,11 +378,6 @@ classdef SubjClass < TreeNodeClass
                fprintf('\n');
            end
                        
            % Update call application GUI using it's generic Update function 
            if ~isempty(obj.updateParentGui)
                obj.updateParentGui('DataTreeClass', [obj.iGroup, obj.iSubj, obj.iSess, obj.iRun]);
            end
            
        end
                
        
+2 −2
Original line number Diff line number Diff line
@@ -93,8 +93,8 @@ if ~isempty(plotprobe.y{iBlk})
    if ~isempty(plotprobe.y{iBlk})
        plotprobe.y{iBlk} = plotprobe.y{iBlk}(:,k);
    end
    if ~isempty(plotprobe.y{iBlk})
        plotprobe.ystd{iBlk} = plotprobe.y{iBlk}(:,k);
    if ~isempty(plotprobe.ystd{iBlk})
        plotprobe.ystd{iBlk} = plotprobe.ystd{iBlk}(:,k);
    end
    if ~isempty(plotprobe.ml{iBlk})
        plotprobe.ml{iBlk} = plotprobe.ml{iBlk}(k,:);
Loading