"""Detects regions of a waveform that cross a threshold (positive or negative) and returns the time, length, sum, and peak of each event."""
nodeName='ThresholdEvents'
uiTemplate=[
('threshold','spin',{'value':1e-12,'step':1,'minStep':0.1,'dec':True,'range':[None,None],'siPrefix':True,'tip':'Events are detected only if they cross this threshold.'}),
('adjustTimes','check',{'value':True,'tip':'If False, then event times are reported where the trace crosses threshold. If True, the event time is adjusted to estimate when the trace would have crossed 0.'}),
('minPeak','spin',{'value':0,'step':1,'minStep':0.1,'dec':True,'range':[None,None],'siPrefix':True,'tip':'Events must reach this threshold to be detected.'}),
('eventLimit','intSpin',{'value':100,'min':1,'max':1e9,'tip':'Limits the number of events that may be detected in a single trace. This prevents runaway processes due to over-sensitive detection criteria.'}),
('deadTime','spin',{'value':0,'step':1,'minStep':1e-4,'range':[0,None],'siPrefix':True,'suffix':'s','tip':'Ignore events that occur too quickly following another event.'}),
('reverseTime','spin',{'value':0,'step':1,'minStep':1e-4,'range':[0,None],'siPrefix':True,'suffix':'s','tip':'Ignore events that 1) have the opposite sign of the event immediately prior and 2) occur within the given time window after the prior event. This is useful for ignoring rebound signals.'}),