Commit 53a24783 authored by Jay's avatar Jay
Browse files

v1.14.1

-- Add stim toggle functionality to StimEditGUI
-- Fix matlab exception thrown by hmrR_BandpassFilt because of unexpected single type instead of double which the filtfilt function does not accept as argument. This was because I changed doubles to singles in NirsClass which when converted to snirf by homer3 generated singles in the datatimeseries in DataClass.
parent e4112abd
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -106,19 +106,19 @@ classdef NirsClass < AcqDataClass & FileLoadSaveClass
            warning('off', 'MATLAB:load:variableNotFound');
            fdata = load(fname,'-mat', 'SD','t','d','s','aux','CondNames');
            if isproperty(fdata,'d')
                obj.d = single(fdata.d);
                obj.d = fdata.d;
            end
            if isproperty(fdata,'t')
                obj.t = single(fdata.t);
                obj.t = fdata.t;
            end
            if isproperty(fdata,'SD')
                obj.SetSD(fdata.SD);
            end
            if isproperty(fdata,'s')
                obj.s = single(fdata.s);
                obj.s = fdata.s;
            end
            if isproperty(fdata,'aux')
                obj.aux = single(fdata.aux);
                obj.aux = fdata.aux;
            end
            if isproperty(fdata,'CondNames')
                obj.CondNames = fdata.CondNames;
+9 −0
Original line number Diff line number Diff line
@@ -884,6 +884,15 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
        end
        
        
        % ----------------------------------------------------------------------------------
        function ToggleStims(obj, tPts, condition)
            % Find all stims for any conditions which match the time points. 
            for ii=1:length(obj.stim)
                obj.stim(ii).ToggleStims(tPts);
            end
        end
        
        
        % ----------------------------------------------------------------------------------
        function MoveStims(obj, tPts, condition)
            if ~exist('tPts','var') || isempty(tPts)
+17 −0
Original line number Diff line number Diff line
@@ -356,6 +356,23 @@ classdef StimClass < FileLoadSaveClass
        
        
        
        % ----------------------------------------------------------------------------------
        function ToggleStims(obj, tPts)
            if isempty(obj.data)
                return;
            end
            
            % Find all stims for any conditions which match the time points and 
            % flip it's value.
            k = [];
            for ii=1:length(tPts)
                k = [k, find( abs(obj.data(:,1)-tPts(ii)) < obj.errmargin )];
            end
            obj.data(k,3) = -1*obj.data(k,3);
        end
        
        
        
        % ----------------------------------------------------------------------------------
        function b = IsEmpty(obj)
            b = true;
+12 −0
Original line number Diff line number Diff line
@@ -201,6 +201,18 @@ classdef ProcInputClass < handle
        end
        
        
        % ----------------------------------------------------------------------------------
        function ToggleStims(obj, tPts, condition)
            if ~exist('tPts','var') || isempty(tPts)
                return;
            end
            if ~exist('condition','var')
                condition = '';
            end
            obj.acquiredEditable.ToggleStims(tPts, condition);
        end
        
        
        % ----------------------------------------------------------------------------------
        function MoveStims(obj, tPts, condition)
            if ~exist('tPts','var') || isempty(tPts)
+12 −0
Original line number Diff line number Diff line
@@ -1304,6 +1304,18 @@ classdef ProcStreamClass < handle
        end
        
        
        % ----------------------------------------------------------------------------------
        function ToggleStims(obj, tPts, condition)
            if ~exist('tPts','var') || isempty(tPts)
                return;
            end
            if ~exist('condition','var')
                condition = '';
            end
            obj.input.ToggleStims(tPts, condition);
        end
        
        
        % ----------------------------------------------------------------------------------
        function MoveStims(obj, tPts, condition)
            if ~exist('tPts','var') || isempty(tPts)
Loading