Skip to content

Writing annotation files for use with mxm.c #245

Closed

Description

@maidens

I would like to use wfdb-python generate a set of annotation files that describe heart rate measurements. I am trying to test a heart rate algorithm to the EC57 standard and would like to be able to use the measurement-by-measurement (mxm) function required by the standard: https://physionet.org/physiotools/wag/mxm-1.htm. According to the linked documentation, the annotation files need to be saved with anntyp = MEASURE in order to use the mxm function. Therefore I am trying to set the anntype to the string 'MEASURE' using the wfdb wrann API as follows:

wfdb.wrann(record, 'hr', annotation_time, symbol=['MEASURE' for _ in annotation_time], subtype=None, chan=None, num=None, aux_note=heart_rates, label_store=None, fs=None, custom_labels=None, write_dir='')

However, this leads to the error

ValueError: Subelements of the symbol field must be strings of length 1 to 3

because the string 'MEASURE' is longer than a typical single character anntyp. Is there another way to save annotation files with a longer anntyp? If not, would it be possible to remove this symbol field check in order to allow folks to test to the EC57 standard using this package?

Activity

  1. Lucas-Mc commented on Jul 23, 2020

    @Lucas-Mc
    Contributor

    Hey @maidens, it appears like the symbol is = instead of MEASURE for this version so try that first:

    AnnotationLabel(23, "=", 'MEASURE', 'Measurement annotation'),

    Secondly, I know the mxm function hasn't been implemented yet (see #222) for this package so I can prioritize it for the next things to work on. Hope this helps!

  2. maidens commented on Jul 23, 2020

    @maidens
    Author

    Awesome, thanks! This has been helpful. I didn't realize that the "=" token was equivalent. I will try that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions