cardio 2023.1.2__tar.gz → 2025.8.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.
Files changed (39) hide show
  1. cardio-2025.8.0/PKG-INFO +94 -0
  2. cardio-2025.8.0/README.md +40 -0
  3. {cardio-2023.1.2 → cardio-2025.8.0}/pyproject.toml +25 -13
  4. {cardio-2023.1.2 → cardio-2025.8.0}/src/cardio/__init__.py +13 -5
  5. cardio-2025.8.0/src/cardio/app.py +63 -0
  6. cardio-2025.8.0/src/cardio/assets/bone.toml +42 -0
  7. cardio-2025.8.0/src/cardio/assets/vascular_closed.toml +78 -0
  8. cardio-2025.8.0/src/cardio/assets/vascular_open.toml +54 -0
  9. cardio-2025.8.0/src/cardio/assets/xray.toml +42 -0
  10. cardio-2025.8.0/src/cardio/logic.py +365 -0
  11. cardio-2025.8.0/src/cardio/mesh.py +259 -0
  12. cardio-2025.8.0/src/cardio/object.py +186 -0
  13. cardio-2025.8.0/src/cardio/property_config.py +56 -0
  14. cardio-2025.8.0/src/cardio/scene.py +228 -0
  15. {cardio-2023.1.2 → cardio-2025.8.0}/src/cardio/screenshot.py +4 -5
  16. cardio-2025.8.0/src/cardio/segmentation.py +178 -0
  17. cardio-2025.8.0/src/cardio/transfer_functions.py +272 -0
  18. cardio-2025.8.0/src/cardio/types.py +18 -0
  19. cardio-2025.8.0/src/cardio/ui.py +477 -0
  20. cardio-2025.8.0/src/cardio/utils.py +101 -0
  21. cardio-2025.8.0/src/cardio/volume.py +61 -0
  22. cardio-2023.1.2/PKG-INFO +0 -57
  23. cardio-2023.1.2/README.md +0 -16
  24. cardio-2023.1.2/setup.cfg +0 -4
  25. cardio-2023.1.2/src/__init__.py +0 -0
  26. cardio-2023.1.2/src/cardio/app.py +0 -32
  27. cardio-2023.1.2/src/cardio/logic.py +0 -102
  28. cardio-2023.1.2/src/cardio/mesh.py +0 -39
  29. cardio-2023.1.2/src/cardio/object.py +0 -13
  30. cardio-2023.1.2/src/cardio/scene.py +0 -89
  31. cardio-2023.1.2/src/cardio/ui.py +0 -198
  32. cardio-2023.1.2/src/cardio/volume.py +0 -116
  33. cardio-2023.1.2/src/cardio.egg-info/PKG-INFO +0 -57
  34. cardio-2023.1.2/src/cardio.egg-info/SOURCES.txt +0 -19
  35. cardio-2023.1.2/src/cardio.egg-info/dependency_links.txt +0 -1
  36. cardio-2023.1.2/src/cardio.egg-info/entry_points.txt +0 -2
  37. cardio-2023.1.2/src/cardio.egg-info/requires.txt +0 -14
  38. cardio-2023.1.2/src/cardio.egg-info/top_level.txt +0 -2
  39. {cardio-2023.1.2 → cardio-2025.8.0}/LICENSE +0 -0
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.3
2
+ Name: cardio
3
+ Version: 2025.8.0
4
+ Summary: A simple web-based viewer for 3D and 4D ('cine') medical imaging data.
5
+ Keywords: Medical,Imaging,3D,4D,Visualization
6
+ Author: Davis Marc Vigneault
7
+ Author-email: Davis Marc Vigneault <davis.vigneault@gmail.com>
8
+ License: Apache Software License 2.0
9
+
10
+ Copyright (c) 2023, Davis Marc Vigneault
11
+
12
+ Licensed under the Apache License, Version 2.0 (the "License");
13
+ you may not use this file except in compliance with the License.
14
+ You may obtain a copy of the License at
15
+
16
+ http://www.apache.org/licenses/LICENSE-2.0
17
+
18
+ Unless required by applicable law or agreed to in writing, software
19
+ distributed under the License is distributed on an "AS IS" BASIS,
20
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ See the License for the specific language governing permissions and
22
+ limitations under the License.
23
+ Classifier: Development Status :: 3 - Alpha
24
+ Classifier: Environment :: Web Environment
25
+ Classifier: Intended Audience :: Healthcare Industry
26
+ Classifier: Intended Audience :: Science/Research
27
+ Classifier: License :: OSI Approved :: Apache Software License
28
+ Classifier: Natural Language :: English
29
+ Classifier: Operating System :: OS Independent
30
+ Classifier: Programming Language :: Python :: 3 :: Only
31
+ Classifier: Programming Language :: JavaScript
32
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
33
+ Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
34
+ Classifier: Topic :: Scientific/Engineering :: Visualization
35
+ Requires-Dist: trame-vuetify>=3.0.2
36
+ Requires-Dist: trame-vtk>=2.9.1
37
+ Requires-Dist: trame>=3.11.0
38
+ Requires-Dist: itk>=5.4.4.post1
39
+ Requires-Dist: vtk>=9.5.0
40
+ Requires-Dist: tomlkit>=0.13.3
41
+ Requires-Dist: numpy>=2.2.6
42
+ Requires-Dist: pydantic>=2.11.7
43
+ Requires-Dist: pydantic-settings>=2.0.0
44
+ Requires-Dist: isort ; extra == 'dev'
45
+ Requires-Dist: pytest ; extra == 'dev'
46
+ Requires-Dist: bumpver ; extra == 'dev'
47
+ Requires-Dist: ruff>=0.12.10 ; extra == 'dev'
48
+ Maintainer: Davis Marc Vigneault
49
+ Maintainer-email: Davis Marc Vigneault <davis.vigneault@gmail.com>
50
+ Requires-Python: >=3.10
51
+ Project-URL: repository, https://github.com/sudomakeinstall/cardio
52
+ Provides-Extra: dev
53
+ Description-Content-Type: text/markdown
54
+
55
+ # cardio
56
+
57
+ `cardio` is a simple web-based viewer for 3D and 4D ('cine') medical imaging data,
58
+ built primarily on [trame](https://github.com/kitware/trame),
59
+ [vtk](https://github.com/kitware/vtk), and
60
+ [itk](https://github.com/insightsoftwareconsortium/itk). `cardio` is able to
61
+ render sequences of mesh files (e.g., `\*.obj` files), segmentation files (e.g.
62
+ `\*nii.gz` files with discrete labels) and volume renderings of grayscale images
63
+ (e.g. \*.nii.gz files with continuous values). `cardio` is launched from the
64
+ commandline and may be configured either directly from the commandline, via a static
65
+ TOML configuration file, or a combination of the two.
66
+
67
+ ## Quickstart
68
+
69
+ ### Installation
70
+
71
+ ```bash
72
+ $ cd /path/to/your/project
73
+ $ uv init
74
+ $ uv add cardio
75
+ $ . ./.venv/bin/activate
76
+ (project) cardio --version
77
+ cardio 2025.8.0
78
+ ```
79
+
80
+ ### Developing
81
+
82
+ Ensuring you have all required dependencies:
83
+
84
+ ```bash
85
+ $ uv sync --all-extras
86
+ ```
87
+
88
+ Pre-commit checklist:
89
+
90
+ ```bash
91
+ $ isort .
92
+ $ ruff format
93
+ $ pytest -v
94
+ ```
@@ -0,0 +1,40 @@
1
+ # cardio
2
+
3
+ `cardio` is a simple web-based viewer for 3D and 4D ('cine') medical imaging data,
4
+ built primarily on [trame](https://github.com/kitware/trame),
5
+ [vtk](https://github.com/kitware/vtk), and
6
+ [itk](https://github.com/insightsoftwareconsortium/itk). `cardio` is able to
7
+ render sequences of mesh files (e.g., `\*.obj` files), segmentation files (e.g.
8
+ `\*nii.gz` files with discrete labels) and volume renderings of grayscale images
9
+ (e.g. \*.nii.gz files with continuous values). `cardio` is launched from the
10
+ commandline and may be configured either directly from the commandline, via a static
11
+ TOML configuration file, or a combination of the two.
12
+
13
+ ## Quickstart
14
+
15
+ ### Installation
16
+
17
+ ```bash
18
+ $ cd /path/to/your/project
19
+ $ uv init
20
+ $ uv add cardio
21
+ $ . ./.venv/bin/activate
22
+ (project) cardio --version
23
+ cardio 2025.8.0
24
+ ```
25
+
26
+ ### Developing
27
+
28
+ Ensuring you have all required dependencies:
29
+
30
+ ```bash
31
+ $ uv sync --all-extras
32
+ ```
33
+
34
+ Pre-commit checklist:
35
+
36
+ ```bash
37
+ $ isort .
38
+ $ ruff format
39
+ $ pytest -v
40
+ ```
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["setuptools>61.0.0"]
3
- build-backend = "setuptools.build_meta"
2
+ requires = ["uv_build>=0.8.13,<0.9.0"]
3
+ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "cardio"
7
- version = "2023.1.2"
7
+ version = "2025.8.0"
8
8
  authors = [
9
9
  {name = "Davis Marc Vigneault", email = "davis.vigneault@gmail.com"}
10
10
  ]
@@ -23,14 +23,18 @@ classifiers = [
23
23
  "Topic :: Scientific/Engineering :: Visualization",
24
24
  ]
25
25
  dependencies = [
26
- "trame",
27
- "vtk",
28
- "itk",
29
- "tomlkit",
30
- "numpy",
26
+ "trame-vuetify>=3.0.2",
27
+ "trame-vtk>=2.9.1",
28
+ "trame>=3.11.0",
29
+ "itk>=5.4.4.post1",
30
+ "vtk>=9.5.0",
31
+ "tomlkit>=0.13.3",
32
+ "numpy>=2.2.6",
33
+ "pydantic>=2.11.7",
34
+ "pydantic-settings>=2.0.0",
31
35
  ]
32
- description = "A simple web-based viewer for 4D ('cine') medical imaging data."
33
- keywords = ["Medical", "Imaging", "4D", "Visualization"]
36
+ description = "A simple web-based viewer for 3D and 4D ('cine') medical imaging data."
37
+ keywords = ["Medical", "Imaging", "3D", "4D", "Visualization"]
34
38
  license = {file = "LICENSE"}
35
39
  maintainers = [
36
40
  {name = "Davis Marc Vigneault", email = "davis.vigneault@gmail.com"}
@@ -39,19 +43,24 @@ readme = "README.md"
39
43
  requires-python = ">=3.10"
40
44
 
41
45
  [project.optional-dependencies]
42
- dev = ["black", "isort", "pip-tools", "pytest", "bumpver", "build", "twine"]
46
+ dev = [
47
+ "isort",
48
+ "pytest",
49
+ "bumpver",
50
+ "ruff>=0.12.10",
51
+ ]
43
52
 
44
53
  [project.gui-scripts]
45
54
  cardio = "cardio.app:main"
46
55
 
47
56
  [project.urls]
48
- repository = "https://github.com/dvigneault/cardio"
57
+ repository = "https://github.com/sudomakeinstall/cardio"
49
58
 
50
59
  [tool.isort]
51
60
  profile = "black"
52
61
 
53
62
  [tool.bumpver]
54
- current_version = "2023.1.2"
63
+ current_version = "2025.8.0"
55
64
  version_pattern = "YYYY.MM.INC0"
56
65
  commit_message = "ENH: Bump version from {old_version} => {new_version}"
57
66
  commit = true
@@ -66,3 +75,6 @@ push = false
66
75
  "src/cardio/__init__.py" = [
67
76
  '__version__ = "{version}"',
68
77
  ]
78
+ "README.md" = [
79
+ 'cardio {version}',
80
+ ]
@@ -1,19 +1,27 @@
1
- from .object import Object
1
+ from .logic import Logic
2
2
  from .mesh import Mesh
3
- from .volume import Volume
3
+ from .object import Object
4
4
  from .scene import Scene
5
- from .logic import Logic
6
- from .ui import UI
7
5
  from .screenshot import Screenshot
6
+ from .segmentation import Segmentation
7
+ from .transfer_functions import (
8
+ list_available_presets,
9
+ load_preset,
10
+ )
11
+ from .ui import UI
12
+ from .volume import Volume
8
13
 
9
14
  __all__ = [
10
15
  "Object",
11
16
  "Mesh",
12
17
  "Volume",
18
+ "Segmentation",
13
19
  "Scene",
14
20
  "Screenshot",
15
21
  "UI",
16
22
  "Logic",
23
+ "load_preset",
24
+ "list_available_presets",
17
25
  ]
18
26
 
19
- __version__ = "2023.1.2"
27
+ __version__ = "2025.8.0"
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env python
2
+
3
+ # Third Party
4
+ import pydantic_settings as ps
5
+ import tomlkit as tk
6
+ import trame as tm
7
+
8
+ from . import __version__
9
+ from .logic import Logic
10
+
11
+ # Internal
12
+ from .scene import Scene
13
+ from .ui import UI
14
+
15
+
16
+ class CardioApp(tm.app.TrameApp):
17
+ def __init__(self, name=None):
18
+ super().__init__(server=name, client_type="vue2")
19
+
20
+ # Add config file argument to Trame's parser
21
+ self.server.cli.add_argument(
22
+ "--config", help="TOML configuration file.", dest="cfg_file", required=False
23
+ )
24
+
25
+ # Add version argument
26
+ self.server.cli.add_argument(
27
+ "--version", action="version", version=f"cardio {__version__}"
28
+ )
29
+
30
+ # Create CLI settings source with Trame's parser - enable argument parsing
31
+ cli_settings = ps.CliSettingsSource(
32
+ Scene, root_parser=self.server.cli, cli_parse_args=True
33
+ )
34
+
35
+ # Parse arguments to get config file path (use parse_known_args to avoid conflicts)
36
+ args, unknown = self.server.cli.parse_known_args()
37
+ config_file = getattr(args, "cfg_file", None)
38
+
39
+ # Set the CLI source and config file on the Scene class temporarily
40
+ Scene._cli_source = cli_settings
41
+ Scene._config_file = config_file
42
+
43
+ try:
44
+ # Create Scene with CLI and config file support
45
+ scene = Scene()
46
+ finally:
47
+ # Clean up class attributes
48
+ if hasattr(Scene, "_cli_source"):
49
+ delattr(Scene, "_cli_source")
50
+ if hasattr(Scene, "_config_file"):
51
+ delattr(Scene, "_config_file")
52
+
53
+ Logic(self.server, scene)
54
+ UI(self.server, scene)
55
+
56
+
57
+ def main():
58
+ app = CardioApp()
59
+ app.server.start(open_browser=False)
60
+
61
+
62
+ if __name__ == "__main__":
63
+ main()
@@ -0,0 +1,42 @@
1
+ name = "Bone"
2
+ description = "Bone"
3
+
4
+ ambient = 1.0
5
+ diffuse = 1.0
6
+ specular = 0.0
7
+
8
+ [[transfer_functions]]
9
+
10
+ [transfer_functions.opacity]
11
+ [[transfer_functions.opacity.points]]
12
+ x = -1024.0
13
+ y = 0.0
14
+
15
+ [[transfer_functions.opacity.points]]
16
+ x = 54.0
17
+ y = 0.0
18
+
19
+ [[transfer_functions.opacity.points]]
20
+ x = 536.0
21
+ y = 0.1
22
+
23
+ [[transfer_functions.opacity.points]]
24
+ x = 3071.0
25
+ y = 0.1
26
+
27
+ [transfer_functions.color]
28
+ [[transfer_functions.color.points]]
29
+ x = -1024.0
30
+ color = [0.0, 0.0, 0.0]
31
+
32
+ [[transfer_functions.color.points]]
33
+ x = 54.0
34
+ color = [0.0, 0.0, 0.0]
35
+
36
+ [[transfer_functions.color.points]]
37
+ x = 536.0
38
+ color = [1.0, 1.0, 1.0]
39
+
40
+ [[transfer_functions.color.points]]
41
+ x = 3071.0
42
+ color = [1.0, 1.0, 1.0]
@@ -0,0 +1,78 @@
1
+ name = "Vascular_Closed"
2
+ description = "Vascular (Closed)"
3
+
4
+ ambient = 0.7
5
+ diffuse = 0.4
6
+ specular = 1.0
7
+
8
+ [[transfer_functions]]
9
+
10
+ [transfer_functions.opacity]
11
+ [[transfer_functions.opacity.points]]
12
+ x = 150
13
+ y = 0.0
14
+
15
+ [[transfer_functions.opacity.points]]
16
+ x = 650
17
+ y = 1.0
18
+
19
+ [[transfer_functions.opacity.points]]
20
+ x = 3071
21
+ y = 1.0
22
+
23
+ [transfer_functions.color]
24
+ [[transfer_functions.color.points]]
25
+ x = 150
26
+ color = [1.0, 1.0, 1.0]
27
+
28
+ [[transfer_functions.color.points]]
29
+ x = 3071
30
+ color = [1.0, 1.0, 1.0]
31
+
32
+ [[transfer_functions]]
33
+
34
+ [transfer_functions.opacity]
35
+ [[transfer_functions.opacity.points]]
36
+ x = -96.5
37
+ y = 0.0
38
+
39
+ [[transfer_functions.opacity.points]]
40
+ x = 269.0
41
+ y = 0.05
42
+
43
+ [[transfer_functions.opacity.points]]
44
+ x = 474.5
45
+ y = 0.0
46
+
47
+ [transfer_functions.color]
48
+ [[transfer_functions.color.points]]
49
+ x = -96.5
50
+ color = [1.0, 1.0, 1.0]
51
+
52
+ [[transfer_functions.color.points]]
53
+ x = 474.5
54
+ color = [1.0, 1.0, 1.0]
55
+
56
+ [[transfer_functions]]
57
+
58
+ [transfer_functions.opacity]
59
+ [[transfer_functions.opacity.points]]
60
+ x = 120
61
+ y = 0.0
62
+
63
+ [[transfer_functions.opacity.points]]
64
+ x = 258.0
65
+ y = 0.8
66
+
67
+ [[transfer_functions.opacity.points]]
68
+ x = 320
69
+ y = 0.0
70
+
71
+ [transfer_functions.color]
72
+ [[transfer_functions.color.points]]
73
+ x = 120
74
+ color = [1.0, 0.0, 0.0]
75
+
76
+ [[transfer_functions.color.points]]
77
+ x = 320
78
+ color = [1.0, 1.0, 0.0]
@@ -0,0 +1,54 @@
1
+ name = "Vascular_Open"
2
+ description = "Vascular (Open)"
3
+
4
+ ambient = 0.7
5
+ diffuse = 0.4
6
+ specular = 1.0
7
+
8
+ [[transfer_functions]]
9
+
10
+ [transfer_functions.opacity]
11
+ [[transfer_functions.opacity.points]]
12
+ x = -96.5
13
+ y = 0.0
14
+
15
+ [[transfer_functions.opacity.points]]
16
+ x = 269.0
17
+ y = 0.05
18
+
19
+ [[transfer_functions.opacity.points]]
20
+ x = 474.5
21
+ y = 0.0
22
+
23
+ [transfer_functions.color]
24
+ [[transfer_functions.color.points]]
25
+ x = -96.5
26
+ color = [1.0, 1.0, 1.0]
27
+
28
+ [[transfer_functions.color.points]]
29
+ x = 474.5
30
+ color = [1.0, 1.0, 1.0]
31
+
32
+ [[transfer_functions]]
33
+
34
+ [transfer_functions.opacity]
35
+ [[transfer_functions.opacity.points]]
36
+ x = 117
37
+ y = 0.0
38
+
39
+ [[transfer_functions.opacity.points]]
40
+ x = 246.0
41
+ y = 0.87
42
+
43
+ [[transfer_functions.opacity.points]]
44
+ x = 319
45
+ y = 0.0
46
+
47
+ [transfer_functions.color]
48
+ [[transfer_functions.color.points]]
49
+ x = 117
50
+ color = [1.0, 0.0, 0.0]
51
+
52
+ [[transfer_functions.color.points]]
53
+ x = 319
54
+ color = [1.0, 1.0, 0.0]
@@ -0,0 +1,42 @@
1
+ name = "Radiograph"
2
+ description = "Radiograph"
3
+
4
+ ambient = 1.0
5
+ diffuse = 1.0
6
+ specular = 0.0
7
+
8
+ [[transfer_functions]]
9
+
10
+ [transfer_functions.opacity]
11
+ [[transfer_functions.opacity.points]]
12
+ x = -1024.0
13
+ y = 0.0
14
+
15
+ [[transfer_functions.opacity.points]]
16
+ x = -200.0
17
+ y = 0.0
18
+
19
+ [[transfer_functions.opacity.points]]
20
+ x = 300.0
21
+ y = 0.01
22
+
23
+ [[transfer_functions.opacity.points]]
24
+ x = 3071.0
25
+ y = 0.01
26
+
27
+ [transfer_functions.color]
28
+ [[transfer_functions.color.points]]
29
+ x = -1024.0
30
+ color = [0.0, 0.0, 0.0]
31
+
32
+ [[transfer_functions.color.points]]
33
+ x = -200.0
34
+ color = [0.0, 0.0, 0.0]
35
+
36
+ [[transfer_functions.color.points]]
37
+ x = 300.0
38
+ color = [1.0, 1.0, 1.0]
39
+
40
+ [[transfer_functions.color.points]]
41
+ x = 3071.0
42
+ color = [1.0, 1.0, 1.0]