|
|
[[_TOC_]]
|
|
|
|
|
|
# Introduction
|
|
|
Create a list of object of type Marker and send them to AnyWave.
|
|
|
|
|
|
## Marker object
|
|
|
````python
|
|
|
import anywave
|
|
|
marker = anywave.Marker()
|
|
|
|
|
|
Marker.label # label of marker
|
|
|
Marker.position # position in seconds.
|
|
|
Marker.duration # duration in seconds.
|
|
|
Marker.value # value associated with marker
|
|
|
Marker.targets # list of electrode labels. Empty if the marker is GLOBAL.
|
|
|
Marker.colour # string coding the color in RVB. Must start with #. Example for red : '#FF0000'
|
|
|
|
|
|
# using the constructor
|
|
|
marker = anywave.Marker(label='My Marker', position = 1, duration = 0, value = 10, colour = '#FF0000')
|
|
|
````
|
|
|
|
|
|
Not all attributes are required. The only required attributes are:
|
|
|
- label
|
|
|
- position
|
|
|
|
|
|
If other attributes are not specified, the default values for them will be taken into account.
|
|
|
Duration will be 0s, value will be 0., targets will be an empty array, and colour an empty string meaning the default color will be black.
|
|
|
|
|
|
# Usage
|
|
|
Sending 2 markers to AnyWave.
|
|
|
One is a GLOBAL marker with a duration of 5s and colored in red.
|
|
|
The second is a marker targeting a channel, with no duration.
|
|
|
````python
|
|
|
import sys, anywave
|
|
|
anywave.init(sys.argv)
|
|
|
|
|
|
markers = []
|
|
|
markers[0] = anywave.Marker(label='first marker', position=1, duration=5, colour='#FF0000')
|
|
|
markers[1] = anywave.Marker(label='second marker', position=6, targets=['A1'])
|
|
|
|
|
|
anywave.send_markers(markers)
|
|
|
```` |
|
|
\ No newline at end of file |