You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><code>recordname</code> (mandatory) - The name of the WFDB record to be read (without any file extensions).</li>
33
-
<li><code>sampfrom</code> (default=0) - The starting sample number to read for each channel.</li>
34
-
<li><code>sampto</code> (default=length of entire signal)- The final sample number to read for each channel.</li>
35
-
<li><code>channels</code> (default=all channels) - Indices specifying the channel to be returned.</li>
36
-
<li><code>physical</code> (default=1) - Flag that specifies whether to return signals in physical (1) or digital (0) units.</li>
37
-
<li><code>stacksegments</code> (default=1) - Flag used only for multi-segment files. Specifies whether to return the signal as a single stacked/concatenated numpy array (1) or as a list of one numpy array for each segment (0). </li>
38
-
<li>pbdl (default=0): If this argument is set, the function will assume that the user is trying to download a physiobank file. Therefore the 'recordname' argument will be interpreted as a physiobank record name including the database subdirectory, rather than a local directory.</li>
39
-
<li>dldir (default=os.getcwd()): The directory to download physiobank files to.</li>
40
-
<li>keepfiles (default=0): Flag specifying whether to keep physiobank files newly downloaded through the function call.</li>
41
-
</ul>
30
+
31
+
*`recordname` (mandatory) - The name of the WFDB record to be read (without any file extensions).
32
+
*`sampfrom` (default=0) - The starting sample number to read for each channel.
33
+
*`sampto` (default=length of entire signal)- The final sample number to read for each channel.
34
+
*`channels` (default=all channels) - Indices specifying the channel to be returned.
35
+
*`physical` (default=1) - Flag that specifies whether to return signals in physical (1) or digital (0) units.
36
+
*`stacksegments` (default=1) - Flag used only for multi-segment files. Specifies whether to return the signal as a single stacked/concatenated numpy array (1) or as a list of one numpy array for each segment (0).
37
+
*`pbdl` (default=0): If this argument is set, the function will assume that the user is trying to download a physiobank file. Therefore the 'recordname' argument will be interpreted as a physiobank record name including the database subdirectory, rather than a local directory.
38
+
*`dldir` (default=os.getcwd()): The directory to download physiobank files to.
39
+
*`keepfiles` (default=0): Flag specifying whether to keep physiobank files newly downloaded through the function call.
40
+
42
41
43
42
Output Arguments:
44
-
<ul>
45
-
<li><code>sig</code> - An nxm numpy array where n is the signal length and m is the number of channels. <br>If the input record is a multi-segment record, depending on the input stacksegments flag, sig will either be a single stacked/concatenated numpy array (1) or a list of one numpy array for each segment (0). For empty segments, stacked format will contain Nan values, and non-stacked format will contain a single integer specifying the length of the empty segment.</li>
46
-
<li><code>fields</code> - A dictionary of metadata about the record extracted or deduced from the header/signal file. <br>If the input record is a multi-segment record, the output argument will be a list of dictionaries:
47
-
<ul>
48
-
<li>The first list element will be a dictionary of metadata about the master header.</li>
49
-
<li>If the record is in variable layout format, the next list element will be a dictionary of metadata about the layout specification header.</li>
50
-
<li>The last list element will be a list of dictionaries of metadata for each segment. For empty segments, the dictionary will be replaced by a single string: 'Empty Segment'</li>
51
-
</ul>
52
-
</ul>
43
+
*`sig` - An nxm numpy array where n is the signal length and m is the number of channels. If the input record is a multi-segment record, depending on the input stacksegments flag, sig will either be a single stacked/concatenated numpy array (1) or a list of one numpy array for each segment (0). For empty segments, stacked format will contain Nan values, and non-stacked format will contain a single integer specifying the length of the empty segment.
44
+
*`fields` - A dictionary of metadata about the record extracted or deduced from the header/signal file. If the input record is a multi-segment record, the output argument will be a list of dictionaries:
45
+
* The first list element will be a dictionary of metadata about the master header.
46
+
* If the record is in variable layout format, the next list element will be a dictionary of metadata about the layout specification header.
47
+
* The last list element will be a list of dictionaries of metadata for each segment. For empty segments, the dictionary will be replaced by a single string: 'Empty Segment'
48
+
53
49
54
50
55
51
### Reading Annotations
56
52
57
-
<strong>rdann</strong> - Read a WFDB annotation file <code>recordname.annot</code> and return the fields as lists or arrays.
53
+
**rdann** - Read a WFDB annotation file `recordname.annot` and return the fields as lists or arrays.
<li><code>recordname</code> (required) - The record name of the WFDB annotation file. ie. for file <code>100.atr</code> recordname='100'.</li>
72
-
<li><code>annot</code> (required) - The annotator extension of the annotation file. ie. for file <code>100.atr</code> annot='atr'.</li>
73
-
<li><code>sampfrom</code> (default=0)- The minimum sample number for annotations to be returned.</li>
74
-
<li><code>sampto</code> (default=the final annotation sample) - The maximum sample number for annotations to be returned.</li>
75
-
<li><code>anndisp</code> (default=1) - The annotation display flag that controls the data type of the <code>anntype</code> output parameter. <code>anntype</code> will either be an integer key(0), a shorthand display symbol(1), or a longer annotation code(2).</li>
76
-
</ul>
66
+
67
+
*`recordname` (required) - The record name of the WFDB annotation file. ie. for file `100.atr` recordname='100'.
68
+
*`annot` (required) - The annotator extension of the annotation file. ie. for file `100.atr` annot='atr'.
69
+
*`sampfrom` (default=0)- The minimum sample number for annotations to be returned.
70
+
*`sampto` (default=the final annotation sample) - The maximum sample number for annotations to be returned.
71
+
*`anndisp` (default=1) - The annotation display flag that controls the data type of the `anntype` output parameter. `anntype` will either be an integer key(0), a shorthand display symbol(1), or a longer annotation code(2).
77
72
78
73
Output arguments:
79
74
80
-
<ul>
81
-
<li><code>annsamp</code> - The annotation location in samples relative to the beginning of the record.</li>
82
-
<li><code>anntype</code> - The annotation type according the the standard WFDB keys.</li>
83
-
<li><code>subtype</code> - The marked class/category of the annotation.</li>
84
-
<li><code>chan</code> - The signal channel associated with the annotations.</li>
85
-
<li><code>num</code> - The marked annotation number. This is not equal to the index of the current annotation.</li>
86
-
<li><code>aux</code> - The auxiliary information string for the annotation.</li>
87
-
<li><code>annfs</code> - The sampling frequency written in the beginning of the annotation file if present.</li>
88
-
</ul>
75
+
*`annsamp` - The annotation location in samples relative to the beginning of the record.
76
+
*`anntype` - The annotation type according the the standard WFDB keys.
77
+
*`subtype` - The marked class/category of the annotation.
78
+
*`chan` - The signal channel associated with the annotations.
79
+
*`num` - The marked annotation number. This is not equal to the index of the current annotation.
80
+
*`aux` - The auxiliary information string for the annotation.
81
+
*`annfs` - The sampling frequency written in the beginning of the annotation file if present.
89
82
90
-
<strong>*NOTE</strong>: Every annotation contains the 'annsamp' and 'anntype' field. All other fields default to 0 or empty if not present.
83
+
***NOTE**: Every annotation contains the 'annsamp' and 'anntype' field. All other fields default to 0 or empty if not present.
91
84
92
85
93
86
### Plotting Data
94
87
95
-
<strong>plotwfdb</strong> - Subplot and label each channel of an nxm signal on a graph. Also subplot annotation locations on selected channels if present.
88
+
**plotwfdb** - Subplot and label each channel of an nxm signal on a graph. Also subplot annotation locations on selected channels if present.
@@ -108,19 +101,16 @@ wfdb.plotwfdb(sig, fields, annsamp, 'mitdb record 100'):
108
101
```
109
102
110
103
Input Arguments:
111
-
<ul>
112
-
<li>sig (required)- An nxm numpy array containing the signal to be plotted - the first output argument of <code>readsignal.rdsamp</code>.</li>
113
-
<li>fields (required) - A dictionary of metadata about the record - the second output argument of <code>readsignal.rdsamp</code>.</li>
114
-
<li>annsamp (optional) - A 1d numpy array of annotation locations to be plotted on top of selected channels - first output argument of <code>readannot.rdann()</code>.
115
-
<li>annch</li> (default=[0]) - A list of channels on which to plot the annotations.
116
-
<li>title (optional)- A string containing the title of the graph.</li>
117
-
<li>plottime (default=1) - Flag that specifies whether to plot the x axis as time (1) or samples (0). Defaults to samples if the input <code>fields</code> dictionary does not contain a value for <code>fs</code>.</li>
118
-
</ul>
119
-
104
+
*`sig` (required)- An nxm numpy array containing the signal to be plotted - the first output argument of `readsignal.rdsamp`.
105
+
*`fields` (required) - A dictionary of metadata about the record - the second output argument of `readsignal.rdsamp`.
106
+
*`annsamp` (optional) - A 1d numpy array of annotation locations to be plotted on top of selected channels - first output argument of `rdann`.
107
+
*`annch` (default=[0]) - A list of channels on which to plot the annotations.
108
+
*`title` (optional)- A string containing the title of the graph.
109
+
*`plottime` (default=1) - Flag that specifies whether to plot the x axis as time (1) or samples (0). Defaults to samples if the input `fields` dictionary does not contain a value for `fs`.
120
110
121
111
122
112
## Based on the original WFDB software package specifications
0 commit comments