visiannot.visiannot.components.Signal¶
API¶
Class Signal¶
-
class
visiannot.visiannot.components.Signal.Signal(data, freq, max_points=inf, plot_style=None, legend_text='')[source]¶ Bases:
objectClass defining a signal to plot in
ViSiAnnoTThe signal data can be accessed with the methods
Signal.getData()andSignal.get_data_in_range().The attributes have the prefix _, so one should call the get methods to access them.
- Parameters
data (numpy array) – signal data, shape
if regularly
sampled (i.e. freq != 0), or
if not
regularlay sampled (i.e. freq == 0), then first column contains the timestamp in milliseconds and the second column contains the datafreq (int or float) – signal frequency, set it to
0if not regularly sampledmax_points (int) – maximum number of points to display in
ViSiAnnoT(used inSignal.get_data_in_range())plot_style (dict) – plot style of the signal, see https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/plotdataitem.html
legend_text (str) – legend associated to the signal plot
Methods:
get_data_in_range(first_frame_ms, last_frame_ms)Returns the signal data in the range defined by
first_frame_ms:last_frame_msset_signal(*args, **kwargs)Sets the instance with new values
Attributes:
(numpy array) Signal data shape
(even if regularly sampled), first column contains the timestamp in milliseconds and the second column contains the data(int) Signal frequency (
0if not regularly sampled)(int) Maximum number of points to display in
ViSiAnnoT(dict) Plot style (default
None), see https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/plotdataitem.html(str) Legend associated to the signal plot
-
get_data_in_range(first_frame_ms, last_frame_ms)[source]¶ Returns the signal data in the range defined by
first_frame_ms:last_frame_ms- Parameters
first_frame_ms (int) – first frame of the range in milliseconds
last_frame_ms (int) – last frame of the range in milliseconds
- Returns
signal data in the range [first_frame_ms:last_frame_ms]
- Return type
numpy array
-
data¶ (numpy array) Signal data shape
(even if regularly sampled), first column contains the timestamp
in milliseconds and the second column contains the data
-
freq¶ (int) Signal frequency (
0if not regularly sampled)
-
legend_text¶ (str) Legend associated to the signal plot
-
plot_style¶ (dict) Plot style (default
None), see https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/plotdataitem.html