P3Speller -Stimulus-

This forum deals with BCI2000 configuration issues.
Locked
mori
Posts: 7
Joined: 14 Feb 2011, 03:19

P3Speller -Stimulus-

Post by mori » 20 Jun 2011, 22:47

Hello
I don't know if it is the right place to ask for but I really need it.

I use bci2000 ver.3.0, and Visual Studio 2008. I think I want to separate row and col.

For example (copy mode: TextToSpell “HELLO”)
It shines only rows for “H・E・L・L・O”. Next, it shines only cols for “H・E・L・L・O”. And after that, it collects data and determine attended target.

To change the order to shine like this, where should I change the program?
I beg your kindness.

jawilson
Posts: 109
Joined: 28 Feb 2005, 16:31

Re: P3Speller -Stimulus-

Post by jawilson » 20 Jun 2011, 23:12

Hello,
I am not sure exactly what you mean. Do you only want the rows and columns containing H E L L O to flash, and no others? Currently, there is no way to tell BCI2000 explicitly which rows/columns to flash. I suppose you could adjust the spelling matrix so that it was a 4x1 matrix, containing H E L O. Then, there would just be 4 stimuli (1 row and 4 columns). Is this what you are trying to accomplish? I am not sure what the performance will be like, since the P300 response is generally stronger when there are more un-attended stimuli, and the oddball stimulus has a lower frequency of occurrence. In this case, each stimulus has a 25% of appearing, and it may take longer to get a correct response.
Adam

mori
Posts: 7
Joined: 14 Feb 2011, 03:19

Re: P3Speller -Stimulus-

Post by mori » 21 Jun 2011, 22:46

Thank you for replying a question quickly, and I’m sorry. I take a mistake in my question.

My mistake is about matrix. I want to use normal matrix(6×6). “HELLO” is example.
And I want to know how to change a flush order.
Using the way now, matrix will flash randomly for each character. And Rows and cols are mixed.
But I want for multiple characters to flush only row at first. Next I want multiple characters to flush only col.
Character decision want to do together at the end.

I am sorry in advance for my poor grammer. I am not good at English.

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

Re: P3Speller -Stimulus-

Post by mellinger » 23 Jun 2011, 14:03

You cannot do that in the current version of the P3Speller because it classifies over targets directly, not rows and columns separately. You would need to re-write large portions of the P3SpellerTask class, especially the classification code in P3SpellerTask::OnClassResult() such that it would do classification over StimulusCodes rather than targets. Also, you would need to modify the way sequences are created in P3SpellerTask::InitSequence(), such that only row stimulus codes (from 1 to N rows) or only column stimulus codes (ranging from N to N+M when M is the number of columns) are present in the sequence. Also, you would need to restart sequencing when the row highlighting is done, such that the column highlighting starts. When everything is over, you need to combine combine row and column information, so you need to save the classified rows and columns until then.

Regards,
Juergen

mori
Posts: 7
Joined: 14 Feb 2011, 03:19

Re: P3Speller -Stimulus-

Post by mori » 24 Jun 2011, 01:26

Thank you for the great advice.
Maybe it is difficult, but I try to re-write large portions of the P3 Speller Task class.

Thank you very much!!

mori
Posts: 7
Joined: 14 Feb 2011, 03:19

how to combine

Post by mori » 04 Jul 2011, 20:33

Hi, thank you for the reply last time, but I have another question about that.

I can modify the way sequences are created in P3SpellerTask::InitSequence().
But I can’t save the classified rows and columns. And I can’t combine row and column information.

Could you give me some advice?

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

Re: P3Speller -Stimulus-

Post by mellinger » 06 Jul 2011, 08:27

In P3SpellerTask::ClassifyTargets( const ClassResult& inResult ), the input contains scores for each stimulus presented. It is a std::map, with stimulus codes as keys, and vectors of GenericSignals as values.

To determine which row or column was selected, iterate over the input result, and save the stimulus code with the largest score:

Code: Select all

double maxScore = 0;
int maxStimulusCode = 0;
for( ClassResult::const_iterator i = inResult.begin(); i != inResult.end(); ++i )
{
  for( size_t j = 0; j < i->second.size(); ++j )
  {
    if( i->second[j]( 0, 0 ) > maxScore )
    {
      maxScore = i->second[j]( 0, 0 );
      maxStimulusCode = i->first;
    }
  }
}
if( maxStimulusCode > 0 && maxStimulusCode <= mNumMatrixRows )
  mClassifiedRows.push_back( maxStimulusCode );
else if( maxStimulusCode > mNumMatrixRows && maxStimulusCode <= mNumMatrixRows + mNumMatrixCols )
  mClassifiedCols.push_back( maxStimulusCode - mNumMatrixRows );
For this code to work, mClassifiedRows and mClassifiedCols must be added as members to the P3SpellerTask class, and must be of type std::vector<int>. Also make sure to clear these two vectors in P3Speller::OnStartRun().

This way, you have saved the classified rows and columns, and will be able to combine them in P3SpellerTask::OnPostRun().

Hope this helps,
Juergen

mori
Posts: 7
Joined: 14 Feb 2011, 03:19

Re: P3Speller -Stimulus-

Post by mori » 06 Jul 2011, 21:36

I’m glad to reply to my question quickly.

I try to save the classified rows and columns to use this code.

Thanks a lot!!

Locked

Who is online

Users browsing this forum: No registered users and 1 guest