|
15 | 15 | },
|
16 | 16 | "outputs": [],
|
17 | 17 | "source": [
|
18 |
| - "import numpy as np\n", |
19 |
| - "from wfdb import readsignal\n", |
20 |
| - "from wfdb import readannot\n", |
21 |
| - "from wfdb import plotwfdb\n", |
| 18 | + "import wfdb\n", |
22 | 19 | "%matplotlib inline"
|
23 | 20 | ]
|
24 | 21 | },
|
|
32 | 29 | "source": [
|
33 | 30 | "# Demo 1 - Read the wfdb file, plot the last part of the signals, and print the metadata\n",
|
34 | 31 | "\n",
|
35 |
| - "sig, fields=readsignal.rdsamp('sampledata/a103l') \n", |
36 |
| - "plotwfdb.plotsigs(sig[80000:,:], fields, title='Record a103l from Physionet Challenge 2015') \n", |
| 32 | + "sig, fields=wfdb.rdsamp('sampledata/a103l') \n", |
| 33 | + "wfdb.plotwfdb(sig[80000:,:], fields, title='Record a103l from Physionet Challenge 2015') \n", |
37 | 34 | "fields"
|
38 | 35 | ]
|
39 | 36 | },
|
|
47 | 44 | "source": [
|
48 | 45 | "# Demo 2 - Read certain channels and sections of the WFDB file and plot them. \n",
|
49 | 46 | "\n",
|
50 |
| - "sig, fields=readsignal.rdsamp('sampledata/s0010_re', channels=[14, 0, 5, 10, 11], sampfrom=100, sampto=15000)\n", |
51 |
| - "plotwfdb.plotsigs(sig, fields)" |
| 47 | + "sig, fields=wfdb.rdsamp('sampledata/s0010_re', channels=[14, 0, 5, 10, 11], sampfrom=100, sampto=15000)\n", |
| 48 | + "wfdb.plotwfdb(sig, fields)" |
52 | 49 | ]
|
53 | 50 | },
|
54 | 51 | {
|
|
61 | 58 | "source": [
|
62 | 59 | "# Demo 3 - Read the WFDB signal and annotation file and plot them together.\n",
|
63 | 60 | "\n",
|
64 |
| - "sig, fields=readsignal.rdsamp('sampledata/100')\n", |
65 |
| - "annsamp=readannot.rdann('sampledata/100', 'atr')[0]\n", |
66 |
| - "plotwfdb.plotsigs(sig, fields, annsamp=annsamp, annch=[0], title='Record 100 from MIT-BIH Arrhythmia Database')" |
| 61 | + "sig, fields=wfdb.rdsamp('sampledata/100')\n", |
| 62 | + "annsamp=wfdb.rdann('sampledata/100', 'atr')[0]\n", |
| 63 | + "wfdb.plotwfdb(sig, fields, annsamp=annsamp, annch=[0], title='Record 100 from MIT-BIH Arrhythmia Database')" |
67 | 64 | ]
|
68 | 65 | },
|
69 | 66 | {
|
|
74 | 71 | "\n",
|
75 | 72 | "The following sections load and plots waveforms from the MIMIC matched waveform database. These waveforms have been matched to clinical data in the MIMIC Clinical database. The input records are multi-segment (made up of multiple individual WFDB records) and relatively long.\n",
|
76 | 73 | "\n",
|
77 |
| - "Note that in these kinds of records there are segments in which certain channels are missing. <strong>matplotlib</strong> automatically zooms in on sections without Nans in individual channels but the entire durations of the signals input into <strong>plotsigs</strong> are actually plotted. \n", |
| 74 | + "Note that these kinds of records contain segments in which certain channels are missing. <strong>matplotlib</strong> automatically zooms in on sections without Nans in individual channels but the entire durations of the signals input into <strong>plotwfdb</strong> are actually plotted. \n", |
78 | 75 | "\n"
|
79 | 76 | ]
|
80 | 77 | },
|
|
87 | 84 | "outputs": [],
|
88 | 85 | "source": [
|
89 | 86 | "# Demo 4 - Read the multi-segment signal and plot waveforms from the MIMIC matched waveform database. \n",
|
90 |
| - "sig, fields=readsignal.rdsamp('sampledata/matched/s25047/s25047-2704-05-04-10-44')\n", |
91 |
| - "plotwfdb.plotsigs(sig, fields, title='s25047/s25047-2704-05-04-10-44') \n", |
| 87 | + "sig, fields=wfdb.rdsamp('sampledata/matched/s25047/s25047-2704-05-04-10-44')\n", |
| 88 | + "wfdb.plotwfdb(sig, fields, title='s25047/s25047-2704-05-04-10-44') \n", |
92 | 89 | "fields"
|
93 | 90 | ]
|
94 | 91 | },
|
|
101 | 98 | "outputs": [],
|
102 | 99 | "source": [
|
103 | 100 | "# Demo 5 - Read the multi-segment signal and plot waveforms from the MIMIC matched waveform database. \n",
|
104 |
| - "sig, fields=readsignal.rdsamp('sampledata/matched/s00001/s00001-2896-10-10-00-31')\n", |
| 101 | + "sig, fields=wfdb.rdsamp('sampledata/matched/s00001/s00001-2896-10-10-00-31')\n", |
105 | 102 | "# Note, very long record to plot. \n",
|
106 |
| - "plotwfdb.plotsigs(sig[240000:, :], fields, title='s00001/s00001-2896-10-10-00-31') \n", |
| 103 | + "wfdb.plotwfdb(sig[240000:, :], fields, title='s00001/s00001-2896-10-10-00-31') \n", |
107 | 104 | "fields"
|
108 | 105 | ]
|
109 | 106 | },
|
|
133 | 130 | "name": "python",
|
134 | 131 | "nbconvert_exporter": "python",
|
135 | 132 | "pygments_lexer": "ipython3",
|
136 |
| - "version": "3.5.1" |
| 133 | + "version": "3.5.2" |
137 | 134 | }
|
138 | 135 | },
|
139 | 136 | "nbformat": 4,
|
|
0 commit comments