Skip to content

wfdb check misses multi-segment master channel count mismatches #806

Done

Description

@tompollard

wfdb.check_record can report no problems for a multi-segment record whose master header declares a different number of channels from its segments.

For example, copy sample-data/multi-segment/041s, change the first line of 041s.hea from 041s/2 7 125 ... to 041s/2 9 125 ..., and run:

wfdb.check_record("path/to/041s/041s")

It returns [] even though the fixed-layout segments have seven channels. A normal read of the edited record fails. _check_segments compares fixed-layout segments with each other but does not compare their count with the master header's n_sig.

The checker should report the master/segment count mismatch, including the declared and observed counts. For variable-layout records, it should compare the master count with the zero-length layout header's count. This is independent of #805, which prevents MultiRecord.wrsamp() from writing such a mismatch.

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