MIT-LCP / MIT-LCP/wfdb-python

Handling WFDB header date and time problems

オープン
#415 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Jupyter Notebook
スター
853
フォーク
322
PR マージ指標
30日以内にマージされた PR はありません

説明

We should aim to prevent the creation of WFDB headers which aren't to specification (via the WFDB write functions). We should also provide clear messaging for errors related to already created WFDB headers (via he WFDB read functions).

Two sets of projects have had WFDB header issues related to base_date recently:

  1. 2020 and 2021 Challenges. These projects used -'s instead of /'s in the base_date and the date was given before the base_time: https://github.com/MIT-LCP/wfdb-python/issues/351 . As mentioned in this issue, the WFDB tools were not used to create these files, so these errorneous headers shouldn't come as a surprise.
    Error message: HeaderSyntaxError: invalid syntax in record line
  2. Cerebral projects. These projects had a year for the base_date and no time. This problem was initially noted in: https://github.com/MIT-LCP/wfdb-python/issues/307. More recently, another user sent an email about this issue.
    Error message: ValueError: time data '2006' does not match format '%d/%m/%Y' (ecg files in https://physionet.org/content/cerebral-perfusion-diabetes/1.0.0/)
    Error message: ValueError: unconverted data remains: 10 (ECG files in https://physionet.org/content/cded/1.0.0/)

It isn't clear how the WFDB files for 2. were created. There is some indication that MIT-LCP helped generate these files.

At the very least we should:

  • Use validation checks to prevent the creation of WFDB files with these issues in our WFDB toolboxes.
  • Catch these issues in all of our WFDB toolboxes and provide clear, consistent error messages.

Since we need to address multiple issues across 3 different toolboxes this issue may get messy. I will update this post to denote how updates to the Matlab and C toolboxes will be tracked once that is determined.

Finally, it would also be good if our wfdbcheck algorithm would catch these issues. This could prevent cases like those seen in the 2020, and 2021 challenges from getting through (i.e. even if a header is created outside of our toolboxes, we'd like to flag it if it isn't to specification).

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、base_date と base_time を処理する WFDB の書き込み関数と読み取り関数を追跡し、次に wfdbcheck が不正なヘッダーをどのように処理するかを調べます。列挙されている無効な形式とエラーを比較します。検証によって仕様に準拠しないヘッダーが防止され、読み取り/チェックのパスが明確で一貫したメッセージを提供できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。