Skip to content

HeaderSyntaxError encountered when using wfdb 3.4.1 #351

Closed

Description

@wenh06

I encountered a HeaderSyntaxError when using wfdb 3.4.1, which will not happen when using wfdb 3.2.0. The following is the screenshot
image
The content of this file is as follows as a string:

'E07835.mat 12 500 5000 05-May-2020 09:49:17\nE07835.mat 16+24 1000/mV 16 0 -268 14726 0 I\nE07835.mat 16+24 1000/mV 16 0 -107 -21563 0 II\nE07835.mat 16+24 1000/mV 16 0 161 29193 0 III\nE07835.mat 16+24 1000/mV 16 0 187 -29331 0 aVR\nE07835.mat 16+24 1000/mV 16 0 -214 -7173 0 aVL\nE07835.mat 16+24 1000/mV 16 0 26 -29095 0 aVF\nE07835.mat 16+24 1000/mV 16 0 312 -24658 0 V1\nE07835.mat 16+24 1000/mV 16 0 219 15898 0 V2\nE07835.mat 16+24 1000/mV 16 0 -34 16063 0 V3\nE07835.mat 16+24 1000/mV 16 0 82 337 0 V4\nE07835.mat 16+24 1000/mV 16 0 136 14812 0 V5\nE07835.mat 16+24 1000/mV 16 0 -4 5202 0 V6\n#Age: 71\n#Sex: Female\n#Dx: 270492004,39732003\n#Rx: Unknown\n#Hx: Unknown\n'

This file can also be found in this database.

Activity

  1. wenh06 commented on Mar 26, 2022

    @wenh06
    ContributorAuthor

    The differences between the _parse_signal_lines function in wfdb.io._header between version 3.4.1 (red color) and 3.2.0 are as follows
    image
    image

  2. wenh06 commented on Mar 26, 2022

    @wenh06
    ContributorAuthor

    I think I've found the problem. The first line of the header file is illegal.

    E07835.mat 12 500 5000 05-May-2020 09:49:17
    

    should be

    E07835 12 500 5000 09:49:17 05/05/2020
    

    or at least

    E07835 12 500 5000 05-May-2020 09:49:17
    

    which would not trigger this error.

  3. briangow commented on Aug 5, 2022

    @briangow
    Contributor

    @wenh06 thank you for alerting us to this issue! You are absolutely correct, the positions for the date and time in the record line were swapped and the date used -'s instead of /'s along with the name of the month instead of an integer.

    Our understanding is that these files were not created with the WFDB tools provided by PhysioNet which is likely why these erroneous headers were created. Having said that, we are also looking to improve checks for this kind of problem in the WFDB tools as discussed in: #415 .

    The incorrect headers have been fixed in the most recent version of this project: https://physionet.org/content/challenge-2021/1.0.3/ . For reproducibility, copies of the erroneous headers should still be available via the links to the datasets in: https://physionet.org/content/challenge-2021/1.0.2/ .

    However, I am not able to reproduce the error message you got, even with wfdb==3.4.1 . Please see #415 for further discussion on this topic.

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