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

v1.31.2

-- Fix StimClass loading stims from .snirf file incorrectly because one of the stim names passed as an argument ('Same in this case') was icorrectly interpreted as a file name instead of condition name because the file ('same.m') was found in the Matlab search path. This caused an error. The fix was to replace matlab's exist() function with our own ispathvalid() which does the correct thing to identify whether a string is a valid pathname.

-- Fix incomplete fix to calculating bbox in DisplayAxesSDG. The bug was that the when clicking on channels in MainGUI axesSDG they would not be shown in colors but remained gray even though it seemed like they were being selected because their data showed up in axesData
parent 30c673df
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -27,7 +27,10 @@ classdef StimClass < FileLoadSaveClass
                if isa(varargin{1}, 'StimClass')
                    obj.Copy(varargin{1});
                elseif ischar(varargin{1})
                    if exist(varargin{1}, 'file')==2
                    % NOTE: exist can fail to work properly for the purposes of local group folder,
                    % if file name in question is somewhere (anywhere!) in the search path. Theerfore 
                    % we replace exist with our own function. 
                    if ispathvalid(varargin{1}, 'file')
                        obj.SetFilename(varargin{1});
                        obj.Load(varargin{1});
                    else
@@ -73,7 +76,7 @@ classdef StimClass < FileLoadSaveClass
        function err = LoadHdf5(obj, fileobj, location)
            
            % Arg 1
            if ~exist('fileobj','var') || (ischar(fileobj) && ~exist(fileobj,'file'))
            if ~exist('fileobj','var') || (ischar(fileobj) && ~ispathvalid(fileobj,'file'))
                fileobj = '';
            end
                        
@@ -154,7 +157,7 @@ classdef StimClass < FileLoadSaveClass
                location = ['/',location];
            end

            if ~exist(fileobj, 'file')
            if ~ispathvalid(fileobj, 'file')
                fid = H5F.create(fileobj, 'H5F_ACC_TRUNC', 'H5P_DEFAULT', 'H5P_DEFAULT');
                H5F.close(fid);
            end
@@ -175,7 +178,7 @@ classdef StimClass < FileLoadSaveClass
                
        % -------------------------------------------------------
        function Update(obj, fileobj, location)
            if ~exist(fileobj, 'file')
            if ~ispathvalid(fileobj, 'file')
                fid = H5F.create(fileobj, 'H5F_ACC_TRUNC', 'H5P_DEFAULT', 'H5P_DEFAULT');
                H5F.close(fid);
            end
+3 −7
Original line number Diff line number Diff line
@@ -59,11 +59,11 @@ iSrcDet = maingui.axesSDG.iSrcDet;
color       = maingui.axesSDG.linecolor;

SD          = maingui.dataTree.currElem.GetSDG('2D');
bbox        = [];

if isfield(maingui.axesSDG, 'xlim')
    xbox        = maingui.axesSDG.xlim;
    ybox        = maingui.axesSDG.ylim;
    bbox        = [xbox(1), xbox(2), ybox(1), ybox(2)];
else
    bbox        = maingui.dataTree.currElem.GetSdgBbox();
end
@@ -72,7 +72,7 @@ end
if ~ishandles(hAxes)
    return;
end
if isempty(bbox)
if length(bbox)<4
    return;
end

@@ -84,11 +84,7 @@ if ishandles(maingui.axesSDG.handles.ch)
    delete(maingui.axesSDG.handles.ch)
    delete(findobj(hAxes, 'Type', 'line'))  % Prevents previously drawn lines from piling up
end
if isfield(maingui.axesSDG, 'xlim')
    axis(hAxes, [xbox(1), xbox(2), ybox(1), ybox(2)]);
else
axis(hAxes, [bbox(1), bbox(2), bbox(3), bbox(4)]);
end

%set(hAxes, 'xticklabel','', 'yticklabel','', 'xgrid','off, ygrid','off')
set(hAxes, 'xticklabel','')
+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ function vrnnum = getVernum()

vrnnum{1} = '1';   % Major version #
vrnnum{2} = '31';  % Major sub-version #
vrnnum{3} = '1';   % Minor version #
vrnnum{3} = '2';   % Minor version #
vrnnum{4} = '0';   % Minor sub-version # or patch #: 'p1', 'p2', etc