Unverified Commit 5db986c0 authored by jayd1860's avatar jayd1860 Committed by GitHub
Browse files

Fix error loading SNIRF stim caused by previous fix to aux that broke stim loading (#129)

* v1.36.0

-- Fix issues with building and running Homer3 executable.
-- Add logging of Homer3 input arguments.
-- Fix a performance issue in fullpath.m discovered when loading large data set.

* v1.36.1

-- Fix another issue in executable of not finding data files in subject folder.

* v1.36.2

-- Fix for error loading SNIRF aux.name field didn't work for ALL cases. Added code in HDF5 transpose code to handle all cases.
-- Added error handling in AuxClass

* -- Fix syncSubmodules attempted syncing with empty submodule
parent b000659a
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -217,10 +217,13 @@ classdef DataFilesClass < handle
            parentdir = filesepStandard(parentdir);
            pattern = obj.dirFormats.choices{iFormat}{iPattern};
            
            dirs = mydir([parentdir, pattern]);
            dirs = mydir([parentdir, pattern], obj.rootdir);
            
            dirnamePrev = '';
            for ii = 1:length(dirs)
                if dirs(ii).IsEmpty()
                    continue;
                end
                if dirs(ii).IsFile()
                    if strcmp(pattern, '*')
                        continue
@@ -257,7 +260,7 @@ classdef DataFilesClass < handle
                if obj.SearchLookupTable(pathrel2)
                    continue;
                end
                obj.files(end+1) = FileClass([obj.rootdir, '/', pathrel2]);
                obj.files(end+1) = FileClass([obj.rootdir, '/', pathrel2], obj.rootdir);
                obj.AddLookupTable(obj.files(end).name)
            end
        end
@@ -455,6 +458,8 @@ classdef DataFilesClass < handle
            end
            
            % Try to create object of data filetype and load data into it
            msg = 'Please wait while we check group folder for valid data files ...';
            hwait = waitbar_improved(0, msg);
            dataflag = false;
            for ii = 1:length(obj.files)
                if obj.files(ii).isdir
@@ -468,6 +473,7 @@ classdef DataFilesClass < handle
                else
                    dataflag = true;
                end
                hwait = waitbar_improved(ii/length(obj.files), hwait, msg);
            end
            if dataflag==false
                obj.files = FileClass.empty();
@@ -479,6 +485,7 @@ classdef DataFilesClass < handle
            	obj.files(errorIdxs) = [];
                obj.nfiles = obj.nfiles - length(errorIdxs);
            end
            close(hwait);
        end
        
        
+4 −4
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ classdef FileClass < matlab.mixin.Copyable
            else
                file.rootdir = pwd;
            end
            file.rootdir = filesepStandard(file.rootdir);            
            file.rootdir = filesepStandard(file.rootdir, 'full');            
            
            obj.Add(file);
        end
@@ -78,15 +78,15 @@ classdef FileClass < matlab.mixin.Copyable
            end
            
            if isproperty(obj2, 'folder')
                rootdir = [filesepStandard(obj2.folder), obj2.name]; %#ok<*PROPLC>
                rootpath = [filesepStandard(obj2.folder), obj2.name]; %#ok<*PROPLC>
            else
                rootdir = [filesepStandard(obj2.rootdir), obj2.name];                
                rootpath = [filesepStandard(obj2.rootdir), obj2.name];                
            end
            
            obj.idx          = obj.idx+1;
            obj.isdir        = obj2.isdir;
            obj.filename     = obj2.name;
            obj.name         = getPathRelative(rootdir, obj2.rootdir);
            obj.name         = getPathRelative(rootpath, obj2.rootdir);
            obj.rootdir 	 = obj2.rootdir;
            obj.err          = 0;          % Set error to NO ERROR            
        end
+9 −6
Original line number Diff line number Diff line
@@ -7,12 +7,15 @@ end
% Matlab stores contiguous muti-dimensional arrays in column-major order.
% HDF5 stores them in row-major order. We want to transpose the data to agree
% with the file format's storage order.
if ~isrow(val) && ~iscolumn(val)            % Matrices
    val = permute(val, ndims(val):-1:1);
% elseif ischar(val)                          % 1D char strings 
%     val = permute(val, ndims(val):-1:1);
elseif ~isempty(findstr('multidim', options))   % Force multi-dimensional even if vector
if (~isrow(val) && ~iscolumn(val))              || ...      % Matrices
     ~isempty(findstr('multidim', options))      || ...      % Force multi-dimensional even if vector
     ~isempty(findstr('2D', options))                        % Force 2D even if vector
    
    val = permute(val, ndims(val):-1:1);
elseif ~isempty(findstr('2D', options))         % Force 2D even if vector
    
elseif iscolumn(val) && ischar(val)
    
    val = permute(val, ndims(val):-1:1);
    
end
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ if ~exist('pathname','var') || isempty(pathname)
    pathname = pwd;
end
if ~exist('pathroot','var') || isempty(pathroot)
    pathroot = pwd;
    pathroot = fileparts(pathname);
end

if ispathvalid(pathname, 'dir') && ~includes(pathname, '*')
+4 −0
Original line number Diff line number Diff line
@@ -256,6 +256,10 @@ classdef AuxClass < FileLoadSaveClass
                err = -4;
                return
            end
            if ~ischar(obj.name)
                err = -5;
                return
            end
        end
        
        
Loading