Questions about the Stimulations flow (timing, chuncks)

Making & changing box plugins and external apps
Post Reply
Joan Fruitet
Posts: 4
Joined: Thu Apr 16, 2009 2:53 pm

Questions about the Stimulations flow (timing, chuncks)

Post by Joan Fruitet »

Hello,

I've got a few questions about how the stimulation flow is supposed to be process.
The stimulation flow is made of "chunks" that each have a ChunkStartTime and a ChunkEndTime.
Each chunk may contain 0,1 or more stimulations that each have a StimulationDate and a StimulationDuration (and a StimulationIdentifier).

First some questions about the chunks:
- Is it necessary that the start time of chunk be equal to the end time of the previous one?
- or can we have some blank between or can the chunk overlap?
- or even worse can the chunk be sent in a non-chronological order?

About the stimulation timing:
- Is it necessary that the StimulationDate be between the ChunkStartTime and the ChunkEndTime, or must it just be bigger than ChunkStartTime?
- Do the stimulations have to be sent in a chronological order?

Thank you
Joan

Joan Fruitet
Posts: 4
Joined: Thu Apr 16, 2009 2:53 pm

Re: Questions about the Stimulations flow (timing, chuncks)

Post by Joan Fruitet »

Here is the reason why I'm asking those questions:
I have designed a scenario with a "stimulation multiplexer" which has for inputs:
1) a keyboard stimulator
2) stimulations coming from a "matlab filter" which is connected to a "stimulation based epoching"

The problem is when the "stimulation based epoching" does not send data to the "matlab filter" box there are no stimulations and not even empty chunks sent to the "stimulation multiplexer".
And so the "stimulation multiplexer" store the stimulations coming from the keyboard stimulator and does not transmit them (which in my case is a problem).

I was thinking modifying the "stimulation multiplexer", by adding a parameter "do not synchronise", which when is active the "stimulation multiplexer" would just transmit the stimulation as they arrive and would not try to order them.

Joan

lbonnet
Site Admin
Posts: 417
Joined: Wed Oct 07, 2009 12:11 pm

Re: Questions about the Stimulations flow (timing, chuncks)

Post by lbonnet »

Hi Joan !

I'll do my best to explain what I can.
- Is it necessary that the start time of chunk be equal to the end time of the previous one?
- or can we have some blank between or can the chunk overlap?
- or even worse can the chunk be sent in a non-chronological order?
No, Yes, No. :)
In other words... The chunks can overlap, and the chunk stream can have blanks, but you must follow the time line.
The documentation page of the Stimulation based epoching box illustrates how output chunks are generated in various conditions.
As you can see, the streams can be discontinuous, chunks can overlap but you don't go back in time Marty :)
- Is it necessary that the StimulationDate be between the ChunkStartTime and the ChunkEndTime, or must it just be bigger than ChunkStartTime?
- Do the stimulations have to be sent in a chronological order?
I assume that:
ChunkStartTime <= StimulationDate <= ChunkEndTime
If you put more than one stimulation is in a stimulation set of a chunk, they don't have to be chronologically ordered.
I think there isn't any verification when appending stims in a set.
The problem is when the "stimulation based epoching" does not send data to the "matlab filter" box there are no stimulations and not even empty chunks sent to the "stimulation multiplexer".
And so the "stimulation multiplexer" store the stimulations coming from the keyboard stimulator and does not transmit them (which in my case is a problem).
You should output from the matlab filter empty stimulation chunks, so the stream is still continuous and the Stimulation Multiplexer knows where its input stream are in time.
i.e. in your bci_Process function in your matlab scripts, stim_out should not be left unset. For example :

Code: Select all

if numel(stim_in) == 0
   stim_out = stim_in;
end
Hope this helps !

Laurent
Follow us on twitter >> openvibebci

Checkout my (old) blog for some OpenViBE tips & tricks : here !

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Questions about the Stimulations flow (timing, chuncks)

Post by yrenard »

Dear Laurent & Joan,

sorry for the confusion, this shoud be documented somewhere. There is no check by the kernel if the chunks are correctly ordered or even if a stimulation in a stimulation set has a valid date as compared to the chunk start / end time. But - sorry for this - most of the boxes that process stimulation streams expect :
  • continuous stream (means next start time = last end time)
  • correct stimulation ordering in the stimulation set
  • correct stimulation dates as regarding to the chunk start / end time
By the way, when a box producing stimulation stream wants to notify the following boxes that no stim were triggered on a given time period, an empty chunk should be sent !

I hope this helps,
Yann

Post Reply