How to change the character that is assigned to each of the stimulus code

Forum for software developers to discuss BCI2000 software development
Post Reply
tinui
Posts: 16
Joined: 14 May 2015, 02:11

How to change the character that is assigned to each of the stimulus code

Post by tinui » 15 Jul 2016, 01:32

Hi,


I want to change the stimulus presentation paradigm of P300speller.
I want to change the row and column paradigm that is currently set.
I understand the row and column paradigm is a set as shown in Fig. 1.

I'd like to flash the character group is not a row and column,
how do I change the character that is assigned to each of the stimulus code ?

All of the source code related to BCI2000 has downloaded.
Environment for debugging are also well-equipped.

I would appreciate it if you give me instructions.
thank you.
Attachments
row and column StimulusCode.PNG
Fig. 1
row and column StimulusCode.PNG (14.61 KiB) Viewed 3150 times

pbrunner
Posts: 344
Joined: 17 Sep 2010, 12:43

Re: How to change the character that is assigned to each of the stimulus code

Post by pbrunner » 02 Aug 2016, 16:08

Tinui,

I assume that you want to flash random sets of N or M characters in an NxM sized matrix. Let me first check if I conceptually understand what you want to do:

Conceptually what you do is having a virtual NxM matrix that is a scrambled version of the original NxM matrix. For example if your original spelling matrix would be A, B, C, D, etc. you would have something like D, M, U, V etc. Each element of this virtual matrix is mapped to an element of your original matrix on the screen. You then logically always present a row (i.e., N characters) or column (i.e., M characters) of the virtual matrix which results in a seemingly random set of characters in the original matrix. Just a few conceptual caveats. When you do this you might want to consider creating stimulation sequences that optimize the hamming distance in the code that you present. There are several papers that show how to perform this properly. Further you don't really need a row-column presentation of the original matrix anymore, i.e, you could present any physical interface that you like, e.g., a QERTY keyboard style.

Let me know if this is what you would like to accomplish then I will expand on how to implement this in BCI2000.

Regards, Peter

JaneATY
Posts: 16
Joined: 13 Dec 2015, 22:17

Re: How to change the character that is assigned to each of the stimulus code

Post by JaneATY » 29 Nov 2016, 21:48

Peter,
My situation is partly similar to that of Tinui. The randomly row and column paradigm is not what i need. Rather, i am figuring on a real-time flashing paradigm depending on a sequential row flashing at first and then a sequential column flashing.
For example, as a 3*3 matrix, we set "E" as the expected spelling character,
A B C
D E F
G H I
1.Flash row A,D,G sequently, wait for a P300 response, logically we shall get a response pointing to row D; Then flash row D again, we shall get a P300 response as a demtermination.
2.Flash column A,B,C sequently,wait for a P300 resonse, logically we shall get a response pointing to column B;Then flash column B again, we shall get a P300 response as a demtermination.
3.Alter step 1 and 2, we shall preliminary determine character "E" as the expected spelling character.

This should need a real-time-calculation during a smaller round of flashing, and we may need to add an error checking mechanism. Or should we just use the existing row and column paradigm as a training paradigm, and add a new paradigm like what i've shown as the testing paradigm?

In the source code, i find a program segment in .\BCI2000\src\core\Tools\P300Classifier\GetP3Responses.cpp:

// Section: Get dimensions
row = signal.gethighbound(1)+1;
col = signal.gethighbound(0)+1;
row_windowlen = windowlen.gethighbound(1)+1;
row_channels = channels.gethighbound(1)+1;
numchannels = col;
lenflash = row;
////////////////////////////////////////////////////////////////////////////
// Section: Check if windowlen has only one value (e.g. windlen = 800)
if (row_windowlen == 1)
{
val_temp = windowlen(0);
windowlen.setbounds(0, row_windowlen);
windowlen(0) = 0;
windowlen(1) = val_temp;
}
////////////////////////////////////////////////////////////////////////////
// Section: Identify changes in Flashing
for (int i=1; i<lenflash; i++)
{
if (Flashing(i-1) == 0 && Flashing(i) ==1)
{
if((i+windowlen(1)-2)<lenflash)
tmp.push_back(i);
}
}
Code.setbounds(0,static_cast<int>(tmp.size())-1);
Type.setbounds(0,static_cast<int>(tmp.size())-1);
trial.setbounds(0, static_cast<int>(tmp.size())-1);
////////////////////////////////////////////////////////////////////////////
// Section: Filter and downsample the signal
sig_ds_len = ap::iceil((windowlen(1)-windowlen(0))/DecFact);
siglen = sig_ds_len * numchannels;
sig.setbounds(0,static_cast<int>(tmp.size())-1,0, siglen-1);
y_downsampled.setbounds(0, sig_ds_len-1);

And i want to know what the Flashing() funcion means, which in the source code is the most relevant parameter to change the paradigm, and what steps should i follow to change the paradigm.

Regards.

jameswyt
Posts: 1
Joined: 01 Aug 2017, 02:42

Re: How to change the character that is assigned to each of the stimulus code

Post by jameswyt » 21 Dec 2017, 09:09

pbrunner wrote:
02 Aug 2016, 16:08
Tinui,

I assume that you want to flash random sets of N or M characters in an NxM sized matrix. Let me first check if I conceptually understand what you want to do:

Conceptually what you do is having a virtual NxM matrix that is a scrambled version of the original NxM matrix. For example if your original spelling matrix would be A, B, C, D, etc. you would have something like D, M, U, V etc. Each element of this virtual matrix is mapped to an element of your original matrix on the screen. You then logically always present a row (i.e., N characters) or column (i.e., M characters) of the virtual matrix which results in a seemingly random set of characters in the original matrix. Just a few conceptual caveats. When you do this you might want to consider creating stimulation sequences that optimize the hamming distance in the code that you present. There are several papers that show how to perform this properly. Further you don't really need a row-column presentation of the original matrix anymore, i.e, you could present any physical interface that you like, e.g., a QERTY keyboard style.

Let me know if this is what you would like to accomplish then I will expand on how to implement this in BCI2000.

Regards, Peter
I also have the same problem. I would appreciate it if you can expand on how to implement this in BCI2000
Regards,James

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests