cellier 0.0.2__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 (147) hide show
  1. cellier-0.0.2/.copier-answers.yml +17 -0
  2. cellier-0.0.2/.github/ISSUE_TEMPLATE.md +15 -0
  3. cellier-0.0.2/.github/TEST_FAIL_TEMPLATE.md +12 -0
  4. cellier-0.0.2/.github/dependabot.yml +10 -0
  5. cellier-0.0.2/.github/workflows/ci.yml +93 -0
  6. cellier-0.0.2/.gitignore +111 -0
  7. cellier-0.0.2/.pre-commit-config.yaml +26 -0
  8. cellier-0.0.2/LICENSE +28 -0
  9. cellier-0.0.2/PKG-INFO +46 -0
  10. cellier-0.0.2/README.md +9 -0
  11. cellier-0.0.2/docs/events.md +12 -0
  12. cellier-0.0.2/docs/making_new_visual.md +9 -0
  13. cellier-0.0.2/examples/make_points_example_config.py +95 -0
  14. cellier-0.0.2/examples/make_single_canvas_config.py +62 -0
  15. cellier-0.0.2/examples/oblique_slicing.py +305 -0
  16. cellier-0.0.2/examples/points_example_config.json +3288 -0
  17. cellier-0.0.2/examples/points_slicing_example.py +61 -0
  18. cellier-0.0.2/examples/qt_example.py +41 -0
  19. cellier-0.0.2/examples/single_canvas_config.json +104 -0
  20. cellier-0.0.2/examples/tiled_rendering/make_zarr_sample.py +32 -0
  21. cellier-0.0.2/examples/tiled_rendering/octree_pyfx.py +279 -0
  22. cellier-0.0.2/examples/tiled_rendering/tiled_render_zarr.py +463 -0
  23. cellier-0.0.2/examples/tiled_rendering/zarr_example_viewer.py +136 -0
  24. cellier-0.0.2/examples/volume/latent_volume_example_config.json +3820 -0
  25. cellier-0.0.2/examples/volume/make_latent_volume_config.py +67 -0
  26. cellier-0.0.2/examples/volume/make_simple_volume_config.py +67 -0
  27. cellier-0.0.2/examples/volume/simple_async_volume.py +64 -0
  28. cellier-0.0.2/examples/volume/simple_volume.py +61 -0
  29. cellier-0.0.2/examples/volume/simple_volume_example_config.json +3819 -0
  30. cellier-0.0.2/pyproject.toml +143 -0
  31. cellier-0.0.2/src/cellier/__init__.py +10 -0
  32. cellier-0.0.2/src/cellier/convenience/__init__.py +4 -0
  33. cellier-0.0.2/src/cellier/convenience/qt/__init__.py +1 -0
  34. cellier-0.0.2/src/cellier/convenience/qt/qt_viewer.py +43 -0
  35. cellier-0.0.2/src/cellier/events/__init__.py +5 -0
  36. cellier-0.0.2/src/cellier/events/_event_bus.py +25 -0
  37. cellier-0.0.2/src/cellier/events/_visual.py +175 -0
  38. cellier-0.0.2/src/cellier/gui/__init__.py +1 -0
  39. cellier-0.0.2/src/cellier/gui/constants.py +9 -0
  40. cellier-0.0.2/src/cellier/gui/qt/__init__.py +1 -0
  41. cellier-0.0.2/src/cellier/gui/qt/utils.py +36 -0
  42. cellier-0.0.2/src/cellier/models/__init__.py +1 -0
  43. cellier-0.0.2/src/cellier/models/data_manager.py +45 -0
  44. cellier-0.0.2/src/cellier/models/data_stores/__init__.py +6 -0
  45. cellier-0.0.2/src/cellier/models/data_stores/base_data_store.py +36 -0
  46. cellier-0.0.2/src/cellier/models/data_stores/lines.py +84 -0
  47. cellier-0.0.2/src/cellier/models/data_stores/points.py +84 -0
  48. cellier-0.0.2/src/cellier/models/scene/__init__.py +15 -0
  49. cellier-0.0.2/src/cellier/models/scene/cameras.py +106 -0
  50. cellier-0.0.2/src/cellier/models/scene/canvas.py +22 -0
  51. cellier-0.0.2/src/cellier/models/scene/dims_manager.py +106 -0
  52. cellier-0.0.2/src/cellier/models/scene/scene.py +49 -0
  53. cellier-0.0.2/src/cellier/models/viewer.py +43 -0
  54. cellier-0.0.2/src/cellier/models/visuals/__init__.py +11 -0
  55. cellier-0.0.2/src/cellier/models/visuals/base.py +43 -0
  56. cellier-0.0.2/src/cellier/models/visuals/lines.py +63 -0
  57. cellier-0.0.2/src/cellier/models/visuals/points.py +57 -0
  58. cellier-0.0.2/src/cellier/py.typed +5 -0
  59. cellier-0.0.2/src/cellier/qt_canvas.py +14 -0
  60. cellier-0.0.2/src/cellier/render/__init__.py +5 -0
  61. cellier-0.0.2/src/cellier/render/_render_manager.py +284 -0
  62. cellier-0.0.2/src/cellier/render/cameras.py +26 -0
  63. cellier-0.0.2/src/cellier/render/constants.py +8 -0
  64. cellier-0.0.2/src/cellier/render/lines.py +101 -0
  65. cellier-0.0.2/src/cellier/render/points.py +110 -0
  66. cellier-0.0.2/src/cellier/render/utils.py +20 -0
  67. cellier-0.0.2/src/cellier/slicer/__init__.py +12 -0
  68. cellier-0.0.2/src/cellier/slicer/data_slice.py +170 -0
  69. cellier-0.0.2/src/cellier/slicer/slicer.py +104 -0
  70. cellier-0.0.2/src/cellier/slicer/transforms.py +169 -0
  71. cellier-0.0.2/src/cellier/slicer/utils.py +33 -0
  72. cellier-0.0.2/src/cellier/slicer/world_slice.py +203 -0
  73. cellier-0.0.2/src/cellier/types.py +14 -0
  74. cellier-0.0.2/src/cellier/util/__init__.py +1 -0
  75. cellier-0.0.2/src/cellier/util/chunk.py +407 -0
  76. cellier-0.0.2/src/cellier/util/geometry.py +202 -0
  77. cellier-0.0.2/src/cellier/v1/__init__.py +10 -0
  78. cellier-0.0.2/src/cellier/v1/convenience/__init__.py +4 -0
  79. cellier-0.0.2/src/cellier/v1/convenience/qt/__init__.py +1 -0
  80. cellier-0.0.2/src/cellier/v1/convenience/qt/qt_viewer.py +43 -0
  81. cellier-0.0.2/src/cellier/v1/gui/__init__.py +1 -0
  82. cellier-0.0.2/src/cellier/v1/gui/constants.py +9 -0
  83. cellier-0.0.2/src/cellier/v1/gui/qt/__init__.py +1 -0
  84. cellier-0.0.2/src/cellier/v1/gui/qt/utils.py +36 -0
  85. cellier-0.0.2/src/cellier/v1/models/__init__.py +1 -0
  86. cellier-0.0.2/src/cellier/v1/models/data_manager.py +73 -0
  87. cellier-0.0.2/src/cellier/v1/models/data_stores/__init__.py +1 -0
  88. cellier-0.0.2/src/cellier/v1/models/data_stores/base_data_store.py +36 -0
  89. cellier-0.0.2/src/cellier/v1/models/data_stores/image.py +298 -0
  90. cellier-0.0.2/src/cellier/v1/models/data_stores/mesh.py +81 -0
  91. cellier-0.0.2/src/cellier/v1/models/data_stores/points.py +119 -0
  92. cellier-0.0.2/src/cellier/v1/models/data_streams/__init__.py +1 -0
  93. cellier-0.0.2/src/cellier/v1/models/data_streams/base_data_stream.py +39 -0
  94. cellier-0.0.2/src/cellier/v1/models/data_streams/image.py +80 -0
  95. cellier-0.0.2/src/cellier/v1/models/data_streams/mesh.py +43 -0
  96. cellier-0.0.2/src/cellier/v1/models/data_streams/points.py +46 -0
  97. cellier-0.0.2/src/cellier/v1/models/nodes/__init__.py +1 -0
  98. cellier-0.0.2/src/cellier/v1/models/nodes/base_node.py +21 -0
  99. cellier-0.0.2/src/cellier/v1/models/nodes/image_node.py +89 -0
  100. cellier-0.0.2/src/cellier/v1/models/nodes/mesh_node.py +96 -0
  101. cellier-0.0.2/src/cellier/v1/models/nodes/points_node.py +54 -0
  102. cellier-0.0.2/src/cellier/v1/models/scene/__init__.py +15 -0
  103. cellier-0.0.2/src/cellier/v1/models/scene/cameras.py +106 -0
  104. cellier-0.0.2/src/cellier/v1/models/scene/canvas.py +22 -0
  105. cellier-0.0.2/src/cellier/v1/models/scene/dims_manager.py +106 -0
  106. cellier-0.0.2/src/cellier/v1/models/scene/scene.py +57 -0
  107. cellier-0.0.2/src/cellier/v1/models/viewer.py +42 -0
  108. cellier-0.0.2/src/cellier/v1/py.typed +5 -0
  109. cellier-0.0.2/src/cellier/v1/qt_canvas.py +14 -0
  110. cellier-0.0.2/src/cellier/v1/render/__init__.py +1 -0
  111. cellier-0.0.2/src/cellier/v1/render/cameras.py +26 -0
  112. cellier-0.0.2/src/cellier/v1/render/image.py +279 -0
  113. cellier-0.0.2/src/cellier/v1/render/mesh.py +107 -0
  114. cellier-0.0.2/src/cellier/v1/render/points.py +115 -0
  115. cellier-0.0.2/src/cellier/v1/render/render_manager.py +237 -0
  116. cellier-0.0.2/src/cellier/v1/render/utils.py +27 -0
  117. cellier-0.0.2/src/cellier/v1/slicer/__init__.py +6 -0
  118. cellier-0.0.2/src/cellier/v1/slicer/data_slice.py +150 -0
  119. cellier-0.0.2/src/cellier/v1/slicer/slicer.py +182 -0
  120. cellier-0.0.2/src/cellier/v1/slicer/transforms.py +169 -0
  121. cellier-0.0.2/src/cellier/v1/slicer/utils.py +33 -0
  122. cellier-0.0.2/src/cellier/v1/slicer/world_slice.py +203 -0
  123. cellier-0.0.2/src/cellier/v1/util/__init__.py +1 -0
  124. cellier-0.0.2/src/cellier/v1/util/chunk.py +407 -0
  125. cellier-0.0.2/src/cellier/v1/util/geometry.py +202 -0
  126. cellier-0.0.2/src/cellier/v1/viewer_controller.py +266 -0
  127. cellier-0.0.2/src/cellier/viewer_controller.py +348 -0
  128. cellier-0.0.2/tests/events/__init__.py +0 -0
  129. cellier-0.0.2/tests/events/test_event_bus.py +148 -0
  130. cellier-0.0.2/tests/models/__init__.py +0 -0
  131. cellier-0.0.2/tests/models/data_stores/__init__.py +0 -0
  132. cellier-0.0.2/tests/models/data_stores/test_mesh.py +47 -0
  133. cellier-0.0.2/tests/models/data_stores/test_points.py +76 -0
  134. cellier-0.0.2/tests/models/scene/__init__.py +0 -0
  135. cellier-0.0.2/tests/models/scene/test_camera.py +25 -0
  136. cellier-0.0.2/tests/models/scene/test_canvas.py +29 -0
  137. cellier-0.0.2/tests/models/scene/test_dims_manager.py +28 -0
  138. cellier-0.0.2/tests/models/scene/test_scene.py +58 -0
  139. cellier-0.0.2/tests/models/test_viewer.py +56 -0
  140. cellier-0.0.2/tests/models/visuals/__init__.py +0 -0
  141. cellier-0.0.2/tests/models/visuals/test_mesh_visual.py +43 -0
  142. cellier-0.0.2/tests/slicer/__init__.py +0 -0
  143. cellier-0.0.2/tests/slicer/test_world_slice.py +2 -0
  144. cellier-0.0.2/tests/test_cellier.py +2 -0
  145. cellier-0.0.2/tests/util/__init__.py +0 -0
  146. cellier-0.0.2/tests/util/test_chunk.py +35 -0
  147. cellier-0.0.2/tests/util/test_geometry.py +93 -0
