Commit 1db799dd authored by Jay Dubb's avatar Jay Dubb
Browse files

v1.30.0

-- Simplify code which assigns labels to data plot axes in MainGUI by using object oriented class methods to access objects' data and fix an issue in the ppf check which decides whether to add length units to y-axis label.

a) Expand implementation of GetVar() method to other DataTree classes like FuncCallClass in order to be able to search for user-settable parameters in a way that keeps the implementation details from the client application which is MainGUI (or any other GUI).

b) Also implement GetVar() method for SubjClass and GroupClass in order to search for run-level user-settable parameters. Each of these methods calls common code implemented in GetVar() method of TreeNodeClass while code specific to group or subject if implemented in each classes GetVar method.

c) Implement GetLengthUnit() method in Snirf/SnirfClass.m to allow GUIs to get information about parameter units if it exists.

d) Fix ppf check which decides whether to add length units to y-axis label. It fails when selecting multiple wavelengths or multiple Hb types. Also it is not correct to use iWl (currently selected wavelength) for indexing to ppf because you're plotting concentration NOT OD or raw data so the currently selected wavelength is irrelevant. All you need to know is did ppf == 1 for ANY wavelength when calculating concentration. If yes then add length unit to the concentration unit label.
parent 594c498d
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -161,8 +161,15 @@ classdef MetaDataTagsClass < FileLoadSaveClass
        
        
        % ----------------------------------------------------------------------------------
        function tags = Get(obj)
        function tags = Get(obj, name)
            if ~exist('name', 'var')
                name = '';
            end
            fields = propnames(obj.tags);
            k = find(strcmp(fields, name));
            if ~isempty(k)
                fields = fields(k);
            end
            tags = repmat(struct('key','','value',[]), length(fields), 1);
            for ii=1:length(fields)
                eval(sprintf('tags(ii).key = ''%s'';', fields{ii}));
+13 −0
Original line number Diff line number Diff line
@@ -903,6 +903,19 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
            val = obj.metaDataTags.Get();
        end
        
        % ---------------------------------------------------------
        function val = GetLengthUnit(obj)
            val = [];
            if isempty(obj)
                return;
            end
            if isempty(obj.metaDataTags)
                return;
            end
            tag = obj.metaDataTags.Get('LengthUnit');
            val = tag.value;
        end
        
    end
    
    
+13 −0
Original line number Diff line number Diff line
@@ -736,6 +736,19 @@ classdef GroupClass < TreeNodeClass
            ExportTable(obj.name, 'HRF mean', tblcells);
        end
        
        
        
        % ----------------------------------------------------------------------------------
        function varval = GetVar(obj, varname)
            % First call the common code for all levels
            varval = obj.GetVar@TreeNodeClass(varname);
            
            % Now call the group specific part
            if isempty(varval)
                varval = obj.subjs(1).GetVar(varname);
            end            
        end
        
    end  % Public Save/Load methods
        
    
+16 −0
Original line number Diff line number Diff line
@@ -608,6 +608,22 @@ classdef FuncCallClass < handle
            nbytes = sum(nbytes);
        end

        
        % ----------------------------------------------------------------------------------        
        function val = GetVar(obj, name)
            val = [];
            if isempty(obj)
                return;
            end
            for ii = 1:length(obj.paramIn)
                if strcmp(name, obj.paramIn(ii).GetName())
                    val = obj.paramIn(ii).GetValue();
                    break;
                end
            end
        end
        
        
    end

    
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ classdef ProcInputClass < handle
                eval(sprintf('varval = obj.%s;', varname));
            elseif isproperty(obj.misc, varname)
                eval(sprintf('varval = obj.misc.%s;', varname));
            else
            elseif ~isempty(obj.acquired)
                varval = obj.acquired.GetVar(varname);
            end
            if ~isempty(varval) && exist('iBlk','var')
Loading