Jump to content

Programming Reference:GenericVisualization Class: Difference between revisions

From BCI2000 Wiki
Mellinger (talk | contribs)
Mellinger (talk | contribs)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Presenting data to the operator user==
==Location==
Your filter may have information that it wants to present to the user
<tt>src/shared/types</tt>
-
 
e.g., the EEG signal might appear graphically in a window, or an
==Synopsis==
application
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
task log should be presented. Packaging this information into core
application task log should be presented. Packaging this information into core messages, and sending these to the operator module, is handled by the
messages,
and sending these to the operator module, is handled by the
<tt>GenericVisualization</tt> class.
<tt>GenericVisualization</tt> class.
Typically, to visualize data this way, you will add a data member of
Typically, to visualize data this way, one will add a data member of type <tt>GenericVisualization</tt> to a filter class.
type
 
<tt>GenericVisualization</tt> to your filter class - see
Note that visualization of a filter's output signal is handled transparently by the BCI2000 framework, and no code involving <tt>GenericVisualization</tt> needs to be written unless non-standard visualization behavior is required.
[[Programming Tutorial:Implementing a Signal Processing Filter]] for an example.
 
==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 [[Technical_Reference:BCI2000_Messages|BCI2000 message]]. Strings are sent as log messages, a SignalProperties object is converted into a sequence of corresponding messages of type [[Technical_Reference:BCI2000_Messages#Content_Descriptor.3D255:_Visualization_Configuration|Visualization Configuration]].
 
Rather than using <tt>GenericVisualization::Send(string)</tt> to send a log message, it is possible to use the <tt>std::ostream::operator<<()</tt> 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 [[Technical_Reference:BCI2000_Messages#Content_Descriptor.3D1:_Signal_Data|visualization messages']] source identifier field.
 
==See also==
[[Programming Reference:GenericFilter Class]], [[Technical Reference:Visualization Properties]], [[Programming Tutorial:Implementing a Signal Processing Filter]]


[[Category:Framework API]][[Category:Development]]
[[Category:Framework API]][[Category:Development]]

Latest revision as of 14:40, 7 February 2019

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