Commit 4544f60f authored by jayd1860's avatar jayd1860
Browse files

v1.74.3

-- Sync with latest shared libraries

* DataTree, v1.8.1
-- Fix error when trying to retrieve ppf param during image recon because dataTree.currElem.procStream.fcalls being empty. This is because of using GroupClass.CompareVersions caused procstream fcalls from groupResults not to load (it was deemed too old) which is clearly not what we want. Removed for now the comparison (CompareVersions for now always returns 0)  until we can figure out best way to handle old versions of groupResults.
-- Provide ProbeClass.GetScaleFactor() method to retrieve private scaling field
-- In ExportProcStreamDependencies get rid of the *_Library_Version suffix next to each library name in the JSON output

* FuncRegistry, v1.2.2
-- Fix issue with converting mlACt vector to 2D array with mlAct_Initialize.m during image recon.

* Utils, v1.3.2
-- Add ability to versionstr2num to process version arguments in the form of 3 numbers rather than a string for backward compatability with DataTree GroupClass to get old style version.
parent 104e17ca
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -574,6 +574,12 @@ classdef ProbeClass < FileLoadSaveClass
        end
        
        
        % ---------------------------------------------------------
        function val = GetScaleFactor(obj)
            val = obj.scaling;
        end
        
        
    end
    
end
+12 −90
Original line number Diff line number Diff line
@@ -2,7 +2,6 @@ classdef GroupClass < TreeNodeClass
    
    properties % (Access = private)
        version;
        versionStr;
        subjs;
    end
    
@@ -28,10 +27,6 @@ classdef GroupClass < TreeNodeClass
            obj.derivedPathBidsCompliant = 'derivatives/homer';
            obj.initsaveflag = false;
                        
%             if nargin<3 || ~strcmp(varargin{3}, 'noprint')
%                 obj.logger.Write('Current GroupClass version %s\n', obj.GetVersionStr());
%             end
            
            obj.type    = 'group';
            obj.subjs   = SubjClass().empty;
                        
@@ -72,38 +67,12 @@ classdef GroupClass < TreeNodeClass
        % ----------------------------------------------------------------------------------
        function InitVersion(obj)
            obj.SetVersion(getVernum('DataTree'));
            obj.InitVersionStrFull();
        end
        
        
        % ----------------------------------------------------------------------------------
        function SetVersion(obj, vernum)
            % Version number should be incremented whenever properties are added, deleted or changed in 
            % GroupClass, SubjectClass, RunClass OR acquisition class, like AcqDataClass, SnirfClass and 
            % its sub-classes or NirsClass 
            
            if nargin==1
                obj.version{1} = '2';   % Major version #
                obj.version{2} = '0';   % Major sub-version #
                obj.version{3} = '0';   % Minor version #
                obj.version{4} = '0';   % Minor sub-version # or patch #: 'p1', 'p2', etc
            elseif iscell(vernum)
                if ~isnumber([vernum{:}])
                    return;
                end
                for ii=1:length(vernum)
                    obj.version{ii} = vernum{ii};
                end
            elseif ischar(vernum)
                vernum = str2cell(vernum,'.');
                if ~isnumber([vernum{:}])
                    return;
                end
                obj.version = cell(length(vernum),1);
                for ii=1:length(vernum)
                    obj.version{ii} = vernum{ii};
                end
            end
            obj.version = vernum;
        end
        
        
@@ -113,73 +82,26 @@ classdef GroupClass < TreeNodeClass
        end
        
        
        % ----------------------------------------------------------------------------------
        function verstr = GetVersionStr(obj)
            verstr = version2string(obj.version);
        end
        
        
        % ----------------------------------------------------------------------------------
        function filename = GetFilename(obj)
            filename = obj.outputFilename;
        end
        
        
        % ----------------------------------------------------------------------------------
        function InitVersionStrFull(obj)
            if isempty(obj.version)
                return;
            end
            verstr = version2string(obj.version);
            obj.versionStr = sprintf('GroupClass v%s', verstr);
        end
        
        
        % ----------------------------------------------------------------------------------
        function res = CompareVersions(obj, obj2)
            res = 1;
            if ~isproperty(obj, 'version')
                return;
            elseif ~ischar(obj2.version) && ~iscell(obj2.version) 
                return;
            elseif ischar(obj2.version)
                if ~isnumber(obj2.version)
                    return;                    
                end
                v2 = str2cell(obj2.version,'.');
            elseif iscell(obj2.version)
                v2 = obj2.version;
            end
            v1 = obj.version;
            
            for ii=1:length(v1)
                v1{ii} = str2num(v1{ii}); %#ok<*ST2NM>
            end
            for ii=1:length(v2)
                v2{ii} = str2num(v2{ii});
            end
            
            % Now that we have the version numbers of both objects, we can
            % do an actual numeric comparison
            v1 = versionstr2num(obj.version);
            v2 = versionstr2num(obj2.version);
            if v1 == v2
                res = 0;
            for ii=1:max(length(v1), length(v2))
                if ii>length(v1)
                    res = -1;
                    break;
                end
                if ii>length(v2)
            elseif v1 < v2
                res = 1;
                    break;
                end
                if v1{ii}>v2{ii}
                    res = 1;
                    break;
                end
                if v1{ii}<v2{ii}
            elseif v1 > v2
                res = -1;
                    break;
                end
            end
            
            % TBD: not sure how to handle this. For now just return 0
            res = 0;
        end
        
        
@@ -747,7 +669,7 @@ classdef GroupClass < TreeNodeClass
            
            % Copy saved group to current group if versions are compatible. obj.CompareVersions==0 
            % means the versions of the saved group and current one are equal.
            if ~isempty(group) && obj.CompareVersions(group)<=0
            if ~isempty(group) && obj.CompareVersions(group) >= 0
                % Do a conditional copy of group from saved processing output file. Conditional copy copies ONLY 
                % derived data, that is, only from procStream but NOT acqruired. We do not want to 
                % overwrite the real acquired data loaded from acquisition files 
+1 −1
Original line number Diff line number Diff line
@@ -442,7 +442,7 @@ classdef ProcStreamClass < handle
            depStruct = struct();
            [d, v] = dependencies();
            for ii = 1:length(d)
                eval( sprintf('depStruct.%s_Library_Version = ''v%s'';', d{ii}, v{ii}) );
                eval( sprintf('depStruct.%s = ''v%s'';', d{ii}, v{ii}) );
            end
        end

+1 −1
Original line number Diff line number Diff line
1.8.0
 No newline at end of file
1.8.1
 No newline at end of file
+5 −5
Original line number Diff line number Diff line
@@ -6,13 +6,13 @@ function mlAct = mlAct_Initialize(mlAct0, ml)
% end
k = 1:size(ml,1);
if isvector(mlAct0) && (length(mlAct0) == length(k))
    if size(ml,2)==4
    	mlAct = [ ml(:,1:2), mlAct0, ml(:,4) ];
elseif isvector(mlAct0) && (length(mlAct0) > length(k))
    if size(ml,2) == 2
        mlAct = [ ml(k,1:2), ones(size(ml(k,:),1),2) ];
    else
        mlAct = [ ml(k,1:2), ones(size(ml(k,:),1),1), ml(k,4) ];
        mlAct = [ ml(:,1:2), mlAct0, ones(size(ml,1),1) ];
    end
elseif isvector(mlAct0) && (length(mlAct0) > length(k))
    mlAct = [ ml(k,1:2), ones(size(ml(k,:),1),1), ml(k,4) ];
elseif size(mlAct0,1) == length(k)
    mlAct = mlAct0;
elseif size(ml,2) == 2
Loading