Table of Contents

Class ImGuiEventView

Namespace
OpenEphys.EphysVisualization.Design
Assembly
OpenEphys.EphysVisualization.Design.dll

Shows the waveforms of the events detected on each channel, such as threshold crossings, as persistence: every waveform added is drawn once into a density that is kept until cleared, so waveforms of different shapes on a channel show as separate bands, a rare one beside a common one. Each channel's event rate is kept alongside.

public sealed class ImGuiEventView
Inheritance
ImGuiEventView
Inherited Members

Remarks

The densities are kept on the GPU, one tile per channel, in the signal's own coordinates: time across, and amplitude in bins spaced evenly in its inverse hyperbolic sine, fine near zero and coarser at large amplitudes. So the amplitudes drawn can change at any time without losing what has accumulated, and no waveform is kept once it has been drawn.

The view detects nothing itself. Its owner adds waveforms with Add(int, float[]), from any thread, and draws a channel's density wherever it chooses with Draw(int, Vector2, uint, double, double, double?). Every channel accumulates whether or not it is drawn, as long as Flush() or Draw(int, Vector2, uint, double, double, double?) is called each frame. Waveforms added while too many wait to be drawn are dropped, so a window that paints nothing for a while cannot run out of memory.

Constructors

ImGuiEventView(int, int, int, double, double)

Initializes a new instance of the ImGuiEventView class.

Properties

Paused

Gets or sets, from any thread, whether the view is paused, while which waveforms added are dropped and the event rates hold, so that what it shows stays as it was, as a paused plot's does. The counts are then of the events added while not paused.

RateTimeConstant

Gets or sets the time constant, in seconds, over which each channel's event rate is averaged. Ten seconds by default.

Unit

Gets or sets the unit of the waveforms' amplitudes, shown in the readings.

Methods

Add(int, float[])

Adds a detected waveform to a channel's density, from any thread. It is drawn in on the next frame.

Clear()

Empties every channel's density, from any thread, including waveforms added but not yet drawn.

Draw(int, Vector2, uint, double, double, double?)

Draws one channel's density at the cursor, with zero, the threshold, and the duration, count and rate labeled, and the time and amplitude under the pointer. Call it with the window's GL context current, as it is while a frame is drawn.

EventCount(int)

Gets the number of waveforms drawn into a channel's density since it was last cleared.

EventRate(int)

Gets a channel's event rate, in Hz, averaged over RateTimeConstant, as of the last frame.

Flush()

Draws the waveforms added since the last frame into their channels' densities. Call it once a frame while no channel is drawn, with the window's GL context current; Draw(int, Vector2, uint, double, double, double?) calls it too.

Reshape(int, int, double)

Changes the waveforms' length, delay and rate, from any thread, which empties every channel's density, since what has accumulated was drawn in the old shape.