Adding new Class Filters and thresholds

Forum for software developers to discuss BCI2000 software development
Locked
sergei_sh
Posts: 1
Joined: 02 Jan 2007, 07:31

Adding new Class Filters and thresholds

Post by sergei_sh » 02 Jan 2007, 15:21

Hello,

I wonder how to make cursor in D2Box not moving when either (1) there are signs of typical artifacts, or (2) mu rhythm amplitude (or other feature) has intermediate value (not sufficiently high or low). In other words, how to enable cursor moving only when it is more likely that the deviation of the features from their mean values is not random and not related to artifacts.

It seems that the existing spatial and temporal filters in ARSignalProcessing could be useful for detecting some common types of artifacts. But there are only two Class Filters, MLR and MUD. Probably, we will start with using one of them for 1D cursor control and another one for detecting spectral features typical for some artifacts; but latter we would like to have 2D control and to be able to detect more types of artifacts.

My first question is: Is adding new Class Filters a simple procedure, or it requires a lot of changes in the program code?

Another question: Is it possible, in the existing version of BCI2000, to set the control signal to zero if the output of one Class Filter is within a certain range or if the outputs of other Class Filters are lower/higher than certain values? Or we need to add some code ourselves?

Thanks,
Sergei

gschalk
Posts: 615
Joined: 28 Jan 2003, 12:37

Re: New class filters ...

Post by gschalk » 02 Jan 2007, 21:02

Sergei,

These are very good questions with a number of facets. See below.
I wonder how to make cursor in D2Box not moving when either (1) there are signs of typical artifacts, or (2) mu rhythm amplitude (or other feature) has intermediate value (not sufficiently high or low). In other words, how to enable cursor moving only when it is more likely that the deviation of the features from their mean values is not random and not related to artifacts.
It would not be difficult to write a little filter that detects gross artifacts and have the D2Box task suspend movement for that period. However, while it may be nice to have in some situation, I am not sure it will be very helpful. This is because gross artifacts, which can be easily detected in software, can also easily detected by visual inspection. Small artifacts, such as very subtle movements, can be quite difficult to detect, but yet could allow for very precise cursor control. We think that the best way to deal with artifacts is to instruct the subject and to analyze the data offline after the session.

Second, in the current design of the D2Box task, you are already reducing the error variance in the signal since the signal is integrated over quite some time. Of course you could add code to the D2Box task that only moves the cursor if the output amplitude is > x or < -x.
My first question is: Is adding new Class Filters a simple procedure, or it requires a lot of changes in the program code?
This is quite straightforward and described in the software design document. If you have questions, post them here.
Another question: Is it possible, in the existing version of BCI2000, to set the control signal to zero if the output of one Class Filter is within a certain range or if the outputs of other Class Filters are lower/higher than certain values? Or we need to add some code ourselves?
You cannot do this out of the box. I would also not set the control signal output to zero (even though it would probably have the desired effect of not moving the cursor. It would be cleaner to add a new filter that detects this condition and that sets a state (i.e., event marker) (which could be called whatever you want, say "artifact") to 1. This way, the control signal is calculated as always and you can have the application react in different ways.


I hope this helps,
The Gerv

Locked

Who is online

Users browsing this forum: No registered users and 0 guests