Page 1 of 1
Display image icon in "Text to Spell" Box on P300 Speller
Posted: 22 Aug 2024, 18:51
by royramirez
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.
Re: Display image icon in "Text to Spell" Box on P300 Speller
Posted: 23 Aug 2024, 06:46
by mellinger
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.
Re: Display image icon in "Text to Spell" Box on P300 Speller
Posted: 26 Aug 2024, 13:57
by royramirez
Can you please guide me? I would really appreciate it.
Re: Display image icon in "Text to Spell" Box on P300 Speller
Posted: 26 Aug 2024, 14:46
by mellinger
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.