"Masking" image for the P300 magic card

Working with OpenViBE signal processing scenarios and doing scenario/BCI design
Post Reply
fabien.lotte
Posts: 112
Joined: Sun Mar 14, 2010 12:58 pm

"Masking" image for the P300 magic card

Post by fabien.lotte »

In the P300 magic card it is possible to use various images for each cell, however, it seems (but I may be wrong) that there is a single image to "mask" each cell, i.e., there is a single image that is displayed in each cell when this cell is not flashed (the default image being the openvibe logo). Is there a way to specify a different "masking" image for each cell? For instance it could be used to displayed a darkened version of each cell image rather than completely masking them with a different image.

Thanks!

Fabien

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: "Masking" image for the P300 magic card

Post by lbonnet »

Hi Fabien,

The P300 Magic Card visualization box already implement such mechanism (a table of "foreground" images and a table of "background" images is built - flashed and non-flashed resp.)
However, the background image is always the openvibe logo.

If you want to modify the box to displayed a "masked" version of the images instead, the patch is really simple.
Go into openvibe-plugins\simple-visualisation\trunc\src\ovpCBoxAlgorithmP300MagicCardVisualisation.cpp. Comment line 61 & 62 and add a line like this :

Code: Select all

//CString l_sBackgroundImageFilename=FSettingValueAutoCast(*this->getBoxAlgorithmContext(), 5); //--> the openvibe logo with default settings
//::GtkWidget* l_pBackgroundImage=gtk_image_new_from_file((l_sBackgroundImageFilename+CString("-offscreen")).toASCIIString());
::GtkWidget* l_pBackgroundImage=gtk_image_new_from_file((l_sForegroundImageFilename+CString("-offscreen")).toASCIIString());
This will automatically use the image <image> when flashed, and <image>-offscreen when not flashed (current "offscreen" versions have some sort of brown filter on them).
For example, <image> can be "pacman.png", "sonic.png", etc.

As you can see in the box settings or in the share directory of the project, all images can be modified, or more added (be sure to use the <image> and <image>-offscreen naming convention).


Of course, a proper patch of the box is possible, in order to handle this behavior in a cleaner way... Any contribution is appreciated ;)
Hope this helps !

Laurent
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

Post Reply