Interactive event recognition and analysis

DataView has sophisticated facilities for recognising and analysing waveform events such as nerve spikes. These operate in a highly interactive manner, making it easy for the user to fine-tune event recognition while seeing the immediate changes in both the main display and analysis displays such as graphs and histograms.

There are two primary modes of automatic event recognition: template matching and threshold crossing. Events can also be added manually or algorithmically in a variety of ways.

Template matching

Template matching has three sub-modes - using a fixed template, using an adaptive template, or using an optimally scaled template.

Fixed Template matching

A user-defined segment of waveform is captured as a template, and then the recorded trace is scanned for waveforms that match the template within a user-specified error range. Recognised events can be averaged and used as a new template to refine recognition criteria.

An extracellular recording showing several different active units. Waveform events (spikes a: 1) and their associated errors were recognised by template match on the 2nd spike from the left of the display (error 0, template). The allowed error was set to 25. Two spikes have a close match to the template (error < 5; red events) and two spikes have a distant match (error > 17; blue events). A small spike has an error above the threshold and is not marked by an event. By reducing the allowed error, only the close matches could have been marked. The event colours were achieved by clustering the spike waveforms on peak-to-peak amplitude and peak-to-peak duration.
spike template recognition

Adaptive Template matching

Adaptive template matching is like fixed template matching, except that the template adapts itself to systematic changes in the waveform such as a gradual decrease in overall amplitude. The adaptive template works by replacing the original template with a running average of the waveforms of recently-recognised events. The number of events constituting the average is determined by the user (typically 8), and as each new event is recognised, the earliest event in the average drops out to be replaced by the most recent. If an average of 1 is selected, then the template is successively replaced by each identified event, so that each found event constitutes the template for the next event search.

Optimally Scaled Template matching

Optimally scaled template matching is used when the intention is to find data elements of a particular shape, irrespective of their amplitude or dc-offset. A user-defined segment of data showing a waveform of the desired shape is first captured as a template. The record is then scanned on a point-by-point basis, and at each point the normalised template is scaled and offset to produce the best fit to the record. If the goodness-of-fit of this scaled template is within the acceptance criterion, it is counted as a match. The goodness-of-fit is defined as the scale factor divided by the standard error between the scaled template and the actual data.

Optimally scaled template matching (Clements & Bekkers 1997, Biophysics J. 73, 220-229) is used to detect a series of simulated minEPPs of varying amplitudes. Above: a Chart view of the data. The upper event channel (a:1) shows the detection without optimal scaling. Only the template minEPP is detected. The lower event channel (b:1) shows the matches to the same template with optimal scalining, with a minimum allowed amplitude of 1 to avoid noise matches. Below: a scope view of the entire record, using the optimal template events as triggers.
optimally scaled template     optimally scaled template stack

Threshold crossing

Onset and offset voltage thresholds can be defined either visually by cursors, numerically, or from the statistical properties of the data. Events are recognised as waveform segments that lie on one side or the other of the thresholds. Minimum on- and off-times can be specified, so that brief waveforms "glitches" are not accepted as genuine events. Limit cursors can be specified to exclude artefacts.

Spike bursts in an extracellular recording detected as events by crossing positive and negative threshold data values. In this case the levels are set from the data statistics. The "most inactive" region of data is located algorithmically (vertical blue dashed cursors) and this is regarded as background noise. Threshold values are set as 5-sigma deviations from the mean of this noise. A minimum off-time of 10 ms ensures that spike bursts, rather than individual spikes, are recognised as events.
Threshold dialog

Tuning Recognition

Finding the best recognition criteria to minimise mismatches of events with data can be quite time-consuming. In Dataview, this process is highly interactive. The programme can measure a wide range of event parameters (e.g. time of occurrence, frequency, duration, error [as above], peak amplitude, peak width, principal components etc.) and these can be plotted against each other in a scattergraph. This often allows outlier events to be easily identified. These can either be deleted by selecting them directly from the graph, or the display can automatically centre a selected event so that the user can decide what to do. The graphs update automatically as events are added or deleted.

Above or left: a frequency vs time scatterplot shows a clear main trend of gradually reducing frequency, with several outlier events. The first two high-frequency outlier events have been coloured red. Below or right: the chart view has been time has been set to include the first two outliers (events 65 and 70). They are clearly caused by momentary threshold crossing in the inter-burst period. These could be avoided by a slight increase in burst-detection threshold, or by setting a minimum on-time filter similar to the minimum off-time used to merge the underlying high-frequency spike events.
rhythmn frequency graph     rhythm

Analysis and Manipulation