Output the result

Forum for discussion on different user applications
Locked
takercena
Posts: 2
Joined: 21 Jan 2012, 04:42

Output the result

Post by takercena » 26 Feb 2012, 16:53

Would anyone guide me how to redirect the output to text file for p300 speller? Like redirecting the "SPELLING IN THE RAIN(S)" to text file? Thank you.

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

Re: Output the result

Post by mellinger » 27 Feb 2012, 07:38

Hi,

I'm not sure what exactly you want to do. In order to save spelled letters, you can do the following as described on the P3Speller wiki page:
http://www.bci2000.org/wiki/index.php/U ... pellerTask
1) Activate the speller's TextWindow, and use the SAVE command to save its contents into a file.
2) Set the speller's DestinationAddress parameter to a UDP port, say localhost:20321. Then, use the AppConnector example application at src/contrib/AppConnectorApplications/SimpleExample to copy data from that port into a text file:

Code: Select all

SimpleExample -r localhost:20321 > YourTextFile.txt
In case you actually want the speller prompt to be copied into a text file, you will need to modify the P3Speller source code. The simplest way to do this will be to add the following after line 908 of P3SpellerTask.cpp:

Code: Select all

ofstream( "YourFile.txt" ) << mGoalText << endl;
The file's path name will be relative to the BCI2000 prog directory.
You will also need to add the following at the top of the file:

Code: Select all

#include <fstream>
Regards,
Juergen

Locked

Who is online

Users browsing this forum: No registered users and 13 guests