Programming Reference:GenericVisualization Class

From BCI2000 Wiki
Jump to: navigation, search

Location

src/shared/types

Synopsis

A filter may have information that it wants to present to the user - e.g., the EEG signal might appear graphically in a window, or an application task log should be presented. Packaging this information into core messages, and sending these to the operator module, is handled by the GenericVisualization class. Typically, to visualize data this way, one will add a data member of type GenericVisualization to a filter class.

Note that visualization of a filter's output signal is handled transparently by the BCI2000 framework, and no code involving GenericVisualization needs to be written unless non-standard visualization behavior is required.

Methods

GenericVisualization(string SourceID)

Typically, a visualization's sourceID property is set from its constructor, and remains unchanged throughout the object's lifetime.

Send(string|GenericSignal|SignalProperties|BitmapImage)

Sends the specified object to the operator module, packaging it into an appropriate BCI2000 message. Strings are sent as log messages, a SignalProperties object is converted into a sequence of corresponding messages of type Visualization Configuration.

Rather than using GenericVisualization::Send(string) to send a log message, it is possible to use the std::ostream::operator<<() inserter:

GenericVisualization vis("MYLOG");
vis << "Starting run number " << runNumber << std::endl;

Properties

string SourceID (rw)

The visualization source ID, identifying a target visualization window. This property corresponds to a visualization messages' source identifier field.

See also

Programming Reference:GenericFilter Class, Technical Reference:Visualization Properties, Programming Tutorial:Implementing a Signal Processing Filter