Commit 2a0d5b46 authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.23.2

-- Fix bug where if subject has only one run AND the run file name is not formatted according to the standard Homer naming convention (so as to distinguish between subject and run) then run name (minus extension) will have the same name as the subject which will create a conflict when saving .mat files in a distributed storage scheme. We therefore rename the subject name in case of this type of conflict
parent 6e5bafba
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -126,6 +126,17 @@ classdef SubjClass < TreeNodeClass
        end
        
        
        % ----------------------------------------------------------------------------------
        function b = CheckForNameConflict(obj, run)
            b = false;
            [~, runname] = fileparts(run.GetName());
            if strcmp(runname, obj.name)
                b = true;
            end
        end
        
        
        
        % ----------------------------------------------------------------------------------
        function Add(obj, run)
            % Add run to this subject
@@ -142,6 +153,14 @@ classdef SubjClass < TreeNodeClass
                obj.runs(jj) = run;
                fprintf('     Added run %s to subject %s.\n', obj.runs(jj).GetFileName, obj.GetName);
            end
            
            % If subject has only one run AND the run file name is not formatted according to the standard Homer 
            % naming convention (so as to distinguish between subject and run) then run name (minus extension) will 
            % have the same name as the subject which will create a conflict when saving .mat files in a distributed 
            % storage scheme. We therefore rename the subject name in case of this type of conflict
            if obj.CheckForNameConflict(run)
                obj.name = ['Subj_', obj.name];
            end
        end
        
        
+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ function vrnnum = getVernum()

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