@@ -0,0 +1,17 @@
1
+ # Do not edit - changes here will be overwritten by Copier
2
+ _commit: v1
3
+ _src_path: gh:pydev-guide/pyrepo-copier
4
+ author_email: kevin.yamauchi@gmail.com
5
+ author_name: Kevin Yamauchi
6
+ git_versioning: true
7
+ github_username: kevinyamauchi
8
+ mode: customize
9
+ module_name: cellier
10
+ project_license: BSD-3-Clause
11
+ project_name: cellier
12
+ project_short_description: A workshop for rendering cellular models.
13
+ test_pre_release: false
14
+ use_mypy: false
15
+ use_pre_commit: true
16
+ use_ruff: true
17
+
@@ -0,0 +1,15 @@
1
+ * cellier version:
2
+ * Python version:
3
+ * Operating System:
4
+
5
+ ### Description
6
+
7
+ Describe what you were trying to get done.
8
+ Tell us what happened, what went wrong, and what you expected to happen.
9
+
10
+ ### What I Did
11
+
12
+ ```
13
+ Paste the command(s) you ran and the output.
14
+ If there was a crash, please include the traceback here.
15
+ ```
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: "{{ env.TITLE }}"
3
+ labels: [bug]
4
+ ---
5
+ The {{ workflow }} workflow failed on {{ date | date("YYYY-MM-DD HH:mm") }} UTC
6
+
7
+ The most recent failing test was on {{ env.PLATFORM }} py{{ env.PYTHON }}
8
+ with commit: {{ sha }}
9
+
10
+ Full run: https://github.com/{{ repo }}/actions/runs/{{ env.RUN_ID }}
11
+
12
+ (This post will be updated if another test fails, as long as this issue remains open.)
@@ -0,0 +1,10 @@
1
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2
+
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "github-actions"
6
+ directory: "/"
7
+ schedule:
8
+ interval: "weekly"
9
+ commit-message:
10
+ prefix: "ci(dependabot):"
@@ -0,0 +1,93 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - "v*"
9
+ pull_request:
10
+ workflow_dispatch:
11
+
12
+
13
+ # cancel in-progress runs that use the same workflow and branch
14
+ concurrency:
15
+ group: ${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ check-manifest:
20
+ # check-manifest is a tool that checks that all files in version control are
21
+ # included in the sdist (unless explicitly excluded)
22
+ runs-on: ubuntu-latest
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ - run: pipx run check-manifest
26
+
27
+ test:
28
+ name: ${{ matrix.platform }} (${{ matrix.python-version }})
29
+ runs-on: ${{ matrix.platform }}
30
+ strategy:
31
+ fail-fast: false
32
+ matrix:
33
+ python-version: ["3.10", "3.11", "3.12"]
34
+ platform: [ubuntu-latest, macos-latest, windows-latest]
35
+
36
+ steps:
37
+ - uses: actions/checkout@v4
38
+
39
+ - name: 🐍 Set up Python ${{ matrix.python-version }}
40
+ uses: actions/setup-python@v5
41
+ with:
42
+ python-version: ${{ matrix.python-version }}
43
+ cache-dependency-path: "pyproject.toml"
44
+ cache: "pip"
45
+
46
+ - name: Install Dependencies
47
+ run: |
48
+ python -m pip install -U pip
49
+ python -m pip install .[test]
50
+
51
+ - name: 🧪 Run Tests
52
+ run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing
53
+
54
+ - name: Coverage
55
+ uses: codecov/codecov-action@v5
56
+
57
+ deploy:
58
+ name: Deploy
59
+ needs: test
60
+ if: success() && startsWith(github.ref, 'refs/tags/')
61
+ runs-on: ubuntu-latest
62
+
63
+ permissions:
64
+ # IMPORTANT: this permission is mandatory for trusted publishing on PyPi
65
+ # see https://docs.pypi.org/trusted-publishers/
66
+ id-token: write
67
+ # This permission allows writing releases
68
+ contents: write
69
+
70
+ steps:
71
+ - uses: actions/checkout@v4
72
+ with:
73
+ fetch-depth: 0
74
+
75
+ - name: 🐍 Set up Python
76
+ uses: actions/setup-python@v5
77
+ with:
78
+ python-version: "3.x"
79
+
80
+ - name: 👷 Build
81
+ run: |
82
+ python -m pip install build
83
+ python -m build
84
+
85
+ - name: 🚢 Publish to PyPI
86
+ uses: pypa/gh-action-pypi-publish@release/v1
87
+ with:
88
+ password: ${{ secrets.PYPI_API_TOKEN }}
89
+
90
+ - uses: softprops/action-gh-release@v2
91
+ with:
92
+ generate_release_notes: true
93
+ files: './dist/*'
@@ -0,0 +1,111 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ env/
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ .DS_Store
29
+
30
+ # PyInstaller
31
+ # Usually these files are written by a python script from a template
32
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
33
+ *.manifest
34
+ *.spec
35
+
36
+ # Installer logs
37
+ pip-log.txt
38
+ pip-delete-this-directory.txt
39
+
40
+ # Unit test / coverage reports
41
+ htmlcov/
42
+ .tox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ .hypothesis/
50
+ .pytest_cache/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+
60
+ # Flask stuff:
61
+ instance/
62
+ .webassets-cache
63
+
64
+ # Scrapy stuff:
65
+ .scrapy
66
+
67
+ # Sphinx documentation
68
+ docs/_build/
69
+
70
+ # PyBuilder
71
+ target/
72
+
73
+ # Jupyter Notebook
74
+ .ipynb_checkpoints
75
+
76
+ # pyenv
77
+ .python-version
78
+
79
+ # celery beat schedule file
80
+ celerybeat-schedule
81
+
82
+ # SageMath parsed files
83
+ *.sage.py
84
+
85
+ # dotenv
86
+ .env
87
+
88
+ # virtualenv
89
+ .venv
90
+ venv/
91
+ ENV/
92
+
93
+ # Spyder project settings
94
+ .spyderproject
95
+ .spyproject
96
+
97
+ # Rope project settings
98
+ .ropeproject
99
+
100
+ # mkdocs documentation
101
+ /site
102
+
103
+ # mypy
104
+ .mypy_cache/
105
+
106
+ # ruff
107
+ .ruff_cache/
108
+
109
+ # IDE settings
110
+ .vscode/
111
+ .idea/
@@ -0,0 +1,26 @@
1
+ # enable pre-commit.ci at https://pre-commit.ci/
2
+ # it adds:
3
+ # 1. auto fixing pull requests
4
+ # 2. auto updating the pre-commit configuration
5
+ ci:
6
+ autoupdate_schedule: monthly
7
+ autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]"
8
+ autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"
9
+
10
+ repos:
11
+ - repo: https://github.com/abravalheri/validate-pyproject
12
+ rev: v0.16
13
+ hooks:
14
+ - id: validate-pyproject
15
+
16
+ - repo: https://github.com/crate-ci/typos
17
+ rev: v1.19.0
18
+ hooks:
19
+ - id: typos
20
+
21
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
22
+ rev: v0.3.0
23
+ hooks:
24
+ - id: ruff
25
+ args: [--fix] # may also add '--unsafe-fixes'
26
+ - id: ruff-format
cellier-0.0.2/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, Kevin Yamauchi
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cellier-0.0.2/PKG-INFO ADDED
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: cellier
3
+ Version: 0.0.2
4
+ Summary: A workshop for rendering cellular models.
5
+ Project-URL: homepage, https://github.com/kevinyamauchi/cellier
6
+ Project-URL: repository, https://github.com/kevinyamauchi/cellier
7
+ Author-email: Kevin Yamauchi <kevin.yamauchi@gmail.com>
8
+ License: BSD-3-Clause
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: License :: OSI Approved :: BSD License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Typing :: Typed
17
+ Requires-Python: >=3.10
18
+ Requires-Dist: numpy
19
+ Requires-Dist: psygnal
20
+ Requires-Dist: pydantic
21
+ Requires-Dist: pygfx
22
+ Requires-Dist: qtpy
23
+ Requires-Dist: superqt
24
+ Requires-Dist: zarr
25
+ Provides-Extra: dev
26
+ Requires-Dist: ipython; extra == 'dev'
27
+ Requires-Dist: pdbpp; extra == 'dev'
28
+ Requires-Dist: pre-commit; extra == 'dev'
29
+ Requires-Dist: rich; extra == 'dev'
30
+ Requires-Dist: ruff; extra == 'dev'
31
+ Provides-Extra: pyside
32
+ Requires-Dist: pyside6; extra == 'pyside'
33
+ Provides-Extra: test
34
+ Requires-Dist: pytest; extra == 'test'
35
+ Requires-Dist: pytest-cov; extra == 'test'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # cellier
39
+
40
+ [![License](https://img.shields.io/pypi/l/cellier.svg?color=green)](https://github.com/kevinyamauchi/cellier/raw/main/LICENSE)
41
+ [![PyPI](https://img.shields.io/pypi/v/cellier.svg?color=green)](https://pypi.org/project/cellier)
42
+ [![Python Version](https://img.shields.io/pypi/pyversions/cellier.svg?color=green)](https://python.org)
43
+ [![CI](https://github.com/kevinyamauchi/cellier/actions/workflows/ci.yml/badge.svg)](https://github.com/kevinyamauchi/cellier/actions/workflows/ci.yml)
44
+ [![codecov](https://codecov.io/gh/kevinyamauchi/cellier/branch/main/graph/badge.svg)](https://codecov.io/gh/kevinyamauchi/cellier)
45
+
46
+ A workshop for rendering cellular models.
@@ -0,0 +1,9 @@
1
+ # cellier
2
+
3
+ [![License](https://img.shields.io/pypi/l/cellier.svg?color=green)](https://github.com/kevinyamauchi/cellier/raw/main/LICENSE)
4
+ [![PyPI](https://img.shields.io/pypi/v/cellier.svg?color=green)](https://pypi.org/project/cellier)
5
+ [![Python Version](https://img.shields.io/pypi/pyversions/cellier.svg?color=green)](https://python.org)
6
+ [![CI](https://github.com/kevinyamauchi/cellier/actions/workflows/ci.yml/badge.svg)](https://github.com/kevinyamauchi/cellier/actions/workflows/ci.yml)
7
+ [![codecov](https://codecov.io/gh/kevinyamauchi/cellier/branch/main/graph/badge.svg)](https://codecov.io/gh/kevinyamauchi/cellier)
8
+
9
+ A workshop for rendering cellular models.
@@ -0,0 +1,12 @@
1
+ # Events in cellier
2
+
3
+ ## Overview
4
+ Cellier uses events to make sure that the model and view are kept in sync. Cellier has two main types of views. The controls, which are the GUI elements used to modify the state of the viewer model (e.g., selecting a colormap, or the dims sliders) and the renderer, which is a view of the data specified by the viewer model. All events are routed through the `EventBus` class.
5
+
6
+ ## EventBus
7
+
8
+ The event bus serves as the interface between the model and the views. The models and the views connect their events to the `EventBus`. There are no direct connections between the models and the views. This allows for a clean separation of concerns and makes it easy to add new views or models without modifying existing code.
9
+
10
+ ## Types of events
11
+ - visual model updates: these are emitted by the visual model when its state changes.
12
+ - visual control updates: these are emitted by GUI elements that modify the state of the visual model.
@@ -0,0 +1,9 @@
1
+ # Making a new visual
2
+
3
+ This page describes the steps for creating a new visual type.
4
+
5
+ 1. Make a new DataStore type. This must be a subclass of the `BaseDataStore` class and implement the `get_slice()` method.
6
+ 2. Make a new DataStream type. This must be a subclass of the `BaseDataStream` class and implement the `get_data_store_slice()` class.
7
+ 3. Make a new visual model (`cellier/models/visuals`)
8
+ 4. Make a new constructor function that creates the pygfx WorldObject instance from the visual model. These go in `cellier/render`. See `cellier/render/mesh.py` for an example.
9
+ 5. Add the constructor function to the `construct_pygfx_object()` function in `cellier/render/utils.py`. This function takes the visual model and dispatches the correct constructor function.
@@ -0,0 +1,95 @@
1
+ """Script to to create a points viewer configuration."""
2
+
3
+ import numpy as np
4
+
5
+ from cellier.models.data_manager import DataManager
6
+ from cellier.models.data_stores.points import PointsMemoryStore
7
+ from cellier.models.data_streams.points import PointsSynchronousDataStream
8
+ from cellier.models.nodes.points_node import PointsNode, PointsUniformMaterial
9
+ from cellier.models.scene.cameras import PerspectiveCamera
10
+ from cellier.models.scene.canvas import Canvas
11
+ from cellier.models.scene.dims_manager import CoordinateSystem, DimsManager
12
+ from cellier.models.scene.scene import Scene
13
+ from cellier.models.viewer import SceneManager, ViewerModel
14
+
15
+ # make a 4D point cloud
16
+ n_points = 500
17
+ rng = np.random.default_rng(0)
18
+ spatial_coordinates = 50 * rng.uniform(0, 1, (n_points, 3))
19
+ temporal_coordinates = rng.choice(np.arange(10), (n_points, 1))
20
+ coordinates = np.column_stack((temporal_coordinates, spatial_coordinates))
21
+ print(coordinates.shape)
22
+
23
+
24
+ # make the points store
25
+ points_store = PointsMemoryStore(coordinates=coordinates)
26
+
27
+ # make the points stream
28
+ points_stream = PointsSynchronousDataStream(data_store_id=points_store.id, selectors=[])
29
+
30
+ # make the data_stores manager
31
+ data = DataManager(
32
+ stores={points_store.id: points_store}, streams={points_stream.id: points_stream}
33
+ )
34
+
35
+ # make the scene coordinate system
36
+ coordinate_system_3d = CoordinateSystem(
37
+ name="scene_3d", axis_labels=["t", "z", "y", "x"]
38
+ )
39
+ dims_3d = DimsManager(
40
+ point=(0, 0, 0, 0),
41
+ margin_negative=(0, 0, 0, 0),
42
+ margin_positive=(0, 0, 0, 0),
43
+ coordinate_system=coordinate_system_3d,
44
+ displayed_dimensions=(1, 2, 3),
45
+ )
46
+
47
+ coordinate_system_2d = CoordinateSystem(
48
+ name="scene_2d", axis_labels=["t", "z", "y", "x"]
49
+ )
50
+ dims_2d = DimsManager(
51
+ point=(0, 0, 0, 0),
52
+ margin_negative=(0, 0.5, 0, 0),
53
+ margin_positive=(0, 0.5, 0, 0),
54
+ coordinate_system=coordinate_system_2d,
55
+ displayed_dimensions=(2, 3),
56
+ )
57
+
58
+ # make the points visual
59
+ points_material_3d = PointsUniformMaterial(
60
+ size=1, color=(1, 1, 1, 1), size_coordinate_space="data"
61
+ )
62
+ points_visual_3d = PointsNode(
63
+ name="points_node_3d", data_stream_id=points_stream.id, material=points_material_3d
64
+ )
65
+
66
+ points_material_2d = PointsUniformMaterial(
67
+ size=5, color=(1, 1, 1, 1), size_coordinate_space="data"
68
+ )
69
+ points_visual_2d = PointsNode(
70
+ name="points_node_2d", data_stream_id=points_stream.id, material=points_material_2d
71
+ )
72
+
73
+ # make the canvas
74
+ camera_3d = PerspectiveCamera()
75
+ canvas_3d = Canvas(camera=camera_3d)
76
+
77
+ camera_2d = PerspectiveCamera()
78
+ canvas_2d = Canvas(camera=camera_2d)
79
+
80
+ # make the scene
81
+ scene_3d = Scene(
82
+ dims=dims_3d, visuals=[points_visual_3d], canvases={canvas_3d.id: canvas_3d}
83
+ )
84
+ scene_2d = Scene(
85
+ dims=dims_2d, visuals=[points_visual_2d], canvases={canvas_2d.id: canvas_2d}
86
+ )
87
+
88
+ scene_manager = SceneManager(scenes={scene_3d.id: scene_3d, scene_2d.id: scene_2d})
89
+
90
+ # make the viewer model
91
+ viewer_model = ViewerModel(data=data, scenes=scene_manager)
92
+
93
+ print(viewer_model)
94
+
95
+ viewer_model.to_json_file("points_example_config.json")
@@ -0,0 +1,62 @@
1
+ """Script to show how to assemble a viewer model."""
2
+
3
+ import numpy as np
4
+
5
+ from cellier.models.data_manager import DataManager
6
+ from cellier.models.data_stores.mesh import MeshMemoryStore
7
+ from cellier.models.data_streams.mesh import MeshSynchronousDataStream
8
+ from cellier.models.nodes.mesh_node import MeshNode, MeshPhongMaterial
9
+ from cellier.models.scene.cameras import PerspectiveCamera
10
+ from cellier.models.scene.canvas import Canvas
11
+ from cellier.models.scene.dims_manager import CoordinateSystem, DimsManager
12
+ from cellier.models.scene.scene import Scene
13
+ from cellier.models.viewer import SceneManager, ViewerModel
14
+
15
+ # the mesh data_stores
16
+ vertices = np.array([[10, 10, 10], [10, 10, 20], [10, 20, 20]], dtype=np.float32)
17
+ faces = np.array([[0, 1, 2]], dtype=np.float32)
18
+
19
+ colors = np.array(
20
+ [
21
+ [1, 0, 1, 1],
22
+ [0, 1, 0, 1],
23
+ [0, 0, 1, 1],
24
+ ],
25
+ dtype=np.float32,
26
+ )
27
+
28
+ # make the mesh store
29
+ mesh_store = MeshMemoryStore(vertices=vertices, faces=faces)
30
+
31
+ # make the mesh stream
32
+ mesh_stream = MeshSynchronousDataStream(data_store_id=mesh_store.id, selectors=[])
33
+
34
+ # make the data_stores manager
35
+ data = DataManager(
36
+ stores={mesh_store.id: mesh_store}, streams={mesh_stream.id: mesh_stream}
37
+ )
38
+
39
+ # make the scene coordinate system
40
+ coordinate_system = CoordinateSystem(name="scene_0", axis_labels=["z", "y", "x"])
41
+ dims = DimsManager(coordinate_system=coordinate_system, displayed_dimensions=(0, 1, 2))
42
+
43
+ # make the mesh visual
44
+ mesh_material = MeshPhongMaterial()
45
+ mesh_visual = MeshNode(
46
+ name="mesh_visual", data_stream_id=mesh_stream.id, material=mesh_material
47
+ )
48
+
49
+ # make the canvas
50
+ camera = PerspectiveCamera()
51
+ canvas = Canvas(camera=camera)
52
+
53
+ # make the scene
54
+ scene = Scene(dims=dims, visuals=[mesh_visual], canvases=[canvas])
55
+ scene_manager = SceneManager(scenes={scene.id: scene})
56
+
57
+ # make the viewer model
58
+ viewer_model = ViewerModel(data=data, scenes=scene_manager)
59
+
60
+ print(viewer_model)
61
+
62
+ viewer_model.to_json_file("single_canvas_config.json")