Unverified Commit 859a9f47 authored by stephen scott tucker's avatar stephen scott tucker Committed by GitHub
Browse files

Fix to SnirfClass UpdateStims for adding new stim conds

parent 3c90e0b4
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -642,14 +642,15 @@ classdef SnirfClass < AcqDataClass & FileLoadSaveClass
                if ~flags(ii)
                if ~flags(ii)
                    % We have new stimulus condition added
                    % We have new stimulus condition added
                    if ~obj.stim(ii).IsEmpty()
                    if ~obj.stim(ii).IsEmpty()
                        snirfFile.stim(jj+1) = StimClass(obj.stim(ii));
                        snirfFile.stim(end+1) = StimClass(obj.stim(ii));
                        flags(ii) = 1;
                    end
                    end
                end
                end
            end
            end
            
            
            % If stims were edited then update snirf file with new stims
            % If stims were edited then update snirf file with new stims
            changes = sum(flags);
            changes = sum(flags);
            if changes
            if changes > 0
                snirfFile.SaveStim(fileobj);
                snirfFile.SaveStim(fileobj);
            end
            end
            stimFromFile = snirfFile.stim;
            stimFromFile = snirfFile.stim;