Commit 3efe331f authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.28.9

-- Fix bug where deleting functions in ProcstreamEditGUI does not work. More generally MenuBox which is used to in ProcStreamEditGUI pushbuttonSave_Callback to decide whether to copy changes to current proc stream stopped work correctly because of the change in MenuBox. Made it so that MenuBox change does not effect any current uses of MenuBox any other place except where the new MenuBox functionality is being used.

-- Check acquisition files for name change against the derived data in groupResults when loading data set. If name change detected then log warning but don't prompt user to do anything.

-- Fix bug where HRF checkbox in MainGUI is not disabled and unchecked when selecting current element that hasn't generated HRF. This used to work and was broken in a recent commit.

-- Add logger to AcqDataClass to be used in Derived classes SnirfClass and NirsClass.

-- Chenge description of conditions and number of trials in stim example in DesignNotes.ppt to make it a little clearer.
parent a3ddc0dd
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
classdef AcqDataClass < matlab.mixin.Copyable
       
    properties (Access = private)
        logger
    end
    
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % These methods must be implemented in any derived class
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -69,6 +73,13 @@ classdef AcqDataClass < matlab.mixin.Copyable
    
    methods
        
        % -------------------------------------------------------
        function Initialize(obj)
            global logger
            obj.logger = InitLogger(logger);
        end
        
        
        % -------------------------------------------------------
        function b = Error(obj)
            if obj.GetError()<0
@@ -174,6 +185,40 @@ classdef AcqDataClass < matlab.mixin.Copyable
        end
        
                
        % ----------------------------------------------------------------------------------
        function b = equal(obj, obj2)
            b = true;
            if isempty(obj.GetFilename)
                return;
            end
            if isempty(obj2.GetFilename)
                return;
            end
            [~, fname1, ext1] = fileparts(obj.GetFilename);
            [~, fname2, ext2] = fileparts(obj2.GetFilename);            
            if ~strcmpi([fname1, ext1], [fname2, ext2])
                b = false;
            end
        end
        
        
        % ----------------------------------------------------------------------------------
        function status = Mismatch(obj, obj2)
            status = 0;
            msg = {};
            if ~exist('obj2','var')
                return;
            end
            if ~obj.equal(obj2)
                [~, fname, ext] = fileparts(obj.GetFilename);
                msg{1} = sprintf('WARNING: The acquisition file "%s" does not match the derived data in this group folder. ', [fname, ext]);
                msg{2} = sprintf('Are you sure this acquisition file belongs in this group folder?');
                obj.logger.Write([msg{:}])
            end
        end
        
        
        
    end
    
end
+11 −6
Original line number Diff line number Diff line
classdef NirsClass < AcqDataClass & FileLoadSaveClass
    
    properties
        SD;
        t;
        s;
        d;
        aux;
        CondNames;
        SD
        t
        s
        d
        aux
        CondNames
    end    

    % Properties not part of the NIRS format. These parameters aren't loaded or saved to nirs files
@@ -81,6 +81,8 @@ classdef NirsClass < AcqDataClass & FileLoadSaveClass
        
        % -------------------------------------------------------
        function Initialize(obj)
            Initialize@AcqDataClass(obj);

            obj.SD        = struct([]);
            obj.t         = [];
            obj.s         = [];
@@ -240,6 +242,9 @@ classdef NirsClass < AcqDataClass & FileLoadSaveClass
                err=1;
                return;
            end
            if obj.Mismatch(obj2)
                return;
            end
            obj.SD         = obj2.SD;
            obj.t          = obj2.t;
            obj.d          = obj2.d;
+13 −0
Original line number Diff line number Diff line
@@ -223,6 +223,19 @@ classdef ProbeClass < FileLoadSaveClass
        % -------------------------------------------------------
        function B = eq(obj, obj2)
            B = false;
            if isempty(obj) && ~isempty(obj2)
                return;
            end
            if isempty(obj) && ~isempty(obj2)
                return;
            end
            if ~isempty(obj) && isempty(obj2)
                return;
            end
            if isempty(obj) && isempty(obj2)
                b = true;
                return;
            end
            if ~all(obj.wavelengths(:)==obj2.wavelengths(:))
                return;
            end
+10 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
        gid
        location
        nirsdatanum
        nirs_tb;
        nirs_tb
        stim0
    end
    
@@ -235,6 +235,8 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
        
        % -------------------------------------------------------
        function Initialize(obj)
            Initialize@AcqDataClass(obj)
            
            obj.formatVersion = '1.0';
            obj.metaDataTags   = MetaDataTagsClass().empty();
            obj.data           = DataClass().empty();
@@ -246,6 +248,7 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
        end
        
               
        
        % -------------------------------------------------------
        function err = Copy(obj, obj2)
            err=0;
@@ -253,6 +256,9 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
                err=1;
                return;
            end
            if obj.Mismatch(obj2)
                return;
            end
            obj.formatVersion = obj2.formatVersion;
            obj.metaDataTags  = CopyHandles(obj2.metaDataTags);
            obj.data          = CopyHandles(obj2.data);
@@ -265,7 +271,7 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
            catch
            end
            
            if ~isempty(obj2.GetFilename())
            if ~isempty(obj2.GetFilename()) && isempty(obj.GetFilename())
                obj.SetFilename(obj2.GetFilename());
            end
        end
@@ -341,7 +347,8 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
            formatVersionFile = str2double(formatVersionFile);
            formatVersionCurr = str2double(obj.formatVersion);
            if formatVersionFile < formatVersionCurr
                fprintf('Warning: Current SNIRF version is %0.1f. Cannot load older version (%0.1f) file. Backward compatibility not yet implemented ...\n', formatVersionCurr, formatVersionFile)
                obj.logger.Write(sprintf('Warning: Current SNIRF version is %0.1f. Cannot load older version (%0.1f) file. Backward compatibility not yet implemented ...\n', ...
                    formatVersionCurr, formatVersionFile));
                err = -2;
                return
            end
+5 −2
Original line number Diff line number Diff line
@@ -673,7 +673,7 @@ classdef TreeNodeClass < handle
            end
            status = 1;
                        
            configFileOptions =  MenuBox('',{},[],[], 'dontaskagain');
            configFileOptions =  MenuBox('',{},[],[], 'dontAskAgainOptions');
            choices = { ...
                sprintf('Continue Loading'); ...
                sprintf('Quit Loading'); ...
@@ -691,10 +691,13 @@ classdef TreeNodeClass < handle
                status = 0;
                return;
            end
            selection = MenuBox([msg{:}], choices, [], [], 'dontaskagain');
            selection = MenuBox([msg{:}], choices, [], [], 'dontAskAgainOptions');
            if selection(1)==1
                status = 0;
            end
            if length(selection)<2
                selection(2)=0;
            end
            
            % Find out if config value does not equal current selection. If
            % not then reset config value
Loading