Commit fab89a6c authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.31.5

-- Tweaks and bug fix to data tree loading that makes it work for a much improved fnirs data handling in AtlasViewer that allows the whole data tree to be seen and imaged. Added IsEmptyOutput method to Data Tree classes and allows any tree node to be loaded at init time whereas before only first run of first subject was able to be correctly loaded.
parent 9331b459
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ classdef DataTreeClass < handle
            % Load derived or post-acquisition data from a file if it
            % exists
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            obj.groups(iG).Load();
            obj.groups(iG).Load('init');
            
            %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            % Initialize procStream for all tree nodes
@@ -582,7 +582,7 @@ classdef DataTreeClass < handle
        
        
        % ----------------------------------------------------------
        function ResetAll(obj)
        function ResetAllGroups(obj)
            for ii = 1:length(obj.groups)
                obj.groups(ii).Reset()
            end
@@ -604,6 +604,24 @@ classdef DataTreeClass < handle
            b = false;
        end
        
        
        
        % ----------------------------------------------------------
        function b = IsEmptyOutput(obj)
            b = true;
            if obj.IsEmpty()
                return;
            end
            for ii = 1:length(obj.groups)
                if ~obj.groups(ii).IsEmptyOutput
                    b = false;
                    break;
                end
            end
        end
        
        
        
        % ----------------------------------------------------------
        function b = IsFlatFileDir(obj)
            if obj.files(1).isdir
+20 −5
Original line number Diff line number Diff line
@@ -546,6 +546,22 @@ classdef GroupClass < TreeNodeClass
        end

        
        
        % ----------------------------------------------------------------------------------
        function b = IsEmptyOutput(obj)
            b = true;
            if isempty(obj)
                return;
            end
            for ii = 1:length(obj.subjs)
                if ~obj.subjs(ii).IsEmptyOutput()
                    b = false;
                    break;
                end
            end
        end


    end   % Public methods
        
        
@@ -600,7 +616,7 @@ classdef GroupClass < TreeNodeClass
            
            % If this group has been loaded, then no need to go through the whole Load function. Instead 
            % default to the generic TreeNodeClass.Load method.
            if isempty(findstr('reload', options)) && ~obj.procStream.IsEmpty()
            if ~optionExists(options, {'init','reload'})
                err = obj.Load@TreeNodeClass();
                return;
            end
@@ -632,10 +648,9 @@ classdef GroupClass < TreeNodeClass
                obj.Copy(group, 'conditional');
                close(hwait);
            else
                group = obj; %#ok<NASGU>
                if exist([obj.path, obj.outputDirname, obj.outputFilename],'file')
                    obj.logger.Write(sprintf('Warning: This folder contains old version of processing results. Will move it to *_old.mat\n'));
                    [~,outputFilename] = fileparts(obj.outputFilename);
                    [~,outputFilename] = fileparts(obj.outputFilename); %#ok<*PROPLC>
                    movefile([obj.path, obj.outputDirname, obj.outputFilename], [obj.path, obj.outputDirname, outputFilename, '_old.mat'])
                end
                obj.Save();
@@ -657,7 +672,7 @@ classdef GroupClass < TreeNodeClass
                obj.logger.Write(sprintf('Auto-saving processing results ...\n'), obj.logger.ProgressBar(), hwait);
            end
            
            group = GroupClass(obj);
            group = GroupClass(obj); %#ok<NASGU>
            try 
                obj.CreateOutputDir();
                save([obj.pathOutputAlt, obj.outputDirname, obj.outputFilename], 'group');
+6 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ classdef FuncCallClass < handle
            %        argOut.str: 'dod'
            %         argIn.str: '(dod,t'
            %          paramIn: [1x2 ParamClass]
            %             help: '  Perform a bandpass filter'
            %             help: '  Perform a bandpass filter'
            %
            obj.name       = '';
            obj.nameUI     = '';
@@ -256,7 +256,7 @@ classdef FuncCallClass < handle
            %        argOut: 'dod'
            %         argIn.str: '(dod,t'
            %       paramIn: [1x2 ParamClass]
            %          help: '  Perform a bandpass filter'
            %          help: '  Perform a bandpass filter'
            %   
            obj.err = 0;            
            if nargin<2
@@ -621,6 +621,8 @@ classdef FuncCallClass < handle
            nbytes = sum(nbytes);
        end



        % ----------------------------------------------------------------------------------        
        function errmsg = CheckParams(obj)
            errmsg = '';
@@ -643,6 +645,8 @@ classdef FuncCallClass < handle
            end
        end
        


        % ----------------------------------------------------------------------------------        
        function val = GetVar(obj, name)
            val = [];
+12 −0
Original line number Diff line number Diff line
@@ -351,11 +351,23 @@ classdef ProcStreamClass < handle
            end
        end
        
        
        % ----------------------------------------------------------------------------------
        function b = IsEmptyOutput(obj)
            b = true;
            if obj.output.IsEmpty()
                return;
            end
            b = false;
        end


        % ----------------------------------------------------------------------------------
        function b = AcquiredDataModified(obj)
            b = obj.input.AcquiredDataModified();
        end
        
        
    end
    
    
+17 −1
Original line number Diff line number Diff line
@@ -225,6 +225,22 @@ classdef RunClass < TreeNodeClass
            b = false;
        end

        
        
        % ----------------------------------------------------------------------------------
        function b = IsEmptyOutput(obj)
            b = true;
            if isempty(obj)
                return;
            end
            obj.LoadDerivedData();
            if obj.procStream.IsEmptyOutput()
                return;
            end
            b = false;
        end


    end
    
    
Loading