cardiac-coordinates 0.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.
- cardiac_coordinates-0.1.0/LICENSE +201 -0
- cardiac_coordinates-0.1.0/MANIFEST.in +4 -0
- cardiac_coordinates-0.1.0/NOTICE +27 -0
- cardiac_coordinates-0.1.0/PKG-INFO +191 -0
- cardiac_coordinates-0.1.0/README.md +134 -0
- cardiac_coordinates-0.1.0/pyproject.toml +158 -0
- cardiac_coordinates-0.1.0/setup.cfg +4 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/__init__.py +44 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/aha.py +937 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/apicobasal.py +833 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/axes.py +510 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/bridges.py +945 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/cli.py +553 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/cobivecox.py +631 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/compare.py +441 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/contours.py +223 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/datasets.py +97 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/fiber_laplace.py +511 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/inputs.py +397 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/io.py +390 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/markers.py +134 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/parallel.py +270 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/py.typed +0 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/regions.py +307 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/result.py +399 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/rotational.py +430 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/solvers.py +309 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/surfaces.py +81 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/transmural.py +112 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/transventricular.py +97 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/__init__.py +8 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/apicobasal.py +570 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/bridges.py +693 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/compute.py +639 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/convert.py +99 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/geodesic.py +433 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/inputs.py +241 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/lv_rotational.py +467 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/result.py +120 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/rotational.py +677 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/septum.py +354 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/split.py +321 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates/uvc/transmural.py +134 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates.egg-info/PKG-INFO +191 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates.egg-info/SOURCES.txt +96 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates.egg-info/dependency_links.txt +1 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates.egg-info/entry_points.txt +2 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates.egg-info/not-zip-safe +1 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates.egg-info/requires.txt +39 -0
- cardiac_coordinates-0.1.0/src/cardiac_coordinates.egg-info/top_level.txt +1 -0
- cardiac_coordinates-0.1.0/tests/conftest.py +650 -0
- cardiac_coordinates-0.1.0/tests/data/integration/lv_ellipsoid.npz +0 -0
- cardiac_coordinates-0.1.0/tests/data/integration/ukb_biv_10.npz +0 -0
- cardiac_coordinates-0.1.0/tests/data/integration/ukb_biv_clipped_10.npz +0 -0
- cardiac_coordinates-0.1.0/tests/data/make_integration_references.py +251 -0
- cardiac_coordinates-0.1.0/tests/integration_reference.py +82 -0
- cardiac_coordinates-0.1.0/tests/reference/test_reference.py +35 -0
- cardiac_coordinates-0.1.0/tests/reference/test_uvc_reference.py +478 -0
- cardiac_coordinates-0.1.0/tests/test_aha.py +141 -0
- cardiac_coordinates-0.1.0/tests/test_apicobasal.py +488 -0
- cardiac_coordinates-0.1.0/tests/test_axes.py +361 -0
- cardiac_coordinates-0.1.0/tests/test_bridges.py +678 -0
- cardiac_coordinates-0.1.0/tests/test_cli.py +546 -0
- cardiac_coordinates-0.1.0/tests/test_cobivecox.py +365 -0
- cardiac_coordinates-0.1.0/tests/test_compare.py +52 -0
- cardiac_coordinates-0.1.0/tests/test_compute.py +328 -0
- cardiac_coordinates-0.1.0/tests/test_contours.py +132 -0
- cardiac_coordinates-0.1.0/tests/test_datasets.py +19 -0
- cardiac_coordinates-0.1.0/tests/test_fiber_laplace.py +419 -0
- cardiac_coordinates-0.1.0/tests/test_import.py +37 -0
- cardiac_coordinates-0.1.0/tests/test_inputs.py +113 -0
- cardiac_coordinates-0.1.0/tests/test_integration_reference.py +54 -0
- cardiac_coordinates-0.1.0/tests/test_io.py +378 -0
- cardiac_coordinates-0.1.0/tests/test_markers.py +96 -0
- cardiac_coordinates-0.1.0/tests/test_regions.py +508 -0
- cardiac_coordinates-0.1.0/tests/test_result.py +28 -0
- cardiac_coordinates-0.1.0/tests/test_rotational.py +280 -0
- cardiac_coordinates-0.1.0/tests/test_solvers.py +390 -0
- cardiac_coordinates-0.1.0/tests/test_transmural.py +73 -0
- cardiac_coordinates-0.1.0/tests/test_transventricular.py +174 -0
- cardiac_coordinates-0.1.0/tests/uvc/__init__.py +0 -0
- cardiac_coordinates-0.1.0/tests/uvc/conftest.py +26 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_apicobasal.py +216 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_bridges.py +684 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_compute.py +398 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_convert.py +166 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_geodesic.py +184 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_inputs.py +92 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_lv_apicobasal.py +182 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_lv_compute.py +441 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_lv_inputs.py +102 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_lv_rotational.py +364 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_lv_transmural.py +79 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_rotational.py +378 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_septum.py +208 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_split.py +251 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_transmural.py +112 -0
- cardiac_coordinates-0.1.0/tests/uvc/test_uvc_io.py +166 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
cardiac-coordinates
|
|
2
|
+
Copyright 2026 Henrik Finsberg
|
|
3
|
+
|
|
4
|
+
This product is a Python/dolfinx port of the Cobiveco and CobivecoX methods and includes
|
|
5
|
+
translated portions of the Cobiveco MATLAB code (v1.1.1), which is
|
|
6
|
+
Copyright 2021 Steffen Schuler, Karlsruhe Institute of Technology, licensed under Apache-2.0
|
|
7
|
+
(https://github.com/KIT-IBT/Cobiveco).
|
|
8
|
+
|
|
9
|
+
Please cite:
|
|
10
|
+
|
|
11
|
+
- Schuler S, Pilia N, Potyagaylo D, Loewe A. Cobiveco: Consistent biventricular coordinates for
|
|
12
|
+
precise and intuitive description of position in the heart - with MATLAB implementation.
|
|
13
|
+
Medical Image Analysis 74:102247, 2021. doi:10.1016/j.media.2021.102247
|
|
14
|
+
- Pankewitz L, et al. CobivecoX: Consistent biventricular coordinates for hearts with congenital
|
|
15
|
+
heart disease. Medical Image Analysis 93:103091, 2024. doi:10.1016/j.media.2024.103091
|
|
16
|
+
|
|
17
|
+
Files ported from fenicsx-ldrb or cardiac-geometriesx (MIT, Computational Physiology at Simula
|
|
18
|
+
Research Laboratory) say so in a header comment.
|
|
19
|
+
|
|
20
|
+
Files ported from Cobiveco's MATLAB class @uvc ("Universal Ventricular Coordinates (according to
|
|
21
|
+
Bayer 2018)"), Copyright (c) 2021 Steffen Schuler, KIT, licensed under Apache-2.0, say so in a
|
|
22
|
+
header comment and are changed (ported to Python/dolfinx):
|
|
23
|
+
|
|
24
|
+
- src/cardiac_coordinates/uvc/split.py (computeTransventricular.m, splitMesh.m)
|
|
25
|
+
- src/cardiac_coordinates/uvc/transmural.py (computeTransmural.m)
|
|
26
|
+
- src/cardiac_coordinates/uvc/apicobasal.py (computeApicobasal.m)
|
|
27
|
+
- src/cardiac_coordinates/uvc/rotational.py (computeRotational.m)
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cardiac-coordinates
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Biventricular cardiac coordinates (a dolfinx port of Cobiveco and CobivecoX)
|
|
5
|
+
Author-email: Henrik Finsberg <henriknf@simula.no>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/ComputationalPhysiology/cardiac-coordinates
|
|
8
|
+
Project-URL: Documentation, https://computationalphysiology.github.io/cardiac-coordinates
|
|
9
|
+
Project-URL: Source, https://github.com/ComputationalPhysiology/cardiac-coordinates
|
|
10
|
+
Project-URL: Tracker, https://github.com/ComputationalPhysiology/cardiac-coordinates/issues
|
|
11
|
+
Keywords: cardiac,coordinates,biventricular,cobiveco
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
License-File: NOTICE
|
|
22
|
+
Requires-Dist: fenics-dolfinx>=0.10.0
|
|
23
|
+
Requires-Dist: io4dolfinx>=2.2.0
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Requires-Dist: scipy
|
|
26
|
+
Provides-Extra: cobiveco-files
|
|
27
|
+
Requires-Dist: pyvista; extra == "cobiveco-files"
|
|
28
|
+
Provides-Extra: test
|
|
29
|
+
Requires-Dist: pytest; extra == "test"
|
|
30
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
31
|
+
Requires-Dist: cardiac-geometriesx>=0.23.1; extra == "test"
|
|
32
|
+
Requires-Dist: fenicsx-ldrb>=0.5.0; extra == "test"
|
|
33
|
+
Requires-Dist: pyvista; extra == "test"
|
|
34
|
+
Requires-Dist: meshio; extra == "test"
|
|
35
|
+
Requires-Dist: ukb-atlas>=2.2.1; extra == "test"
|
|
36
|
+
Requires-Dist: pre-commit; extra == "test"
|
|
37
|
+
Provides-Extra: docs
|
|
38
|
+
Requires-Dist: jupyter-book<2.0; extra == "docs"
|
|
39
|
+
Requires-Dist: jupytext; extra == "docs"
|
|
40
|
+
Requires-Dist: jupyter; extra == "docs"
|
|
41
|
+
Requires-Dist: pyvista[all]>=0.49.0; extra == "docs"
|
|
42
|
+
Requires-Dist: cardiac-geometriesx>=0.23.1; extra == "docs"
|
|
43
|
+
Requires-Dist: fenicsx-ldrb>=0.5.0; extra == "docs"
|
|
44
|
+
Requires-Dist: ukb-atlas>=2.2.1; extra == "docs"
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: bump-my-version; extra == "dev"
|
|
47
|
+
Requires-Dist: ipython; extra == "dev"
|
|
48
|
+
Requires-Dist: pre-commit; extra == "dev"
|
|
49
|
+
Requires-Dist: twine; extra == "dev"
|
|
50
|
+
Requires-Dist: wheel; extra == "dev"
|
|
51
|
+
Requires-Dist: mypy; extra == "dev"
|
|
52
|
+
Provides-Extra: all
|
|
53
|
+
Requires-Dist: cardiac-coordinates[docs]; extra == "all"
|
|
54
|
+
Requires-Dist: cardiac-coordinates[test]; extra == "all"
|
|
55
|
+
Requires-Dist: cardiac-coordinates[dev]; extra == "all"
|
|
56
|
+
Dynamic: license-file
|
|
57
|
+
|
|
58
|
+
# cardiac-coordinates
|
|
59
|
+
|
|
60
|
+
Biventricular coordinates for FEniCSx (dolfinx). The package is a Python port of the authors'
|
|
61
|
+
MATLAB code for Cobiveco (Schuler et al. 2021) and its extension to hearts with four valves,
|
|
62
|
+
CobivecoX (Pankewitz et al. 2024). It works on the input mesh as it is, without remeshing, and
|
|
63
|
+
runs in parallel with MPI.
|
|
64
|
+
|
|
65
|
+
From a tetrahedral mesh with tagged boundary surfaces, `compute` returns:
|
|
66
|
+
|
|
67
|
+
- the coordinates `tv` (transventricular, 0 LV, 1 RV), `tm` (transmural), `ab` (apicobasal),
|
|
68
|
+
`rt` (rotational), `rtSin` and `rtCos`, plus `bridge` for CobivecoX. These are P1 functions with
|
|
69
|
+
the names and conventions of the authors' `result.vtu`;
|
|
70
|
+
- the Laplace solutions behind them and, on request, those of the rule-based fiber methods of
|
|
71
|
+
Bayer et al. (2012) and Doste et al. (2019);
|
|
72
|
+
- the heart axes, the apex and the valve centres.
|
|
73
|
+
|
|
74
|
+
`regions` derives the 17 AHA segments, the 15 RV regions of Zhong et al. (2012) and the LVOT from
|
|
75
|
+
the coordinates. `save` and `load` write the result to one file and read it back without
|
|
76
|
+
recomputing.
|
|
77
|
+
|
|
78
|
+
`cardiac_coordinates.aha` holds the region methods that cardiac-geometriesx used (from the UKB
|
|
79
|
+
landmarks, and the prolate-ellipsoid regions of the LV), with the same tags, and
|
|
80
|
+
`cardiac_coordinates.fiber_laplace` the Laplace problems of the fiber methods. cardiac-geometriesx
|
|
81
|
+
and fenicsx-ldrb call these.
|
|
82
|
+
|
|
83
|
+
`cardiac_coordinates.uvc` computes the Universal Ventricular Coordinates of Bayer et al. (2018)
|
|
84
|
+
(`z`, `rho`, `phi`, `nu`) as Cobiveco's MATLAB class `@uvc` does, on biventricular meshes and on
|
|
85
|
+
meshes of the left ventricle alone. `save`, `load` and the command line handle them the same way.
|
|
86
|
+
|
|
87
|
+
## Install
|
|
88
|
+
|
|
89
|
+
The package needs dolfinx 0.10 or newer. With dolfinx installed:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
python3 -m pip install cardiac-coordinates
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
To read the authors' Cobiveco/CobivecoX folders (`.vtu` and `.ply` files), install the extra
|
|
96
|
+
`cobiveco-files` (adds pyvista):
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
python3 -m pip install "cardiac-coordinates[cobiveco-files]"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
A conda-forge package is planned.
|
|
103
|
+
|
|
104
|
+
## Quick start
|
|
105
|
+
|
|
106
|
+
The surfaces need facet tags named `LV_ENDO`, `RV_ENDO` and `EPI`, plus `BASE` for a flat base
|
|
107
|
+
(Cobiveco) or the valves `MV`, `AV`, `TV` and `PV` (CobivecoX). Other names can be remapped with
|
|
108
|
+
`names`.
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from mpi4py import MPI
|
|
112
|
+
import cardiac_coordinates
|
|
113
|
+
|
|
114
|
+
# a dolfinx mesh, its facet tags, and markers name -> (tag, dim)
|
|
115
|
+
mesh, ffun, markers = cardiac_coordinates.read("heart.vtkhdf", MPI.COMM_WORLD)
|
|
116
|
+
|
|
117
|
+
coords = cardiac_coordinates.compute(mesh, ffun, markers)
|
|
118
|
+
print(coords.variant) # "cobiveco" (flat base) or "cobivecox" (four valves)
|
|
119
|
+
ab = coords.ab # a dolfinx Function on the mesh vertices
|
|
120
|
+
|
|
121
|
+
tags, region_markers, empty = cardiac_coordinates.regions(coords)
|
|
122
|
+
cardiac_coordinates.save(coords, "coordinates.vtkhdf", regions=(tags, region_markers))
|
|
123
|
+
coords = cardiac_coordinates.load("coordinates.vtkhdf", MPI.COMM_WORLD)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
For the Universal Ventricular Coordinates:
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
uvc = cardiac_coordinates.uvc.compute(mesh, ffun, markers)
|
|
130
|
+
z, rho, phi = uvc.z, uvc.rho, uvc.phi
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The command-line tool does the same:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
mpirun -n 4 cardiac-coordinates heart.vtkhdf -o coordinates.vtkhdf --regions
|
|
137
|
+
mpirun -n 4 cardiac-coordinates heart.vtkhdf -o uvc.vtkhdf --method uvc
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The input can also be a folder in the authors' layout (a `.vtu` volume plus one `.ply` file per
|
|
141
|
+
surface). The output opens in ParaView. See `cardiac-coordinates --help`.
|
|
142
|
+
|
|
143
|
+
## Documentation
|
|
144
|
+
|
|
145
|
+
The documentation is at <https://computationalphysiology.github.io/cardiac-coordinates>. It covers
|
|
146
|
+
the method, the differences from the authors' code and papers, the Universal Ventricular
|
|
147
|
+
Coordinates, the regions, the comparison with the authors' results on their ten CobivecoX patients,
|
|
148
|
+
and five demos: a flat-base BiV ellipsoid, a CobivecoX patient, the UK Biobank mean shape, UVC on
|
|
149
|
+
the UK Biobank mean shape and LV-only UVC.
|
|
150
|
+
|
|
151
|
+
## Tests
|
|
152
|
+
|
|
153
|
+
The checks CI runs, to run locally before a commit (no Docker needed; the reference data come from
|
|
154
|
+
Zenodo, or from a folder given by `CARDIAC_COORDINATES_DATA`):
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
pre-commit run --all-files
|
|
158
|
+
python3 -m pytest -q
|
|
159
|
+
mpirun -n 2 python3 -m pytest -q -m mpi
|
|
160
|
+
# the reference comparison (slow, needs the CobivecoX data)
|
|
161
|
+
python3 -m pytest -q -m slow --runslow
|
|
162
|
+
mpirun -n 2 python3 -m pytest -q -m "slow and mpi" --runslow
|
|
163
|
+
# documentation and package
|
|
164
|
+
jupyter book build -W .
|
|
165
|
+
python3 -m build && python3 -m twine check dist/*
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Citing
|
|
169
|
+
|
|
170
|
+
If you use this package, please cite the papers of the method:
|
|
171
|
+
|
|
172
|
+
- S. Schuler, N. Pilia, D. Potyagaylo, A. Loewe. Cobiveco: Consistent biventricular coordinates
|
|
173
|
+
for precise and intuitive description of position in the heart – with MATLAB implementation.
|
|
174
|
+
Medical Image Analysis 74:102247, 2021.
|
|
175
|
+
[doi:10.1016/j.media.2021.102247](https://doi.org/10.1016/j.media.2021.102247)
|
|
176
|
+
- L. Pankewitz et al. CobivecoX: Consistent biventricular coordinates for hearts with congenital
|
|
177
|
+
heart disease. Medical Image Analysis 93:103091, 2024.
|
|
178
|
+
[doi:10.1016/j.media.2024.103091](https://doi.org/10.1016/j.media.2024.103091)
|
|
179
|
+
|
|
180
|
+
and, for the Universal Ventricular Coordinates:
|
|
181
|
+
|
|
182
|
+
- J. Bayer, A. J. Prassl, A. Pashaei et al. Universal ventricular coordinates: A generic framework
|
|
183
|
+
for describing position within the heart and transferring data. Medical Image Analysis 45:83-93,
|
|
184
|
+
2018.
|
|
185
|
+
[doi:10.1016/j.media.2018.01.005](https://doi.org/10.1016/j.media.2018.01.005)
|
|
186
|
+
|
|
187
|
+
## Licence
|
|
188
|
+
|
|
189
|
+
Apache-2.0. The package includes code translated from Cobiveco v1.1.1
|
|
190
|
+
(<https://github.com/KIT-IBT/Cobiveco>, Copyright 2021 Steffen Schuler, Karlsruhe Institute of
|
|
191
|
+
Technology, Apache-2.0); see `NOTICE`.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# cardiac-coordinates
|
|
2
|
+
|
|
3
|
+
Biventricular coordinates for FEniCSx (dolfinx). The package is a Python port of the authors'
|
|
4
|
+
MATLAB code for Cobiveco (Schuler et al. 2021) and its extension to hearts with four valves,
|
|
5
|
+
CobivecoX (Pankewitz et al. 2024). It works on the input mesh as it is, without remeshing, and
|
|
6
|
+
runs in parallel with MPI.
|
|
7
|
+
|
|
8
|
+
From a tetrahedral mesh with tagged boundary surfaces, `compute` returns:
|
|
9
|
+
|
|
10
|
+
- the coordinates `tv` (transventricular, 0 LV, 1 RV), `tm` (transmural), `ab` (apicobasal),
|
|
11
|
+
`rt` (rotational), `rtSin` and `rtCos`, plus `bridge` for CobivecoX. These are P1 functions with
|
|
12
|
+
the names and conventions of the authors' `result.vtu`;
|
|
13
|
+
- the Laplace solutions behind them and, on request, those of the rule-based fiber methods of
|
|
14
|
+
Bayer et al. (2012) and Doste et al. (2019);
|
|
15
|
+
- the heart axes, the apex and the valve centres.
|
|
16
|
+
|
|
17
|
+
`regions` derives the 17 AHA segments, the 15 RV regions of Zhong et al. (2012) and the LVOT from
|
|
18
|
+
the coordinates. `save` and `load` write the result to one file and read it back without
|
|
19
|
+
recomputing.
|
|
20
|
+
|
|
21
|
+
`cardiac_coordinates.aha` holds the region methods that cardiac-geometriesx used (from the UKB
|
|
22
|
+
landmarks, and the prolate-ellipsoid regions of the LV), with the same tags, and
|
|
23
|
+
`cardiac_coordinates.fiber_laplace` the Laplace problems of the fiber methods. cardiac-geometriesx
|
|
24
|
+
and fenicsx-ldrb call these.
|
|
25
|
+
|
|
26
|
+
`cardiac_coordinates.uvc` computes the Universal Ventricular Coordinates of Bayer et al. (2018)
|
|
27
|
+
(`z`, `rho`, `phi`, `nu`) as Cobiveco's MATLAB class `@uvc` does, on biventricular meshes and on
|
|
28
|
+
meshes of the left ventricle alone. `save`, `load` and the command line handle them the same way.
|
|
29
|
+
|
|
30
|
+
## Install
|
|
31
|
+
|
|
32
|
+
The package needs dolfinx 0.10 or newer. With dolfinx installed:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python3 -m pip install cardiac-coordinates
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
To read the authors' Cobiveco/CobivecoX folders (`.vtu` and `.ply` files), install the extra
|
|
39
|
+
`cobiveco-files` (adds pyvista):
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
python3 -m pip install "cardiac-coordinates[cobiveco-files]"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
A conda-forge package is planned.
|
|
46
|
+
|
|
47
|
+
## Quick start
|
|
48
|
+
|
|
49
|
+
The surfaces need facet tags named `LV_ENDO`, `RV_ENDO` and `EPI`, plus `BASE` for a flat base
|
|
50
|
+
(Cobiveco) or the valves `MV`, `AV`, `TV` and `PV` (CobivecoX). Other names can be remapped with
|
|
51
|
+
`names`.
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from mpi4py import MPI
|
|
55
|
+
import cardiac_coordinates
|
|
56
|
+
|
|
57
|
+
# a dolfinx mesh, its facet tags, and markers name -> (tag, dim)
|
|
58
|
+
mesh, ffun, markers = cardiac_coordinates.read("heart.vtkhdf", MPI.COMM_WORLD)
|
|
59
|
+
|
|
60
|
+
coords = cardiac_coordinates.compute(mesh, ffun, markers)
|
|
61
|
+
print(coords.variant) # "cobiveco" (flat base) or "cobivecox" (four valves)
|
|
62
|
+
ab = coords.ab # a dolfinx Function on the mesh vertices
|
|
63
|
+
|
|
64
|
+
tags, region_markers, empty = cardiac_coordinates.regions(coords)
|
|
65
|
+
cardiac_coordinates.save(coords, "coordinates.vtkhdf", regions=(tags, region_markers))
|
|
66
|
+
coords = cardiac_coordinates.load("coordinates.vtkhdf", MPI.COMM_WORLD)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
For the Universal Ventricular Coordinates:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
uvc = cardiac_coordinates.uvc.compute(mesh, ffun, markers)
|
|
73
|
+
z, rho, phi = uvc.z, uvc.rho, uvc.phi
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The command-line tool does the same:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
mpirun -n 4 cardiac-coordinates heart.vtkhdf -o coordinates.vtkhdf --regions
|
|
80
|
+
mpirun -n 4 cardiac-coordinates heart.vtkhdf -o uvc.vtkhdf --method uvc
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The input can also be a folder in the authors' layout (a `.vtu` volume plus one `.ply` file per
|
|
84
|
+
surface). The output opens in ParaView. See `cardiac-coordinates --help`.
|
|
85
|
+
|
|
86
|
+
## Documentation
|
|
87
|
+
|
|
88
|
+
The documentation is at <https://computationalphysiology.github.io/cardiac-coordinates>. It covers
|
|
89
|
+
the method, the differences from the authors' code and papers, the Universal Ventricular
|
|
90
|
+
Coordinates, the regions, the comparison with the authors' results on their ten CobivecoX patients,
|
|
91
|
+
and five demos: a flat-base BiV ellipsoid, a CobivecoX patient, the UK Biobank mean shape, UVC on
|
|
92
|
+
the UK Biobank mean shape and LV-only UVC.
|
|
93
|
+
|
|
94
|
+
## Tests
|
|
95
|
+
|
|
96
|
+
The checks CI runs, to run locally before a commit (no Docker needed; the reference data come from
|
|
97
|
+
Zenodo, or from a folder given by `CARDIAC_COORDINATES_DATA`):
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pre-commit run --all-files
|
|
101
|
+
python3 -m pytest -q
|
|
102
|
+
mpirun -n 2 python3 -m pytest -q -m mpi
|
|
103
|
+
# the reference comparison (slow, needs the CobivecoX data)
|
|
104
|
+
python3 -m pytest -q -m slow --runslow
|
|
105
|
+
mpirun -n 2 python3 -m pytest -q -m "slow and mpi" --runslow
|
|
106
|
+
# documentation and package
|
|
107
|
+
jupyter book build -W .
|
|
108
|
+
python3 -m build && python3 -m twine check dist/*
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Citing
|
|
112
|
+
|
|
113
|
+
If you use this package, please cite the papers of the method:
|
|
114
|
+
|
|
115
|
+
- S. Schuler, N. Pilia, D. Potyagaylo, A. Loewe. Cobiveco: Consistent biventricular coordinates
|
|
116
|
+
for precise and intuitive description of position in the heart – with MATLAB implementation.
|
|
117
|
+
Medical Image Analysis 74:102247, 2021.
|
|
118
|
+
[doi:10.1016/j.media.2021.102247](https://doi.org/10.1016/j.media.2021.102247)
|
|
119
|
+
- L. Pankewitz et al. CobivecoX: Consistent biventricular coordinates for hearts with congenital
|
|
120
|
+
heart disease. Medical Image Analysis 93:103091, 2024.
|
|
121
|
+
[doi:10.1016/j.media.2024.103091](https://doi.org/10.1016/j.media.2024.103091)
|
|
122
|
+
|
|
123
|
+
and, for the Universal Ventricular Coordinates:
|
|
124
|
+
|
|
125
|
+
- J. Bayer, A. J. Prassl, A. Pashaei et al. Universal ventricular coordinates: A generic framework
|
|
126
|
+
for describing position within the heart and transferring data. Medical Image Analysis 45:83-93,
|
|
127
|
+
2018.
|
|
128
|
+
[doi:10.1016/j.media.2018.01.005](https://doi.org/10.1016/j.media.2018.01.005)
|
|
129
|
+
|
|
130
|
+
## Licence
|
|
131
|
+
|
|
132
|
+
Apache-2.0. The package includes code translated from Cobiveco v1.1.1
|
|
133
|
+
(<https://github.com/KIT-IBT/Cobiveco>, Copyright 2021 Steffen Schuler, Karlsruhe Institute of
|
|
134
|
+
Technology, Apache-2.0); see `NOTICE`.
|