Commit 16124b11 authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.22.1

-- Fix error handling bug in loading acquisition files to runs
parent a28e66fa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ SNIRF
On

% Last Checked For Update
12-Mar-1998 17:03:23
30-Jun-2020 10:48:25

% Check For Updates
on
+2 −2
Original line number Diff line number Diff line
@@ -39,11 +39,11 @@ classdef FileLoadSaveClass < matlab.mixin.Copyable
            switch(lower(format))
                case obj.supportedFomats.matlab
                    if ismethod(obj, 'LoadMat')
                        obj.LoadMat(filename);
                        obj.err = obj.LoadMat(filename);
                    end
                case obj.supportedFomats.hdf5
                    if ismethod(obj, 'LoadHdf5')
                        obj.LoadHdf5(filename, params);
                        obj.err = obj.LoadHdf5(filename, params);
                    end
            end
        end
+30 −8
Original line number Diff line number Diff line
@@ -114,34 +114,56 @@ classdef NirsClass < AcqDataClass & FileLoadSaveClass
               return;
            end                        
                        
            
                        
            warning('off', 'MATLAB:load:variableNotFound');
            fdata = load(fname,'-mat', 'SD','t','d','s','aux','CondNames');
            
            % Mandatory fields
            if isproperty(fdata,'d')
                obj.d = fdata.d;
                if isempty(obj.d)
                    err = -2;
                end
            else
                err = -2;
            end
            if isproperty(fdata,'t')
                obj.t = fdata.t;
                if ~isempty(obj.t)
                    obj.errmargin = min(diff(obj.t))/10;
                else
                    err = -3;                
                end
            else
                err = -3;
            end
            if isproperty(fdata,'SD')
                obj.SetSD(fdata.SD);
                if isempty(obj.SD)
                    err = -4;
                end
            else
                err = -4;
            end
            
            
            % Optional fields
            if isproperty(fdata,'s')
                obj.s = fdata.s;
                obj.SortStims();
            else
                obj.s = [];
            end
            if isproperty(fdata,'aux')
                obj.aux = fdata.aux;
            else
                obj.aux = [];
            end
            if isproperty(fdata,'CondNames')
                obj.CondNames = fdata.CondNames;
            else
                obj.InitCondNames();
            end
            if ~isempty(obj.t)
                obj.errmargin = min(diff(obj.t))/10;
            end
            obj.SortStims();
            
        end
        
        
+3 −2
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ classdef DataClass < FileLoadSaveClass
        
        % ---------------------------------------------------------
        function ml = GetMeasList(obj)
            ml = [];
            ml = ones(length(obj.measurementList), 4);
            for ii = 1:length(obj.measurementList)
                % If this data contains block average then only get the measurements for first condition. That will
                % contain all the measurement channels
@@ -230,6 +230,7 @@ classdef DataClass < FileLoadSaveClass
                end
                ml(ii,:) = [obj.measurementList(ii).GetSourceIndex(), obj.measurementList(ii).GetDetectorIndex(), 1, obj.measurementList(ii).GetWavelengthIndex()];
            end
            ml(ii+1:end,:) = [];
        end
        
        
+5 −7
Original line number Diff line number Diff line
@@ -404,13 +404,11 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
                %%%% Load formatVersion
                if obj.LoadFormatVersion() < 0
                    err = -2;
                    return;
                end
                
                %%%% Load metaDataTags
                if obj.LoadMetaDataTags(obj.fid) < 0
                    err = -3;
                    return;
                end
                
                %%%% Load data
Loading