cardiac-geometriesx 0.4.6__tar.gz → 0.4.8__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.
Potentially problematic release.
This version of cardiac-geometriesx might be problematic. Click here for more details.
- {cardiac_geometriesx-0.4.6/src/cardiac_geometriesx.egg-info → cardiac_geometriesx-0.4.8}/PKG-INFO +4 -3
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/pyproject.toml +3 -3
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/cli.py +10 -4
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/geometry.py +12 -5
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/mesh.py +40 -35
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8/src/cardiac_geometriesx.egg-info}/PKG-INFO +4 -3
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometriesx.egg-info/requires.txt +1 -1
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/tests/test_cli.py +21 -14
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/LICENSE +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/README.md +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/setup.cfg +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/__init__.py +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/fibers/__init__.py +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/fibers/lv_ellipsoid.py +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/fibers/slab.py +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/fibers/utils.py +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/gui.py +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/utils.py +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometriesx.egg-info/SOURCES.txt +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometriesx.egg-info/dependency_links.txt +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometriesx.egg-info/entry_points.txt +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometriesx.egg-info/not-zip-safe +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometriesx.egg-info/top_level.txt +0 -0
- {cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/tests/test_save_load.py +0 -0
{cardiac_geometriesx-0.4.6/src/cardiac_geometriesx.egg-info → cardiac_geometriesx-0.4.8}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: cardiac-geometriesx
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.8
|
|
4
4
|
Summary: A python library for cardiac geometries
|
|
5
5
|
Author-email: Henrik Finsberg <henriknf@simula.no>
|
|
6
6
|
License: MIT
|
|
@@ -38,7 +38,7 @@ Provides-Extra: test
|
|
|
38
38
|
Requires-Dist: pre-commit; extra == "test"
|
|
39
39
|
Requires-Dist: pytest; extra == "test"
|
|
40
40
|
Requires-Dist: pytest-cov; extra == "test"
|
|
41
|
-
Requires-Dist: ukb-atlas; extra == "test"
|
|
41
|
+
Requires-Dist: ukb-atlas[pyvista]; extra == "test"
|
|
42
42
|
Requires-Dist: fenicsx-ldrb; extra == "test"
|
|
43
43
|
Provides-Extra: gui
|
|
44
44
|
Requires-Dist: streamlit; extra == "gui"
|
|
@@ -47,6 +47,7 @@ Requires-Dist: pyvista[all]>=0.43.0; extra == "gui"
|
|
|
47
47
|
Requires-Dist: trame-vuetify; extra == "gui"
|
|
48
48
|
Requires-Dist: ipywidgets; extra == "gui"
|
|
49
49
|
Requires-Dist: fenicsx-ldrb; extra == "gui"
|
|
50
|
+
Dynamic: license-file
|
|
50
51
|
|
|
51
52
|

|
|
52
53
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cardiac-geometriesx"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.8"
|
|
8
8
|
description = "A python library for cardiac geometries"
|
|
9
9
|
authors = [{name = "Henrik Finsberg", email = "henriknf@simula.no"}]
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -52,7 +52,7 @@ test = [
|
|
|
52
52
|
"pre-commit",
|
|
53
53
|
"pytest",
|
|
54
54
|
"pytest-cov",
|
|
55
|
-
"ukb-atlas",
|
|
55
|
+
"ukb-atlas[pyvista]",
|
|
56
56
|
"fenicsx-ldrb",
|
|
57
57
|
]
|
|
58
58
|
gui = [
|
|
@@ -177,7 +177,7 @@ tag = true
|
|
|
177
177
|
sign_tags = false
|
|
178
178
|
tag_name = "v{new_version}"
|
|
179
179
|
tag_message = "Bump version: {current_version} → {new_version}"
|
|
180
|
-
current_version = "0.4.
|
|
180
|
+
current_version = "0.4.8"
|
|
181
181
|
|
|
182
182
|
|
|
183
183
|
[[tool.bumpversion.files]]
|
|
@@ -92,6 +92,14 @@ def app():
|
|
|
92
92
|
help="Function space for fibers of the form family_degree",
|
|
93
93
|
show_default=True,
|
|
94
94
|
)
|
|
95
|
+
@click.option(
|
|
96
|
+
"--clipped/--no-clipped",
|
|
97
|
+
default=False,
|
|
98
|
+
is_flag=True,
|
|
99
|
+
type=bool,
|
|
100
|
+
help="If True create clip away the outflow tracts",
|
|
101
|
+
show_default=True,
|
|
102
|
+
)
|
|
95
103
|
def ukb(
|
|
96
104
|
outdir: Path | str,
|
|
97
105
|
mode: int = -1,
|
|
@@ -102,6 +110,7 @@ def ukb(
|
|
|
102
110
|
fiber_angle_endo: float = 60,
|
|
103
111
|
fiber_angle_epi: float = -60,
|
|
104
112
|
fiber_space: str = "P_1",
|
|
113
|
+
clipped: bool = False,
|
|
105
114
|
):
|
|
106
115
|
outdir = Path(outdir)
|
|
107
116
|
outdir.mkdir(exist_ok=True)
|
|
@@ -116,6 +125,7 @@ def ukb(
|
|
|
116
125
|
fiber_angle_endo=fiber_angle_endo,
|
|
117
126
|
fiber_angle_epi=fiber_angle_epi,
|
|
118
127
|
fiber_space=fiber_space,
|
|
128
|
+
clipped=clipped,
|
|
119
129
|
)
|
|
120
130
|
geo.save(outdir / "ukb.bp")
|
|
121
131
|
|
|
@@ -199,7 +209,6 @@ def ukb(
|
|
|
199
209
|
"--create-fibers",
|
|
200
210
|
default=False,
|
|
201
211
|
is_flag=True,
|
|
202
|
-
type=bool,
|
|
203
212
|
help="If True create analytic fibers",
|
|
204
213
|
show_default=True,
|
|
205
214
|
)
|
|
@@ -421,7 +430,6 @@ def lv_ellipsoid(
|
|
|
421
430
|
"--create-fibers",
|
|
422
431
|
default=False,
|
|
423
432
|
is_flag=True,
|
|
424
|
-
type=bool,
|
|
425
433
|
help="If True create analytic fibers",
|
|
426
434
|
show_default=True,
|
|
427
435
|
)
|
|
@@ -689,7 +697,6 @@ def biv_ellipsoid(
|
|
|
689
697
|
"--create-fibers",
|
|
690
698
|
default=False,
|
|
691
699
|
is_flag=True,
|
|
692
|
-
type=bool,
|
|
693
700
|
help="If True create analytic fibers",
|
|
694
701
|
show_default=True,
|
|
695
702
|
)
|
|
@@ -827,7 +834,6 @@ def biv_ellipsoid_torso(
|
|
|
827
834
|
"--create-fibers",
|
|
828
835
|
default=False,
|
|
829
836
|
is_flag=True,
|
|
830
|
-
type=bool,
|
|
831
837
|
help="If True create analytic fibers",
|
|
832
838
|
show_default=True,
|
|
833
839
|
)
|
|
@@ -98,7 +98,12 @@ class Geometry:
|
|
|
98
98
|
self.mesh.comm.barrier()
|
|
99
99
|
|
|
100
100
|
@classmethod
|
|
101
|
-
def from_file(
|
|
101
|
+
def from_file(
|
|
102
|
+
cls,
|
|
103
|
+
comm: MPI.Intracomm,
|
|
104
|
+
path: str | Path,
|
|
105
|
+
function_space_data: dict[str, np.ndarray] | None = None,
|
|
106
|
+
) -> "Geometry":
|
|
102
107
|
path = Path(path)
|
|
103
108
|
|
|
104
109
|
mesh = adios4dolfinx.read_mesh(comm=comm, filename=path)
|
|
@@ -118,10 +123,12 @@ class Geometry:
|
|
|
118
123
|
tags[name] = None
|
|
119
124
|
|
|
120
125
|
functions = {}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
if function_space_data is None:
|
|
127
|
+
function_space_data = adios4dolfinx.read_attributes(
|
|
128
|
+
comm=comm, filename=path, name="function_space"
|
|
129
|
+
)
|
|
130
|
+
assert isinstance(function_space_data, dict), "function_space_data must be a dictionary"
|
|
131
|
+
for name, el in function_space_data.items():
|
|
125
132
|
element = utils.array2element(el)
|
|
126
133
|
V = dolfinx.fem.functionspace(mesh, element)
|
|
127
134
|
f = dolfinx.fem.Function(V, name=name)
|
|
@@ -32,6 +32,7 @@ def ukb(
|
|
|
32
32
|
fiber_angle_endo: float = 60,
|
|
33
33
|
fiber_angle_epi: float = -60,
|
|
34
34
|
fiber_space: str = "P_1",
|
|
35
|
+
clipped: bool = False,
|
|
35
36
|
comm: MPI.Comm = MPI.COMM_WORLD,
|
|
36
37
|
) -> Geometry:
|
|
37
38
|
try:
|
|
@@ -44,26 +45,29 @@ def ukb(
|
|
|
44
45
|
raise ImportError(msg) from e
|
|
45
46
|
|
|
46
47
|
if comm.rank == 0:
|
|
48
|
+
ukb.cli.main(["surf", str(outdir), "--mode", str(mode), "--std", str(std), "--case", case])
|
|
49
|
+
mesh_args = [
|
|
50
|
+
"mesh",
|
|
51
|
+
str(outdir),
|
|
52
|
+
"--case",
|
|
53
|
+
case,
|
|
54
|
+
"--char_length_max",
|
|
55
|
+
str(char_length_max),
|
|
56
|
+
"--char_length_min",
|
|
57
|
+
str(char_length_min),
|
|
58
|
+
]
|
|
59
|
+
if clipped:
|
|
60
|
+
ukb.cli.main(["clip", str(outdir), "--case", case, "--smooth"])
|
|
61
|
+
mesh_args.append("--clipped")
|
|
47
62
|
print(comm.rank)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
str(outdir),
|
|
51
|
-
"--mode",
|
|
52
|
-
str(mode),
|
|
53
|
-
"--std",
|
|
54
|
-
str(std),
|
|
55
|
-
"--case",
|
|
56
|
-
case,
|
|
57
|
-
"--mesh",
|
|
58
|
-
"--char_length_max",
|
|
59
|
-
str(char_length_max),
|
|
60
|
-
"--char_length_min",
|
|
61
|
-
str(char_length_min),
|
|
62
|
-
]
|
|
63
|
-
)
|
|
63
|
+
|
|
64
|
+
ukb.cli.main(mesh_args)
|
|
64
65
|
comm.barrier()
|
|
65
66
|
outdir = Path(outdir)
|
|
66
|
-
|
|
67
|
+
if clipped:
|
|
68
|
+
mesh_name = outdir / f"{case}_clipped.msh"
|
|
69
|
+
else:
|
|
70
|
+
mesh_name = outdir / f"{case}.msh"
|
|
67
71
|
|
|
68
72
|
geometry = utils.gmsh2dolfin(comm=comm, msh_file=mesh_name)
|
|
69
73
|
|
|
@@ -98,24 +102,25 @@ def ukb(
|
|
|
98
102
|
)
|
|
99
103
|
raise ImportError(msg)
|
|
100
104
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
105
|
+
if clipped:
|
|
106
|
+
markers = {
|
|
107
|
+
"lv": [geometry.markers["LV"][0]],
|
|
108
|
+
"rv": [geometry.markers["RV"][0]],
|
|
109
|
+
"epi": [geometry.markers["EPI"][0]],
|
|
110
|
+
"base": [geometry.markers["BASE"][0]],
|
|
111
|
+
}
|
|
112
|
+
else:
|
|
113
|
+
markers = {
|
|
114
|
+
"lv": [geometry.markers["LV"][0]],
|
|
115
|
+
"rv": [geometry.markers["RV"][0]],
|
|
116
|
+
"epi": [geometry.markers["EPI"][0]],
|
|
117
|
+
"base": [
|
|
118
|
+
geometry.markers["PV"][0],
|
|
119
|
+
geometry.markers["TV"][0],
|
|
120
|
+
geometry.markers["AV"][0],
|
|
121
|
+
geometry.markers["MV"][0],
|
|
122
|
+
],
|
|
123
|
+
}
|
|
119
124
|
system = ldrb.dolfinx_ldrb(
|
|
120
125
|
mesh=geometry.mesh,
|
|
121
126
|
ffun=geometry.ffun,
|
{cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8/src/cardiac_geometriesx.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: cardiac-geometriesx
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.8
|
|
4
4
|
Summary: A python library for cardiac geometries
|
|
5
5
|
Author-email: Henrik Finsberg <henriknf@simula.no>
|
|
6
6
|
License: MIT
|
|
@@ -38,7 +38,7 @@ Provides-Extra: test
|
|
|
38
38
|
Requires-Dist: pre-commit; extra == "test"
|
|
39
39
|
Requires-Dist: pytest; extra == "test"
|
|
40
40
|
Requires-Dist: pytest-cov; extra == "test"
|
|
41
|
-
Requires-Dist: ukb-atlas; extra == "test"
|
|
41
|
+
Requires-Dist: ukb-atlas[pyvista]; extra == "test"
|
|
42
42
|
Requires-Dist: fenicsx-ldrb; extra == "test"
|
|
43
43
|
Provides-Extra: gui
|
|
44
44
|
Requires-Dist: streamlit; extra == "gui"
|
|
@@ -47,6 +47,7 @@ Requires-Dist: pyvista[all]>=0.43.0; extra == "gui"
|
|
|
47
47
|
Requires-Dist: trame-vuetify; extra == "gui"
|
|
48
48
|
Requires-Dist: ipywidgets; extra == "gui"
|
|
49
49
|
Requires-Dist: fenicsx-ldrb; extra == "gui"
|
|
50
|
+
Dynamic: license-file
|
|
50
51
|
|
|
51
52
|

|
|
52
53
|
|
|
@@ -60,29 +60,36 @@ def test_script_no_fibers(script, tmp_path: Path):
|
|
|
60
60
|
assert geo.mesh.geometry.dim == 3
|
|
61
61
|
|
|
62
62
|
|
|
63
|
+
@pytest.mark.parametrize("clipped", [True, False])
|
|
63
64
|
@pytest.mark.parametrize("case", ["ED", "ES"])
|
|
64
|
-
def test_ukb(tmp_path: Path, case: str):
|
|
65
|
+
def test_ukb(tmp_path: Path, case: str, clipped: bool):
|
|
65
66
|
runner = CliRunner()
|
|
66
67
|
|
|
67
68
|
comm = MPI.COMM_WORLD
|
|
68
69
|
path = comm.bcast(tmp_path, root=0)
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
args = [
|
|
72
|
+
path.as_posix(),
|
|
73
|
+
"--case",
|
|
74
|
+
case,
|
|
75
|
+
"--char-length-max",
|
|
76
|
+
"10.0",
|
|
77
|
+
"--char-length-min",
|
|
78
|
+
"10.0",
|
|
79
|
+
]
|
|
80
|
+
if clipped:
|
|
81
|
+
if case == "ES":
|
|
82
|
+
pytest.skip("Clipped case with default values are for ED")
|
|
83
|
+
args.append("--clipped")
|
|
84
|
+
|
|
85
|
+
res = runner.invoke(cli.ukb, args)
|
|
82
86
|
assert res.exit_code == 0
|
|
83
87
|
assert path.is_dir()
|
|
84
88
|
|
|
85
89
|
assert (path / "mesh.xdmf").exists()
|
|
86
|
-
|
|
90
|
+
if clipped:
|
|
91
|
+
assert (path / f"{case}_clipped.msh").exists()
|
|
92
|
+
else:
|
|
93
|
+
assert (path / f"{case}.msh").exists()
|
|
87
94
|
geo = Geometry.from_folder(comm=comm, folder=path)
|
|
88
95
|
assert geo.mesh.geometry.dim == 3
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/fibers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/fibers/slab.py
RENAMED
|
File without changes
|
{cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometries/fibers/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cardiac_geometriesx-0.4.6 → cardiac_geometriesx-0.4.8}/src/cardiac_geometriesx.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|