visiannot.visiannot.ViSiAnnoTLongRecFromConfigFile

Summary

Module defining ViSiAnnoTLongRecFromConfigFile

Classes

visiannot.visiannot.ViSiAnnoTLongRecFromConfigFile.ViSiAnnoTLongRecFromConfigFile(…)

Subclass of ViSiAnnoT for managing a long recording with several files

API

Class ViSiAnnoTLongRecFromConfigFile

class visiannot.visiannot.ViSiAnnoTLongRecFromConfigFile.ViSiAnnoTLongRecFromConfigFile(path_config)[source]

Bases: visiannot.visiannot.ViSiAnnoTLongRec.ViSiAnnoTLongRec

Subclass of ViSiAnnoT for managing a long recording with several files

First, it searches the list of paths to the video/signal files. If signals are not synchronized with videos, then it creates temporary files with info for synchronization. Each created file corresponds to one video file and contains the path to the signal file to use with the starting second.

Parameters
  • video_dict (dict) –

    video configuration, each item corresponds to one camera. Key is the camera ID (string). Value is a configuration list of length 5:

    • (str) Directory where to find the video files,

    • (str) Pattern to find video files (e.g. "*.mp4"),

    • (str) Delimiter to get beginning datetime in the video file name,

    • (int) Position of the beginning datetime in the video file name, according to the delimiter,

    • (str) Format of the beginning datetime in the video file name (either "posix" or a format compliant with datetime.strptime()).

  • signal_dict (dict) –

    signal configuration, each item corresponds to one signal widget. Key is the widget ID (Y axis label, string). Value is a nested list of signal configurations. Each element of the nested list corresponds to one signal plot and is a configuration list of 8 elements:

    • (str) Directory where to find the signal files, see positional argument signal_dict of ViSiAnnoT constructor for detail about data storing format,

    • (str) Pattern to find signal files,

    • (str) Delimiter to get beginning datetime in the signal file name,

    • (int) Position of the beginning datetime in the signal file name, according to the delimiter,

    • (str) Format of the beginning datetime in the signal file name (either "posix" or a format compliant with datetime.strptime()),

    • (str) Key to access the data (in case of .mat or .h5 file),

    • (int or float or str) Signal frequency, set it to 0 if signal non regularly sampled, set it to -1 if same frequency as ViSiAnnoT.fps, it may be a string with the path to the frequency attribute in a .h5 file - in case of 2D data with several value columns, then the column index must be specified, e.g. "key - 1" or "key - colName" if there is an attribute at key named columns with columns name being comma-separated (first column is always the timestamps),

    • (dict) Plot style, see https://pyqtgraph.readthedocs.io/en/latest/graphicsItems/plotdataitem.html for details, set it to None for default.

    See Management of long recording for details.

  • interval_dict (dict) –

    interval configuration. Each item corresponds to a signal widget on which to plot intervals. The key must be the same as in signal_dict. Value is a nested list of interval configurations. Each element of the nested list corresponds to a type of interval to be plotted in the same signal widget and is a configuration list of 8 elements:

    • (str) Directory where to find interval files, see positional argument interval_dict of ViSiAnnoT constructor for detail about data storing format,

    • (str) Pattern to find interval files,

    • (str) Delimiter to get beginning datetime in the interval file name,

    • (int) Position of the beginning datetime in the interval file name, according to the delimiter,

    • (str) Format of the beginning datetime in the interval file name (either "posix" or a format compliant with datetime.strptime()),

    • (str) Key to access the data (in case of .mat or .h5 file),

    • (int) Signal frequency, set it to -1 if same frequency as ViSiAnnoT.fps, it may be a string with the path to the frequency attribute in a .h5 file,

    • (tuple or list) Plot color (RGBA).

  • flag_synchro (bool) – specify if video and signal are synchronized, in case there is no video and several signals that are not synchronized with each other, then flag_synchro can be set to False and the synchronization reference is the first signal

  • layout_mode (int) –

    layout mode of the window for positioning the widgets, one of the following:

    • 1 (focus on video, works better with a big screen),

    • 2 (focus on signal, suitable for a laptop screen),

    • 3 (compact display with some features disabled).

  • poswid_dict (dict) –

    custom position of the widgets in the window, default {} to use the positions defined by the layout mode (see input layout_mode). Value is a tuple of length 2 (row, col) or 4 (row, col, rowspan, colspan). Key identifies the widget:

    • "logo"

    • "select_trunc"

    • "select_manual"

    • "select_from_cursor"

    • "annot_event"

    • "annot_image"

    • "visi"

    • "zoomin"

    • "zoomout"

    • "previous"

    • "next"

    • "file_selection"

    • "progress"

  • kwargs – keyword arguments of ViSiAnnoT constructor