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

v1.79.1 -- Fix Homer3 displaying probe in 3D rather than 2D. (#177)

v1.79.0

* DataTree, v1.14.0
-- Fix Homer3 displaying probe in 3D rather than 2D. Back out changes that default to 3D in ProbeClass and NirsClass GetSrcPos and GetDetPos for ALL cases. The way it's supposed to work is probe is supposed to use 2D coordinates ONLY when being displayed in Homer3. Rest of the time default to 3D if it exists. Reason for original change is misunderstanding of what the purpose of 2D coord was which is ONLY for display

* Utils, v1.5.1
-- Add ability to simulate full dataset (generateSimData.m, simulateDataTimeSeries.m)  to be able to eventually do workflow unit and system tests
parent b69f6e6f
Loading
Loading
Loading
Loading
+55 −9
Original line number Diff line number Diff line
@@ -794,14 +794,45 @@ classdef NirsClass < AcqDataClass & FileLoadSaveClass
        
        
        % ---------------------------------------------------------
        function srcpos = GetSrcPos(obj, ~)
        function srcpos = GetSrcPos(obj, options) %#ok<*INUSD>
            if ~exist('options','var')
                options = '';
            end
            if optionExists(options,'2D')
                if ~isempty(obj.SD.SrcPos)
            srcpos = obj.SD.SrcPos;
                else
                    srcpos = obj.SD.SrcPos3D;
                end
            else
                if ~isempty(obj.SD.SrcPos3D)
                    srcpos = obj.SD.SrcPos3D;
                else
                    srcpos = obj.SD.SrcPos;
                end
            end
        end
        
        
        
        % ---------------------------------------------------------
        function detpos = GetDetPos(obj, ~)
        function detpos = GetDetPos(obj, options)
            if ~exist('options','var')
                options = '';
            end
            if optionExists(options,'2D')
                if ~isempty(obj.SD.DetPos)
                    detpos = obj.SD.DetPos;
                else
                    detpos = obj.SD.DetPos3D;
                end
            else
                if ~isempty(obj.SD.DetPos3D)
                    detpos = obj.SD.DetPos3D;
                else
                    detpos = obj.SD.DetPos;
                end
            end
        end
        
        
@@ -1048,12 +1079,27 @@ classdef NirsClass < AcqDataClass & FileLoadSaveClass
        
        
        % ----------------------------------------------------------------------------------
        function SD = InitProbe(obj)
        function SD = InitProbe(obj, srcpos, detpos, ml, lambda, dummypos)
            if nargin<2
                srcpos = [];
            end
            if nargin<3
                detpos = [];
            end
            if nargin<4
                ml = [];
            end
            if nargin<5
                lambda = [];
            end
            if nargin<6
                dummypos = [];
            end
            SD = struct(...
                'Lambda',[], ...
                'SrcPos',[], ...
                'DetPos',[], ...
                'DummyPos',[], ...
                'Lambda',lambda, ...
                'SrcPos',srcpos, ...
                'DetPos',detpos, ...
                'DummyPos',dummypos, ...
                'SrcPos3D',[], ...
                'DetPos3D',[], ...
                'DummyPos3D',[], ...
@@ -1069,7 +1115,7 @@ classdef NirsClass < AcqDataClass & FileLoadSaveClass
                'Landmarks',obj.InitLandmarks(), ...
                'Landmarks2D',obj.InitLandmarks(), ...
                'Landmarks3D',obj.InitLandmarks(), ...
                'MeasList',[], ...
                'MeasList',ml, ...
                'MeasListAct',[], ...
                'SpringList',[], ...
                'AnchorList',{{}}, ...
+37 −11
Original line number Diff line number Diff line
@@ -386,23 +386,47 @@ classdef ProbeClass < FileLoadSaveClass
        
        
        % ---------------------------------------------------------
        function srcpos = GetSrcPos(obj, ~)
        function srcpos = GetSrcPos(obj, options) %#ok<*INUSD>
            if ~exist('options','var')
                options = '';
            end
            if optionExists(options,'2D')
                if ~isempty(obj.sourcePos2D)
                    srcpos = obj.sourcePos2D;
                else
                    srcpos = obj.sourcePos3D;
                end
            else
                if ~isempty(obj.sourcePos3D)
                    srcpos = obj.sourcePos3D;
                else
                    srcpos = obj.sourcePos2D;
                end
            end
        end
        
        
        
        % ---------------------------------------------------------
        function detpos = GetDetPos(obj, ~)
        function detpos = GetDetPos(obj, options)
            if ~exist('options','var')
                options = '';
            end
            if optionExists(options,'2D')
                if ~isempty(obj.detectorPos2D)
                    detpos = obj.detectorPos2D;
                else
                    detpos = obj.detectorPos3D;
                end
            else
	            if ~isempty(obj.detectorPos3D)
	                detpos = obj.detectorPos3D;
	            else
	                detpos = obj.detectorPos2D;
	            end
	        end
        end
        
        
        
        % -------------------------------------------------------
@@ -418,7 +442,6 @@ classdef ProbeClass < FileLoadSaveClass
                return;
            end
            if isempty(obj) && isempty(obj2)
                b = true;
                return;
            end
            if ~all(obj.wavelengths(:)==obj2.wavelengths(:))
@@ -477,6 +500,7 @@ classdef ProbeClass < FileLoadSaveClass
        end
        
        
        
        % ----------------------------------------------------------------------------------
        function nbytes = MemoryRequired(obj)
            nbytes = 0;
@@ -487,6 +511,7 @@ classdef ProbeClass < FileLoadSaveClass
        end
        
        
        
        % ----------------------------------------------------------------------------------
        function b = IsEmpty(obj)
            b = true;
@@ -501,6 +526,7 @@ classdef ProbeClass < FileLoadSaveClass
        end

        
        
        % ----------------------------------------------------------------------------------
        function b = IsValid(obj)
            b = false;
+8 −10
Original line number Diff line number Diff line
@@ -1339,22 +1339,20 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
        
        
        % ---------------------------------------------------------
        function srcpos = GetSrcPos(obj,option)
            if exist('option','var')
                srcpos = obj.probe.GetSrcPos(option);
            else
                srcpos = obj.probe.GetSrcPos();
        function srcpos = GetSrcPos(obj, options)
            if exist(options,'var')
                options = '';
            end
            srcpos = obj.probe.GetSrcPos(options);
        end
        
        
        % ---------------------------------------------------------
        function detpos = GetDetPos(obj,option)
            if exist('option','var')
                detpos = obj.probe.GetDetPos(option);
            else
                detpos = obj.probe.GetDetPos();
        function detpos = GetDetPos(obj, options)
            if exist(options,'var')
                options = '';
            end
            detpos = obj.probe.GetDetPos(options);
        end
        
        
+1 −26
Original line number Diff line number Diff line
@@ -452,13 +452,8 @@ classdef SessClass < TreeNodeClass
        
        
        % ----------------------------------------------------------------------------------
        function probe = GetProbe(obj, option)
        function probe = GetProbe(obj, ~)
            probe = obj.runs(1).GetProbe();
%             for run = obj.runs
%                if ~(probe == run.GetProbe()) 
%                   warning(['Probe ', run.name, 'differs from ', obj.runs(1).name]) 
%                end
%             end
        end
        
        
@@ -472,26 +467,6 @@ classdef SessClass < TreeNodeClass
        end
        
        
        % ----------------------------------------------------------------------------------
        function srcpos = GetSrcPos(obj,option)
            if exist('option','var')
                srcpos = obj.runs(1).GetSrcPos(option);
            else
                srcpos = obj.runs(1).GetSrcPos();
            end
        end
        
        
        % ----------------------------------------------------------------------------------
        function detpos = GetDetPos(obj,option)
            if exist('option','var')
                detpos = obj.runs(1).GetDetPos(option);
            else
                detpos = obj.runs(1).GetDetPos();
            end
        end
        
        
        % ----------------------------------------------------------------------------------
        function bbox = GetSdgBbox(obj)
            bbox = obj.runs(1).GetSdgBbox();
+0 −27
Original line number Diff line number Diff line
@@ -518,26 +518,6 @@ classdef SubjClass < TreeNodeClass
        end
        
        
        % ----------------------------------------------------------------------------------
        function srcpos = GetSrcPos(obj,option)
            if exist('option','var')
                srcpos = obj.sess(1).GetSrcPos(option);
            else
                srcpos = obj.sess(1).GetSrcPos();
            end
        end
        
        
        % ----------------------------------------------------------------------------------
        function detpos = GetDetPos(obj,option)
            if exist('option','var')
                detpos = obj.sess(1).GetDetPos(option);
            else
                detpos = obj.sess(1).GetDetPos();
            end
        end
        
        
        % ----------------------------------------------------------------------------------
        function bbox = GetSdgBbox(obj)
            bbox = obj.sess(1).GetSdgBbox();
@@ -547,13 +527,6 @@ classdef SubjClass < TreeNodeClass
        % ----------------------------------------------------------------------------------
        function probe = GetProbe(obj)
            probe = obj.sess(1).GetProbe();
%             for sess = obj.sess
%                for run = sess.runs
%                     if ~(probe == run.GetProbe()) 
%                         warning(['Probe ', run.name, 'differs from ', obj.sess(1).runs(1).name]) 
%                     end
%                end   
%            end
        end
        
        
Loading