Commit d044613f authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.28.5

-- Fix issue when loading proc stream from config file in GroupClass.InitProcStream(). The bug showed itself in unit test but can potentially cause problems in other situations. The copying of procStream was done incorrectly, first because we were copying group g to the group itself in GroupClass.InitProcStream() method which doesn't make sense and then inside ProcStreamClass.Copy method we were deleting fcalls of potentially the object that we were copying from which also doesn't make sense. Change the name of overriden == operator from eq() to isequal() so the == is not overriden so that we can actually compare handles rather than ProcStreamClass objects by value which is how it was being done when  == was overriden.

-- Change unit test comparison of homer3 to homer2 proc streams in compareProcStreams from using the overridden == operator to isequal method.
parent 56cfadd3
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -372,10 +372,9 @@ classdef GroupClass < TreeNodeClass
                
                % If proc stream input is still empty it means the loaded config
                % did not have valid proc stream input. If that's the case we
                % load a default proc stream input
                % Load a default proc stream input
                if g.procStream.IsEmpty() || s.procStream.IsEmpty() || r.procStream.IsEmpty()
                    obj.logger.Write(sprintf('Failed to load all function calls in proc stream config file. Loading default proc stream...\n'));
                    g.CopyFcalls(procStreamGroup, 'group');
                    g.CopyFcalls(procStreamSubj, 'subj');
                    g.CopyFcalls(procStreamRun, 'run');
                    
@@ -392,14 +391,13 @@ classdef GroupClass < TreeNodeClass
                        procStreamSubj.SaveConfigFile(fname, 'subj');
                        procStreamRun.SaveConfigFile(fname, 'run');
                    end
                    
                % Otherwise the non-default processing stream loaded from file to this group and to first subject 
                % disseminate it to all subjects and all runs in this group
                else                    
                    obj.logger.Write(sprintf('Loading proc stream from %s\n', fname));
                    procStreamGroup.Copy(g.procStream);
                    procStreamSubj.Copy(s.procStream);
                    procStreamRun.Copy(r.procStream);
                    g.CopyFcalls(procStreamGroup, 'group');
                    g.CopyFcalls(procStreamSubj, 'subj');
                    g.CopyFcalls(procStreamRun, 'run');
                    g.CopyFcalls(s.procStream, 'subj');
                    g.CopyFcalls(r.procStream, 'run');
                end
            end
        end
+4 −1
Original line number Diff line number Diff line
@@ -97,6 +97,9 @@ classdef ProcStreamClass < handle
            if ~isa(obj, 'ProcStreamClass')
                return;
            end
            if obj == obj2
                return;
            end            
            delete(obj.fcalls);
            obj.fcalls = FuncCallClass().empty();
            for ii=1:length(obj2.fcalls)
@@ -108,7 +111,7 @@ classdef ProcStreamClass < handle
        

        % ----------------------------------------------------------------------------------
        function B = eq(obj, obj2)
        function B = isequal(obj, obj2)
            B = 0;
            if isa(obj2, 'ProcStream')
                for ii=1:length(obj.fcalls)
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ load(groupFile_h2.name);
procStream_h2 = group(1).subjs(1).runs(1).procInput;
procStream_h3 = dataTree.groups(1).subjs(1).runs(1).procStream;

b = procStream_h3 == procStream_h2;
b = procStream_h3.isequal(procStream_h2);

if b==1
    status=0;
+1 −1
Original line number Diff line number Diff line
@@ -2,5 +2,5 @@ function vrnnum = getVernum()

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