Difference between revisions of "Programming Reference:VisualizationDemo Signal Processing"

From BCI2000 Wiki
Jump to: navigation, search
(Implementation)
Line 9: Line 9:
  
 
==Function==
 
==Function==
The ''VisualizationDemoFilter'' computes pairwise determination coefficients (squared correlation, <math>r^2</math> values) between its input channels. Determination coefficients are visualized in form of pie charts, and pie charts are sent to the operator module as bitmap visualization data.
+
The ''VisualizationDemoFilter'' computes the determination coefficient (squared correlation, <math>r^2</math> values) between its first and second input channel. The determination coefficient is visualized in form of a pie chart, and the pie chart is sent to the operator module as bitmap visualization data.
  
 
==Implementation==
 
==Implementation==
Each visualization window is implemented as a ''VisualizationObject'' that contains a ''BitmapVisualization'' object, a ''WorkerThread'' object, and a ''Computation'' object. Whenever a new block of data arrives, computation is done for the individual window's pair of channels in the main thread. Then, visualization bitmap data are produced and sent to the operator module inside the worker thread, to avoid blocking the main thread. Inside the worker thread, the ''BitmapVisualization's'' <tt>SendDifferenceFrame()</tt> function is called to update the visualization display in the operator module.
+
A ''BitmapVisualization'' object is used to send visualization window configuration, and bitmap data to the operator module. In the filter's <tt>Initialize()</tt> method, the bitmap visualization object's <tt>SendReferenceFrame()</tt> method is called to set an anchor for further visualization data. In the filter's <tt>Process()</tt> method, rendered visualization data is sent to the operator module using the bitmap visualization object's <tt>SendDifferenceFrame</tt> method as an update to existing image data.
  
 
==Parameters==
 
==Parameters==
Line 23: Line 23:
 
===VisImageDecimation===
 
===VisImageDecimation===
 
A positive integer that indicates how often images are refreshed. 1 means every refresh on every signal packet.
 
A positive integer that indicates how often images are refreshed. 1 means every refresh on every signal packet.
===VisMaxWindows===
 
The maximum number of visualization windows created, or ''0'' for any number of windows.
 
  
 
==See also==
 
==See also==

Revision as of 15:30, 22 January 2019

Location

src/contrib/SignalProcessing/VisualizationDemo

Synopsis

The VisualizationDemo signal processing module demonstrates how to send visualizations with arbitrary pixel content to the operator module. Two rendering methods are provided: Native Qt QPainter-based rendering, and BCI2000's own GraphDisplay based rendering.

Inheritance

The VisualizationDemoFilter signal processing filter derives from GenericFilter.

Function

The VisualizationDemoFilter computes the determination coefficient (squared correlation, r^2 values) between its first and second input channel. The determination coefficient is visualized in form of a pie chart, and the pie chart is sent to the operator module as bitmap visualization data.

Implementation

A BitmapVisualization object is used to send visualization window configuration, and bitmap data to the operator module. In the filter's Initialize() method, the bitmap visualization object's SendReferenceFrame() method is called to set an anchor for further visualization data. In the filter's Process() method, rendered visualization data is sent to the operator module using the bitmap visualization object's SendDifferenceFrame method as an update to existing image data.

Parameters

VisImageWidth

Native image width in pixels.

VisImageHeight

Native image height in pixels.

VisImageBackground

The images' background color, in hexadecimal notation.

VisImageDecimation

A positive integer that indicates how often images are refreshed. 1 means every refresh on every signal packet.

See also

Programming Reference:GraphDisplay Class, Programming Reference:GenericVisualization Class