give event to a state

Forum for discussion on different signal processing algorithms
Post Reply
imenefeki
Posts: 6
Joined: 29 Apr 2015, 08:08

give event to a state

Post by imenefeki » 04 May 2015, 09:20

Hi!
i try to write an event marker in matlab and send it with FieldTripBuffer so I create a state "Power "
the state is created:

2015-05-04T14:50:03 - Operator set configuration
2015-05-04T14:50:03 - SignalProcessing confirmed new parameters ...
2015-05-04T14:50:03 - Application confirmed new parameters ...
2015-05-04T14:50:03 - SignalSource confirmed new parameters ...
2015-05-04T14:50:03 - Executing OnSetConfig script ...
2015-05-04T14:50:03 - Set state Running to 0

then i define the state as FTStateFromBuffer
Capture2.PNG
Capture2.PNG (2.57 KiB) Viewed 2045 times
and then i try to set event to the state in matlab:

Code: Select all

if(tot_Power<0.5)
event.type = 'Running';
event.value = 1;
event.offset = 0;
event.duration = 0;
ft_write_event(filename, event);
end
but the state is always 0. there is no change of the value of the state and i have no event in the filename.
Thanks you for help!
Attachments
capture3.PNG

admin
Site Admin
Posts: 5
Joined: 27 Jan 2003, 04:30

Re: give event to a state

Post by admin » 05 May 2015, 09:33

Hi,

It seems like you created a BCI2000 parameter rather than a state. It shows up in the parameter display!

You need to create a new state, which can be done either through the C++ interface within a filter within a module, or using BCI2000 Operator scripting:

http://www.bci2000.org/wiki/index.php/U ... _Scripting

You can verify that the state exists by either loading the data file into Matlab using load_bcidat or by recording a little data file, and inspecting it using BCI2000Viewer. Once you have verified that the state does indeed exist, you can write to it using FIeldtrip/Matlab.

Gerv

imenefeki
Posts: 6
Joined: 29 Apr 2015, 08:08

Re: give event to a state

Post by imenefeki » 05 May 2015, 09:55

Hi
thans u for your ansewer ! I used BCI2000 Operator scripting and i created a new state "Power",
cap4.PNG
and i defined an event to this new state but i don't have an event in my filename!

r.oostenveld
Posts: 10
Joined: 20 Aug 2007, 08:59

Re: give event to a state

Post by r.oostenveld » 06 May 2015, 08:58

Dear Imenefeki

Either the event does not end up in the buffer, or it is not being picked up by the FieldTripBuffer

Are you able to confirm that the event arrives properly in the FieldTrip buffer connected to BCI2000, e.g. by doing in another MATLAB instance ft_read_event?

Could you use fieldtrip/realtime/bin/win32/bufferViewer.exe to confirm that the header and data are properly streamed from BCI2000 into the FieldTrip buffer?

best
Robert

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest