Display image icon in "Text to Spell" Box on P300 Speller

This forum deals with BCI2000 configuration issues.
Post Reply
royramirez
Posts: 2
Joined: 22 Aug 2024, 18:40

Display image icon in "Text to Spell" Box on P300 Speller

Post by royramirez » 22 Aug 2024, 18:51

Hello, I hope you're doing well. I'm trying to use the capability of displaying icons in the P3Speller matrix (https://www.bci2000.org/mediawiki/index ... esentation) for a project. Is there a way to display icons in the "Text to Spell" box, or to obtain this parameter over time and send it via IP port? I noticed it can be done with speller output. If I can get that parameter, I could collect the data and create a small window with Python to display the icons.

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: Display image icon in "Text to Spell" Box on P300 Speller

Post by mellinger » 23 Aug 2024, 06:46

Hi,

unfortunately there is no direct way to display icons in the "TextToSpell" box. As you say, you can send speller character output over an IP port. You could use this by encoding the icon name into the "Enter" column of your speller matrix definition.

Or, alternatively, you could modify the P3SpellerTask to directly send icon paths through the IP port. I can guide you how to do that if you like.

royramirez
Posts: 2
Joined: 22 Aug 2024, 18:40

Re: Display image icon in "Text to Spell" Box on P300 Speller

Post by royramirez » 26 Aug 2024, 13:57

Can you please guide me? I would really appreciate it.

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: Display image icon in "Text to Spell" Box on P300 Speller

Post by mellinger » 26 Aug 2024, 14:46

In P3SpellerTask.cpp, line 597, put a comment sign in front of the line.

After line 565, insert the following code:

Code: Select all

for (const auto& assoc : Associations()) {
  if (assoc.second.Contains(pTarget)) {
    for (const auto pStimulus : assoc.second.Stimuli()) {
      const ImageStimulus* pImage = dynamic_cast<const ImageStimulus*>(pStimulus);
      if (pImage)
         mConnection << pImage->File() << std::endl;
    }
  }
}
Please let me know if it works.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests