ECGProcess 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ecgprocess-1.1.0/ECGProcess.egg-info/PKG-INFO +153 -0
- ecgprocess-1.1.0/ECGProcess.egg-info/SOURCES.txt +38 -0
- ecgprocess-1.1.0/ECGProcess.egg-info/dependency_links.txt +1 -0
- ecgprocess-1.1.0/ECGProcess.egg-info/requires.txt +30 -0
- ecgprocess-1.1.0/ECGProcess.egg-info/top_level.txt +1 -0
- ecgprocess-1.1.0/LICENCE.txt +17 -0
- ecgprocess-1.1.0/PKG-INFO +153 -0
- ecgprocess-1.1.0/README.md +105 -0
- ecgprocess-1.1.0/ecgprocess/__init__.py +1 -0
- ecgprocess-1.1.0/ecgprocess/_version.py +1 -0
- ecgprocess-1.1.0/ecgprocess/constants.py +170 -0
- ecgprocess-1.1.0/ecgprocess/errors.py +380 -0
- ecgprocess-1.1.0/ecgprocess/example_data/__init__.py +1 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/.example-XML1.xml.un~ +0 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/.example-XML1.xsd.un~ +0 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/.example-XML1_a.xsd.un~ +0 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/.example-XML1_d.xsd.un~ +0 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/.example-XML1_wrong.xsd.un~ +0 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/example-DICOM1.dcm +0 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/example-DICOM2.dcm +0 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/example-XML1.xml +675 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/example-XML1.xsd +518 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/example-XML1_error.xsd +519 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/example-XML1_wrong.xsd +519 -0
- ecgprocess-1.1.0/ecgprocess/example_data/example_datasets/string_data.txt +1 -0
- ecgprocess-1.1.0/ecgprocess/example_data/examples.py +501 -0
- ecgprocess-1.1.0/ecgprocess/plot_ecgs.py +921 -0
- ecgprocess-1.1.0/ecgprocess/process_dicom.py +243 -0
- ecgprocess-1.1.0/ecgprocess/process_xml.py +319 -0
- ecgprocess-1.1.0/ecgprocess/tabular.py +1394 -0
- ecgprocess-1.1.0/ecgprocess/utils/__init__.py +1 -0
- ecgprocess-1.1.0/ecgprocess/utils/config_tools.py +581 -0
- ecgprocess-1.1.0/ecgprocess/utils/ecg_tools.py +311 -0
- ecgprocess-1.1.0/ecgprocess/utils/engineering_tools.py +385 -0
- ecgprocess-1.1.0/ecgprocess/utils/general.py +399 -0
- ecgprocess-1.1.0/ecgprocess/utils/reader_tools.py +508 -0
- ecgprocess-1.1.0/pyproject.toml +54 -0
- ecgprocess-1.1.0/requirements-dev.txt +26 -0
- ecgprocess-1.1.0/requirements.txt +8 -0
- ecgprocess-1.1.0/setup.cfg +4 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ECGProcess
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A python module to process and standardise ECG data
|
|
5
|
+
Author-email: "A. Floriaan Schmidt" <floriaanschmidt@gmail.com>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Homepage, https://gitlab.com/SchmidtAF/ECGProcess
|
|
8
|
+
Project-URL: Documentation, https://SchmidtAF.gitlab.io/ECGProcess/
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
15
|
+
Requires-Python: <3.14,>=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENCE.txt
|
|
18
|
+
Requires-Dist: lxml>=5
|
|
19
|
+
Requires-Dist: xmltodict>=0.14
|
|
20
|
+
Requires-Dist: pandas>=2.1.1
|
|
21
|
+
Requires-Dist: numpy>=1.26
|
|
22
|
+
Requires-Dist: scipy>=1.7
|
|
23
|
+
Requires-Dist: tensorflow>=2.16
|
|
24
|
+
Requires-Dist: pydicom>=2
|
|
25
|
+
Requires-Dist: matplotlib>=3.9
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=6; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-mock>=3.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-dependency>=0.5; extra == "dev"
|
|
30
|
+
Requires-Dist: codespell; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff; extra == "dev"
|
|
32
|
+
Requires-Dist: bump2version>=1; extra == "dev"
|
|
33
|
+
Requires-Dist: build; extra == "dev"
|
|
34
|
+
Requires-Dist: twine; extra == "dev"
|
|
35
|
+
Requires-Dist: sphinx; extra == "dev"
|
|
36
|
+
Requires-Dist: sphinx-rtd-theme; extra == "dev"
|
|
37
|
+
Requires-Dist: sphinx-bootstrap-theme; extra == "dev"
|
|
38
|
+
Requires-Dist: furo; extra == "dev"
|
|
39
|
+
Requires-Dist: myst-parser; extra == "dev"
|
|
40
|
+
Requires-Dist: nbsphinx; extra == "dev"
|
|
41
|
+
Requires-Dist: nbsphinx-link; extra == "dev"
|
|
42
|
+
Requires-Dist: sphinx-argparse; extra == "dev"
|
|
43
|
+
Requires-Dist: numpydoc; extra == "dev"
|
|
44
|
+
Requires-Dist: docutils<0.21; extra == "dev"
|
|
45
|
+
Requires-Dist: notebook; extra == "dev"
|
|
46
|
+
Requires-Dist: jupyter; extra == "dev"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
# An ECG processing module
|
|
52
|
+
__version__: `1.1.0`
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
This repository host a mixture of function dealing with processing
|
|
56
|
+
electrocardiogram (ECG) data, and preparing these data for analysis.
|
|
57
|
+
The processing functions are intended for user defined parametrisation
|
|
58
|
+
(using user supplied configuration files `cnf`) about the data which
|
|
59
|
+
should be extracted, covering signal data such as waveforms or
|
|
60
|
+
median beats, as well as metadata relevant for downstream QC or as
|
|
61
|
+
tabular information.
|
|
62
|
+
|
|
63
|
+
The module implements a basic application programming interface, mapping
|
|
64
|
+
ECG data from distinct file types (e.g. XML or DICOM) to class attributes
|
|
65
|
+
providing a fixed interface for downstream analysis and interrogation.
|
|
66
|
+
|
|
67
|
+
The documentation for ECGProcess can be found [here](https://SchmidtAF.gitlab.io/ECGProcess/).
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
At present, the repository is undergoing development and no packages exist yet
|
|
72
|
+
on PyPy or in Conda.
|
|
73
|
+
Therefore it is recommended that it is installed in either of the two ways
|
|
74
|
+
listed below.
|
|
75
|
+
First, clone this repository and then `cd` to the root of the repository.
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
git clone git@gitlab.com:SchmidtAF/ECGProcess.git
|
|
79
|
+
cd ECGProcess
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Installation using conda dependencies
|
|
83
|
+
A conda environment is provided in a `yaml` file in the directory
|
|
84
|
+
`./resources/conda/envs/`.
|
|
85
|
+
A new conda environment called `ecgprocess` can be built using the command:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
# From the root of the repository
|
|
89
|
+
conda env create --file ./resources/conda/envs/conda_create.yaml
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
To add to an existing environment use:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
# From the root of the repository
|
|
96
|
+
conda env update --file ./resources/conda/envs/conda_update.yaml
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Next the package can be installed:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
python -m pip install .
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Or for an editable (developer) install run the command below from the root of
|
|
106
|
+
the repository.
|
|
107
|
+
The difference with this is that you can just to a `git pull` to
|
|
108
|
+
update repository, or switch branches without re-installing:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
python -m pip install -e .
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
### Installation not using any conda dependencies
|
|
115
|
+
If you are not using conda in any way then install the dependencies via `pip`
|
|
116
|
+
and install repository as an editable install also via pip:
|
|
117
|
+
|
|
118
|
+
Install dependencies:
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
python -m pip install --upgrade -r requirements.txt
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Then to install repository you can either do:
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
python -m pip install .
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Or for an editable (developer) install run the command below from the root of
|
|
131
|
+
the repository.
|
|
132
|
+
The difference with this is that you can just to a `git pull` to update
|
|
133
|
+
repository, or switch branches without re-installing:
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
python -m pip install -e .
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Next steps...
|
|
140
|
+
After installation you might wish to try the `pytest` to confirm
|
|
141
|
+
everything is in working order.
|
|
142
|
+
|
|
143
|
+
```sh
|
|
144
|
+
# From the root of the repository
|
|
145
|
+
pytest tests
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Usage
|
|
149
|
+
|
|
150
|
+
Please have a look at the examples in
|
|
151
|
+
[resources](https://gitlab.com/SchmidtAF/ECGProcess/-/tree/master/resources/examples)
|
|
152
|
+
for some possible recipes.
|
|
153
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
LICENCE.txt
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
requirements-dev.txt
|
|
5
|
+
requirements.txt
|
|
6
|
+
ECGProcess.egg-info/PKG-INFO
|
|
7
|
+
ECGProcess.egg-info/SOURCES.txt
|
|
8
|
+
ECGProcess.egg-info/dependency_links.txt
|
|
9
|
+
ECGProcess.egg-info/requires.txt
|
|
10
|
+
ECGProcess.egg-info/top_level.txt
|
|
11
|
+
ecgprocess/__init__.py
|
|
12
|
+
ecgprocess/_version.py
|
|
13
|
+
ecgprocess/constants.py
|
|
14
|
+
ecgprocess/errors.py
|
|
15
|
+
ecgprocess/plot_ecgs.py
|
|
16
|
+
ecgprocess/process_dicom.py
|
|
17
|
+
ecgprocess/process_xml.py
|
|
18
|
+
ecgprocess/tabular.py
|
|
19
|
+
ecgprocess/example_data/__init__.py
|
|
20
|
+
ecgprocess/example_data/examples.py
|
|
21
|
+
ecgprocess/example_data/example_datasets/.example-XML1.xml.un~
|
|
22
|
+
ecgprocess/example_data/example_datasets/.example-XML1.xsd.un~
|
|
23
|
+
ecgprocess/example_data/example_datasets/.example-XML1_a.xsd.un~
|
|
24
|
+
ecgprocess/example_data/example_datasets/.example-XML1_d.xsd.un~
|
|
25
|
+
ecgprocess/example_data/example_datasets/.example-XML1_wrong.xsd.un~
|
|
26
|
+
ecgprocess/example_data/example_datasets/example-DICOM1.dcm
|
|
27
|
+
ecgprocess/example_data/example_datasets/example-DICOM2.dcm
|
|
28
|
+
ecgprocess/example_data/example_datasets/example-XML1.xml
|
|
29
|
+
ecgprocess/example_data/example_datasets/example-XML1.xsd
|
|
30
|
+
ecgprocess/example_data/example_datasets/example-XML1_error.xsd
|
|
31
|
+
ecgprocess/example_data/example_datasets/example-XML1_wrong.xsd
|
|
32
|
+
ecgprocess/example_data/example_datasets/string_data.txt
|
|
33
|
+
ecgprocess/utils/__init__.py
|
|
34
|
+
ecgprocess/utils/config_tools.py
|
|
35
|
+
ecgprocess/utils/ecg_tools.py
|
|
36
|
+
ecgprocess/utils/engineering_tools.py
|
|
37
|
+
ecgprocess/utils/general.py
|
|
38
|
+
ecgprocess/utils/reader_tools.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
lxml>=5
|
|
2
|
+
xmltodict>=0.14
|
|
3
|
+
pandas>=2.1.1
|
|
4
|
+
numpy>=1.26
|
|
5
|
+
scipy>=1.7
|
|
6
|
+
tensorflow>=2.16
|
|
7
|
+
pydicom>=2
|
|
8
|
+
matplotlib>=3.9
|
|
9
|
+
|
|
10
|
+
[dev]
|
|
11
|
+
pytest>=6
|
|
12
|
+
pytest-mock>=3.0
|
|
13
|
+
pytest-dependency>=0.5
|
|
14
|
+
codespell
|
|
15
|
+
ruff
|
|
16
|
+
bump2version>=1
|
|
17
|
+
build
|
|
18
|
+
twine
|
|
19
|
+
sphinx
|
|
20
|
+
sphinx-rtd-theme
|
|
21
|
+
sphinx-bootstrap-theme
|
|
22
|
+
furo
|
|
23
|
+
myst-parser
|
|
24
|
+
nbsphinx
|
|
25
|
+
nbsphinx-link
|
|
26
|
+
sphinx-argparse
|
|
27
|
+
numpydoc
|
|
28
|
+
docutils<0.21
|
|
29
|
+
notebook
|
|
30
|
+
jupyter
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ecgprocess
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
GNU GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 29 June 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2024 Amand Floriaan Schmidt (amand.schmidt@ucl.ac.uk)
|
|
5
|
+
|
|
6
|
+
This program is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU General Public License as published by
|
|
8
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
(at your option) any later version.
|
|
10
|
+
|
|
11
|
+
This program is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU General Public License
|
|
17
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ECGProcess
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A python module to process and standardise ECG data
|
|
5
|
+
Author-email: "A. Floriaan Schmidt" <floriaanschmidt@gmail.com>
|
|
6
|
+
License-Expression: GPL-3.0-or-later
|
|
7
|
+
Project-URL: Homepage, https://gitlab.com/SchmidtAF/ECGProcess
|
|
8
|
+
Project-URL: Documentation, https://SchmidtAF.gitlab.io/ECGProcess/
|
|
9
|
+
Classifier: Programming Language :: Python
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
15
|
+
Requires-Python: <3.14,>=3.11
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENCE.txt
|
|
18
|
+
Requires-Dist: lxml>=5
|
|
19
|
+
Requires-Dist: xmltodict>=0.14
|
|
20
|
+
Requires-Dist: pandas>=2.1.1
|
|
21
|
+
Requires-Dist: numpy>=1.26
|
|
22
|
+
Requires-Dist: scipy>=1.7
|
|
23
|
+
Requires-Dist: tensorflow>=2.16
|
|
24
|
+
Requires-Dist: pydicom>=2
|
|
25
|
+
Requires-Dist: matplotlib>=3.9
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=6; extra == "dev"
|
|
28
|
+
Requires-Dist: pytest-mock>=3.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-dependency>=0.5; extra == "dev"
|
|
30
|
+
Requires-Dist: codespell; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff; extra == "dev"
|
|
32
|
+
Requires-Dist: bump2version>=1; extra == "dev"
|
|
33
|
+
Requires-Dist: build; extra == "dev"
|
|
34
|
+
Requires-Dist: twine; extra == "dev"
|
|
35
|
+
Requires-Dist: sphinx; extra == "dev"
|
|
36
|
+
Requires-Dist: sphinx-rtd-theme; extra == "dev"
|
|
37
|
+
Requires-Dist: sphinx-bootstrap-theme; extra == "dev"
|
|
38
|
+
Requires-Dist: furo; extra == "dev"
|
|
39
|
+
Requires-Dist: myst-parser; extra == "dev"
|
|
40
|
+
Requires-Dist: nbsphinx; extra == "dev"
|
|
41
|
+
Requires-Dist: nbsphinx-link; extra == "dev"
|
|
42
|
+
Requires-Dist: sphinx-argparse; extra == "dev"
|
|
43
|
+
Requires-Dist: numpydoc; extra == "dev"
|
|
44
|
+
Requires-Dist: docutils<0.21; extra == "dev"
|
|
45
|
+
Requires-Dist: notebook; extra == "dev"
|
|
46
|
+
Requires-Dist: jupyter; extra == "dev"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
# An ECG processing module
|
|
52
|
+
__version__: `1.1.0`
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
This repository host a mixture of function dealing with processing
|
|
56
|
+
electrocardiogram (ECG) data, and preparing these data for analysis.
|
|
57
|
+
The processing functions are intended for user defined parametrisation
|
|
58
|
+
(using user supplied configuration files `cnf`) about the data which
|
|
59
|
+
should be extracted, covering signal data such as waveforms or
|
|
60
|
+
median beats, as well as metadata relevant for downstream QC or as
|
|
61
|
+
tabular information.
|
|
62
|
+
|
|
63
|
+
The module implements a basic application programming interface, mapping
|
|
64
|
+
ECG data from distinct file types (e.g. XML or DICOM) to class attributes
|
|
65
|
+
providing a fixed interface for downstream analysis and interrogation.
|
|
66
|
+
|
|
67
|
+
The documentation for ECGProcess can be found [here](https://SchmidtAF.gitlab.io/ECGProcess/).
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Installation
|
|
71
|
+
At present, the repository is undergoing development and no packages exist yet
|
|
72
|
+
on PyPy or in Conda.
|
|
73
|
+
Therefore it is recommended that it is installed in either of the two ways
|
|
74
|
+
listed below.
|
|
75
|
+
First, clone this repository and then `cd` to the root of the repository.
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
git clone git@gitlab.com:SchmidtAF/ECGProcess.git
|
|
79
|
+
cd ECGProcess
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Installation using conda dependencies
|
|
83
|
+
A conda environment is provided in a `yaml` file in the directory
|
|
84
|
+
`./resources/conda/envs/`.
|
|
85
|
+
A new conda environment called `ecgprocess` can be built using the command:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
# From the root of the repository
|
|
89
|
+
conda env create --file ./resources/conda/envs/conda_create.yaml
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
To add to an existing environment use:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
# From the root of the repository
|
|
96
|
+
conda env update --file ./resources/conda/envs/conda_update.yaml
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Next the package can be installed:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
python -m pip install .
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Or for an editable (developer) install run the command below from the root of
|
|
106
|
+
the repository.
|
|
107
|
+
The difference with this is that you can just to a `git pull` to
|
|
108
|
+
update repository, or switch branches without re-installing:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
python -m pip install -e .
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
### Installation not using any conda dependencies
|
|
115
|
+
If you are not using conda in any way then install the dependencies via `pip`
|
|
116
|
+
and install repository as an editable install also via pip:
|
|
117
|
+
|
|
118
|
+
Install dependencies:
|
|
119
|
+
|
|
120
|
+
```sh
|
|
121
|
+
python -m pip install --upgrade -r requirements.txt
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Then to install repository you can either do:
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
python -m pip install .
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Or for an editable (developer) install run the command below from the root of
|
|
131
|
+
the repository.
|
|
132
|
+
The difference with this is that you can just to a `git pull` to update
|
|
133
|
+
repository, or switch branches without re-installing:
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
python -m pip install -e .
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Next steps...
|
|
140
|
+
After installation you might wish to try the `pytest` to confirm
|
|
141
|
+
everything is in working order.
|
|
142
|
+
|
|
143
|
+
```sh
|
|
144
|
+
# From the root of the repository
|
|
145
|
+
pytest tests
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Usage
|
|
149
|
+
|
|
150
|
+
Please have a look at the examples in
|
|
151
|
+
[resources](https://gitlab.com/SchmidtAF/ECGProcess/-/tree/master/resources/examples)
|
|
152
|
+
for some possible recipes.
|
|
153
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# An ECG processing module
|
|
4
|
+
__version__: `1.1.0`
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
This repository host a mixture of function dealing with processing
|
|
8
|
+
electrocardiogram (ECG) data, and preparing these data for analysis.
|
|
9
|
+
The processing functions are intended for user defined parametrisation
|
|
10
|
+
(using user supplied configuration files `cnf`) about the data which
|
|
11
|
+
should be extracted, covering signal data such as waveforms or
|
|
12
|
+
median beats, as well as metadata relevant for downstream QC or as
|
|
13
|
+
tabular information.
|
|
14
|
+
|
|
15
|
+
The module implements a basic application programming interface, mapping
|
|
16
|
+
ECG data from distinct file types (e.g. XML or DICOM) to class attributes
|
|
17
|
+
providing a fixed interface for downstream analysis and interrogation.
|
|
18
|
+
|
|
19
|
+
The documentation for ECGProcess can be found [here](https://SchmidtAF.gitlab.io/ECGProcess/).
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
At present, the repository is undergoing development and no packages exist yet
|
|
24
|
+
on PyPy or in Conda.
|
|
25
|
+
Therefore it is recommended that it is installed in either of the two ways
|
|
26
|
+
listed below.
|
|
27
|
+
First, clone this repository and then `cd` to the root of the repository.
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
git clone git@gitlab.com:SchmidtAF/ECGProcess.git
|
|
31
|
+
cd ECGProcess
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Installation using conda dependencies
|
|
35
|
+
A conda environment is provided in a `yaml` file in the directory
|
|
36
|
+
`./resources/conda/envs/`.
|
|
37
|
+
A new conda environment called `ecgprocess` can be built using the command:
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
# From the root of the repository
|
|
41
|
+
conda env create --file ./resources/conda/envs/conda_create.yaml
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
To add to an existing environment use:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
# From the root of the repository
|
|
48
|
+
conda env update --file ./resources/conda/envs/conda_update.yaml
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Next the package can be installed:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
python -m pip install .
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Or for an editable (developer) install run the command below from the root of
|
|
58
|
+
the repository.
|
|
59
|
+
The difference with this is that you can just to a `git pull` to
|
|
60
|
+
update repository, or switch branches without re-installing:
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
python -m pip install -e .
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
### Installation not using any conda dependencies
|
|
67
|
+
If you are not using conda in any way then install the dependencies via `pip`
|
|
68
|
+
and install repository as an editable install also via pip:
|
|
69
|
+
|
|
70
|
+
Install dependencies:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
python -m pip install --upgrade -r requirements.txt
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Then to install repository you can either do:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
python -m pip install .
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Or for an editable (developer) install run the command below from the root of
|
|
83
|
+
the repository.
|
|
84
|
+
The difference with this is that you can just to a `git pull` to update
|
|
85
|
+
repository, or switch branches without re-installing:
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
python -m pip install -e .
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Next steps...
|
|
92
|
+
After installation you might wish to try the `pytest` to confirm
|
|
93
|
+
everything is in working order.
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
# From the root of the repository
|
|
97
|
+
pytest tests
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Usage
|
|
101
|
+
|
|
102
|
+
Please have a look at the examples in
|
|
103
|
+
[resources](https://gitlab.com/SchmidtAF/ECGProcess/-/tree/master/resources/examples)
|
|
104
|
+
for some possible recipes.
|
|
105
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from ._version import __version__
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.1.0'
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Constants used by ECGProcess
|
|
3
|
+
'''
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
|
|
7
|
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
8
|
+
class CoreData:
|
|
9
|
+
'''
|
|
10
|
+
Core variable names which are used internally by various modules in
|
|
11
|
+
`ECGProcess`.
|
|
12
|
+
'''
|
|
13
|
+
# /////////////////////////////////////////////////////////////////////////
|
|
14
|
+
class DataTypes:
|
|
15
|
+
'''
|
|
16
|
+
Contains constants representing high-level data categories used
|
|
17
|
+
in ECG processing, such as waveforms, median beats, and metadata.
|
|
18
|
+
'''
|
|
19
|
+
WaveForms = 'WaveForms'
|
|
20
|
+
MedianBeats = 'MedianBeats'
|
|
21
|
+
MetaData = 'MetaData'
|
|
22
|
+
OtherData = 'OtherData'
|
|
23
|
+
# /////////////////////////////////////////////////////////////////////////
|
|
24
|
+
class Leads:
|
|
25
|
+
'''
|
|
26
|
+
The internally used lead names.
|
|
27
|
+
'''
|
|
28
|
+
I = 'I'
|
|
29
|
+
II = 'II'
|
|
30
|
+
III = 'III'
|
|
31
|
+
aVR = 'aVR'
|
|
32
|
+
aVL = 'aVL'
|
|
33
|
+
aVF = 'aVF'
|
|
34
|
+
V1 = 'V1'
|
|
35
|
+
V2 = 'V2'
|
|
36
|
+
V3 = 'V3'
|
|
37
|
+
V4 = 'V4'
|
|
38
|
+
V5 = 'V5'
|
|
39
|
+
V6 = 'V6'
|
|
40
|
+
# /////////////////////////////////////////////////////////////////////////
|
|
41
|
+
class MetaData:
|
|
42
|
+
'''
|
|
43
|
+
Contains constants representing metadata fields required for
|
|
44
|
+
ECG processing.
|
|
45
|
+
'''
|
|
46
|
+
UID = 'unique identifier'
|
|
47
|
+
NLEADS = 'number of leads'
|
|
48
|
+
RES_U_W = 'resolution unit (waveforms)'
|
|
49
|
+
RES_U_M = 'resolution unit (medianbeats)'
|
|
50
|
+
RES_W = 'resolution (waveforms)'
|
|
51
|
+
RES_M = 'resolution (medianbeats)'
|
|
52
|
+
SF = 'sampling frequency (original)'
|
|
53
|
+
SF_U = 'sampling frequency unit'
|
|
54
|
+
SN_W = 'sampling number (waveforms)'
|
|
55
|
+
SN_M = 'sampling number (medianbeats)'
|
|
56
|
+
# /////////////////////////////////////////////////////////////////////////
|
|
57
|
+
class ProcessingData:
|
|
58
|
+
'''
|
|
59
|
+
Contains constants for attributes and variables created by the process
|
|
60
|
+
modules.
|
|
61
|
+
'''
|
|
62
|
+
TAGS = 'tags'
|
|
63
|
+
RAW = 'raw_data'
|
|
64
|
+
Duration = 'duration (sec)'
|
|
65
|
+
SF_NEW = 'sampling frequency (processed)'
|
|
66
|
+
RESAMPLE = 'resample_500'
|
|
67
|
+
AUG_LEADS = 'augment_leads'
|
|
68
|
+
|
|
69
|
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
70
|
+
class UtilsReaderNames(object):
|
|
71
|
+
'''
|
|
72
|
+
Names used in the Utils Reader Tools module.
|
|
73
|
+
'''
|
|
74
|
+
DICOM_WAVE_ARRAY = 'waveform_array'
|
|
75
|
+
|
|
76
|
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
77
|
+
class UtilsGeneralNames(object):
|
|
78
|
+
'''
|
|
79
|
+
Names used in the Utils General module.
|
|
80
|
+
'''
|
|
81
|
+
LXML_ERROR = 'expected'
|
|
82
|
+
|
|
83
|
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
84
|
+
class UtilsConfigData(object):
|
|
85
|
+
'''
|
|
86
|
+
Names used in the Utils Config Data module
|
|
87
|
+
'''
|
|
88
|
+
MetaData = CoreData.DataTypes.MetaData
|
|
89
|
+
OtherData = CoreData.DataTypes.OtherData
|
|
90
|
+
WaveForms = CoreData.DataTypes.WaveForms
|
|
91
|
+
MedianBeats = CoreData.DataTypes.MedianBeats
|
|
92
|
+
path = 'path'
|
|
93
|
+
data = '_data'
|
|
94
|
+
MAPPER = 'mapper'
|
|
95
|
+
|
|
96
|
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
97
|
+
class ProcessXMLNames(object):
|
|
98
|
+
'''
|
|
99
|
+
Names used in the process_xml module.
|
|
100
|
+
'''
|
|
101
|
+
RESAMPLE = CoreData.ProcessingData.RESAMPLE
|
|
102
|
+
AUG_LEADS = CoreData.ProcessingData.AUG_LEADS
|
|
103
|
+
|
|
104
|
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
105
|
+
class ProcessDicomNames(object):
|
|
106
|
+
RESAMPLE = CoreData.ProcessingData.RESAMPLE
|
|
107
|
+
AUG_LEADS = CoreData.ProcessingData.AUG_LEADS
|
|
108
|
+
|
|
109
|
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
110
|
+
class TabularNames(object):
|
|
111
|
+
E_META = 'extract_'+CoreData.DataTypes.MetaData
|
|
112
|
+
E_WAVE = 'extract_'+CoreData.DataTypes.WaveForms
|
|
113
|
+
E_MEDIAN = 'extract_'+CoreData.DataTypes.MedianBeats
|
|
114
|
+
ENG_META = 'engineer_'+CoreData.DataTypes.MetaData
|
|
115
|
+
ENG_WAVE = 'engineer_'+CoreData.DataTypes.WaveForms
|
|
116
|
+
ENG_MEDIAN = 'engineer_'+CoreData.DataTypes.MedianBeats
|
|
117
|
+
META_DICT = 'meta_dict'
|
|
118
|
+
SKIP_PERM = 'ignore_permission'
|
|
119
|
+
SKIP_DATA = 'ignore_data'
|
|
120
|
+
SKIP_INVALID = 'ignore_invalid'
|
|
121
|
+
CONFIRM_META = 'confirm_meta'
|
|
122
|
+
CONFIRM_WAVE = 'confirm_wave'
|
|
123
|
+
CONFIRM_MEDIAN = 'confirm_median'
|
|
124
|
+
SCHEMA = 'schema'
|
|
125
|
+
RPATH_L = 'raw_path_list'
|
|
126
|
+
FPATH_L = 'failed_path_list'
|
|
127
|
+
CPATH_L = 'curated_path_list'
|
|
128
|
+
KEY_L = 'key_list'
|
|
129
|
+
NO_DATA_L = 'no_data_list'
|
|
130
|
+
INVALID_L = 'invalid_list'
|
|
131
|
+
TABLE_CALLED = 'table_called'
|
|
132
|
+
WRITE_TAB = 'table'
|
|
133
|
+
WRITE_NUMPY = 'numpy'
|
|
134
|
+
WRITE_TFLOW = 'tensorflow'
|
|
135
|
+
WRITE_ECG_PATH = 'target_path'
|
|
136
|
+
WRITE_TYPE = 'file_type'
|
|
137
|
+
ID_START = '_id_start_number'
|
|
138
|
+
KEY = 'key'
|
|
139
|
+
FILENAM = 'filename'
|
|
140
|
+
SIG_LEN_W = 'signal_length_w'
|
|
141
|
+
SIG_LEN_M = 'signal_length_m'
|
|
142
|
+
PAD_VALUE = 'pad_value'
|
|
143
|
+
SN_W_PADDED = 'sampling number padded (waveforms)'
|
|
144
|
+
SN_M_PADDED = 'sampling number padded (medianbeats)'
|
|
145
|
+
DURATION_PADDED = 'duration padded (sec)'
|
|
146
|
+
|
|
147
|
+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
148
|
+
class PlotNames:
|
|
149
|
+
'''
|
|
150
|
+
Constants used by the ECGDrawing plotting module.
|
|
151
|
+
'''
|
|
152
|
+
MILLIVOLT = 'millivolt'
|
|
153
|
+
MICROVOLT = 'microvolt'
|
|
154
|
+
LEAD_VOLTAGES = 'lead_voltages'
|
|
155
|
+
START_POS_FIRST = 'first'
|
|
156
|
+
# #### standard ECG paper grid dimensions (mm)
|
|
157
|
+
MINOR_GRID_MM = 1.0
|
|
158
|
+
MAJOR_GRID_MM = 5.0
|
|
159
|
+
# #### ECGDrawing slot names
|
|
160
|
+
DEFAULT_LEADS = '_default_leads'
|
|
161
|
+
FIGURE = 'figure'
|
|
162
|
+
AXES = 'axes'
|
|
163
|
+
LAYOUT_MAPPER = 'layout_mapper'
|
|
164
|
+
STYLE = 'style'
|
|
165
|
+
MINOR_STEP_X = 'minor_step_x'
|
|
166
|
+
MAJOR_STEP_X = 'major_step_x'
|
|
167
|
+
MINOR_STEP_Y = 'minor_step_y'
|
|
168
|
+
MAJOR_STEP_Y = 'major_step_y'
|
|
169
|
+
PAPER_SPEED = 'paper_speed'
|
|
170
|
+
MM_PER_MV = 'mm_per_mv'
|