Page 1 of 1

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

Posted: 15 Jul 2016, 01:32
by tinui
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.

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

Posted: 02 Aug 2016, 16:08
by pbrunner
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

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

Posted: 29 Nov 2016, 21:48
by JaneATY
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.

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

Posted: 21 Dec 2017, 09:09
by jameswyt
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