Skip to content

Introduction

openseize.file_io.annotations

A collection of annotation readers and annotation masking tools.

Annotations are useful for removing artifacts, filtering data by user labeled states and more. This module provides readers for reading annotations. Additionally, these annotations can be converted into boolean mask to provide to Openseize's producers for masking produced data.

This module contains the following classes and functions:

    Pinnacle:
        A Pinnacle Technoologies© annotation file reader.

    as_mask:
        A function that creates boolean mask from sequences of annotations
        that can be used to filter the data produced from a producer
        instance.

Examples:

>>> # read the annotations from the demo annotation file
>>> from openseize.demos import paths
>>> filepath = paths.locate('annotations_001.txt')
>>> from openseize.io.annotations import Pinnacle
>>> # read all the annotations
>>> with Pinnacle(filepath, start=6) as pinnacle:
>>>     annotations = pinnacle.read()
>>> print(annotations)