brainrender 2.1.2__tar.gz → 2.1.3__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 (80) hide show
  1. {brainrender-2.1.2 → brainrender-2.1.3}/.gitignore +0 -1
  2. {brainrender-2.1.2 → brainrender-2.1.3}/.pre-commit-config.yaml +6 -2
  3. {brainrender-2.1.2 → brainrender-2.1.3}/MANIFEST.in +0 -2
  4. {brainrender-2.1.2 → brainrender-2.1.3}/PKG-INFO +8 -7
  5. {brainrender-2.1.2 → brainrender-2.1.3}/README.md +1 -1
  6. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/actor.py +1 -1
  7. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/actors/ruler.py +1 -1
  8. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/render.py +2 -2
  9. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/scene.py +1 -1
  10. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender.egg-info/PKG-INFO +8 -7
  11. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender.egg-info/SOURCES.txt +0 -4
  12. {brainrender-2.1.2 → brainrender-2.1.3}/pyproject.toml +35 -7
  13. brainrender-2.1.2/.coveragerc +0 -14
  14. brainrender-2.1.2/getting_started.ipynb +0 -244
  15. brainrender-2.1.2/run_all_examples.sh +0 -7
  16. brainrender-2.1.2/tox.ini +0 -22
  17. {brainrender-2.1.2 → brainrender-2.1.3}/.github/workflows/test_and_deploy.yml +0 -0
  18. {brainrender-2.1.2 → brainrender-2.1.3}/LICENSE +0 -0
  19. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/__init__.py +0 -0
  20. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/_colors.py +0 -0
  21. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/_io.py +0 -0
  22. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/_jupyter.py +0 -0
  23. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/_utils.py +0 -0
  24. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/_video.py +0 -0
  25. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/actors/__init__.py +0 -0
  26. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/actors/cylinder.py +0 -0
  27. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/actors/neurons.py +0 -0
  28. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/actors/points.py +0 -0
  29. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/actors/streamlines.py +0 -0
  30. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/actors/volume.py +0 -0
  31. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/atlas.py +0 -0
  32. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/atlas_specific/__init__.py +0 -0
  33. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/atlas_specific/__pycache__/__init__.cpython-37.pyc +0 -0
  34. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/atlas_specific/allen_brain_atlas/gene_expression/__init__.py +0 -0
  35. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/atlas_specific/allen_brain_atlas/gene_expression/api.py +0 -0
  36. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/atlas_specific/allen_brain_atlas/gene_expression/ge_utils.py +0 -0
  37. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/atlas_specific/allen_brain_atlas/streamlines.py +0 -0
  38. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/camera.py +0 -0
  39. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/cameras.py +0 -0
  40. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/__init__.py +0 -0
  41. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/app.py +0 -0
  42. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/apputils/__init__.py +0 -0
  43. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/apputils/actors_control.py +0 -0
  44. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/apputils/add_from_file_control.py +0 -0
  45. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/apputils/camera_control.py +0 -0
  46. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/apputils/regions_control.py +0 -0
  47. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/BG_logo_mini.svg +0 -0
  48. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/__init__.py +0 -0
  49. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/box_dark.svg +0 -0
  50. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/box_light.svg +0 -0
  51. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/checkedbox_dark.svg +0 -0
  52. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/checkedbox_light.svg +0 -0
  53. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/down_dark.svg +0 -0
  54. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/down_light.svg +0 -0
  55. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/eye-slash.svg +0 -0
  56. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/eye.svg +0 -0
  57. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/right_dark.svg +0 -0
  58. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/icons/right_light.svg +0 -0
  59. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/style.py +0 -0
  60. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/ui.py +0 -0
  61. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/utils.py +0 -0
  62. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/widgets/__init__.py +0 -0
  63. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/widgets/actors_list.py +0 -0
  64. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/widgets/add_from_file.py +0 -0
  65. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/widgets/add_regions.py +0 -0
  66. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/widgets/screenshot_modal.py +0 -0
  67. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/gui/widgets/tree.py +0 -0
  68. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/resources/CC_134_1_ch1inj.obj +0 -0
  69. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/resources/CC_134_2_ch1inj.obj +0 -0
  70. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/resources/neuron1.swc +0 -0
  71. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/resources/random_cells.h5 +0 -0
  72. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/resources/random_cells.npy +0 -0
  73. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/resources/volume.npy +0 -0
  74. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/settings.py +0 -0
  75. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender/video.py +0 -0
  76. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender.egg-info/dependency_links.txt +0 -0
  77. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender.egg-info/entry_points.txt +0 -0
  78. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender.egg-info/requires.txt +0 -0
  79. {brainrender-2.1.2 → brainrender-2.1.3}/brainrender.egg-info/top_level.txt +0 -0
  80. {brainrender-2.1.2 → brainrender-2.1.3}/setup.cfg +0 -0
@@ -28,7 +28,6 @@ brexport.html
28
28
  *.vtk
29
29
  *.nrrd
30
30
  *.tdms
31
- paper/created_videos
32
31
  *.mp4
33
32
 
34
33
 
@@ -1,3 +1,7 @@
1
+ # Configuring https://pre-commit.ci/ bot
2
+ ci:
3
+ autoupdate_schedule: monthly
4
+
1
5
  repos:
2
6
  - repo: https://github.com/pre-commit/pre-commit-hooks
3
7
  rev: v4.5.0
@@ -12,10 +16,10 @@ repos:
12
16
  - id: requirements-txt-fixer
13
17
  - id: trailing-whitespace
14
18
  - repo: https://github.com/astral-sh/ruff-pre-commit
15
- rev: v0.1.6
19
+ rev: v0.1.8
16
20
  hooks:
17
21
  - id: ruff
18
22
  - repo: https://github.com/psf/black
19
- rev: 23.11.0
23
+ rev: 23.12.0
20
24
  hooks:
21
25
  - id: black
@@ -1,9 +1,7 @@
1
1
  global-include *.svg
2
2
  include brainrender/gui/icons*
3
3
 
4
- recursive-exclude paper *
5
4
  recursive-exclude tests *
6
5
  recursive-exclude examples *
7
6
  recursive-exclude imgs *
8
7
  recursive-exclude videos *
9
- recursive-exclude benchmark *
@@ -1,13 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: brainrender
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: Visualisation and exploration of brain atlases and other anatomical data
5
5
  Author-email: "Federico Claudi, Adam Tyson, Luigi Petrucco" <hello@brainglobe.info>
6
6
  License: BSD-3-Clause
7
- Project-URL: homepage, https://brainglobe.info
8
- Project-URL: bug_tracker, https://github.com/brainglobe/brainrender/issues
9
- Project-URL: source_code, https://github.com/brainglobe/brainrender
10
- Project-URL: user_support, https://github.com/brainglobe/brainrender/issues
7
+ Project-URL: Homepage, https://brainglobe.info/
8
+ Project-URL: Source Code, https://github.com/brainglobe/brainrender
9
+ Project-URL: Bug Tracker, https://github.com/brainglobe/brainrender/issues
10
+ Project-URL: Documentation, https://brainglobe.info/documentation/brainrender/index.html
11
+ Project-URL: User Support, https://forum.image.sc/tag/brainglobe
11
12
  Classifier: Development Status :: 3 - Alpha
12
13
  Classifier: Programming Language :: Python
13
14
  Classifier: Programming Language :: Python :: 3
@@ -18,7 +19,7 @@ Classifier: Operating System :: OS Independent
18
19
  Classifier: License :: OSI Approved :: BSD License
19
20
  Classifier: Intended Audience :: Developers
20
21
  Classifier: Intended Audience :: Science/Research
21
- Requires-Python: >=3.8.0
22
+ Requires-Python: >=3.9.0
22
23
  Description-Content-Type: text/markdown
23
24
  License-File: LICENSE
24
25
  Requires-Dist: numpy
@@ -68,8 +69,8 @@ Requires-Dist: PyQt5; extra == "pyqt5"
68
69
  [![Python Version](https://img.shields.io/pypi/pyversions/brainrender.svg)](https://pypi.org/project/brainrender)
69
70
  [![PyPI](https://img.shields.io/pypi/v/brainrender.svg)](https://pypi.org/project/brainrender)
70
71
  [![tests](https://github.com/brainglobe/brainrender/workflows/tests/badge.svg)](https://github.com/brainglobe/brainrender/actions)
72
+ [![codecov](https://codecov.io/gh/brainglobe/brainrender/graph/badge.svg)](https://codecov.io/gh/brainglobe/brainrender)
71
73
  [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
72
- [![Coverage Status](https://coveralls.io/repos/github/brainglobe/brainrender/badge.svg)](https://coveralls.io/github/brainglobe/brainrender)
73
74
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
74
75
 
75
76
 
@@ -7,8 +7,8 @@
7
7
  [![Python Version](https://img.shields.io/pypi/pyversions/brainrender.svg)](https://pypi.org/project/brainrender)
8
8
  [![PyPI](https://img.shields.io/pypi/v/brainrender.svg)](https://pypi.org/project/brainrender)
9
9
  [![tests](https://github.com/brainglobe/brainrender/workflows/tests/badge.svg)](https://github.com/brainglobe/brainrender/actions)
10
+ [![codecov](https://codecov.io/gh/brainglobe/brainrender/graph/badge.svg)](https://codecov.io/gh/brainglobe/brainrender)
10
11
  [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
11
- [![Coverage Status](https://coveralls.io/repos/github/brainglobe/brainrender/badge.svg)](https://coveralls.io/github/brainglobe/brainrender)
12
12
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
13
13
 
14
14
 
@@ -128,7 +128,7 @@ class Actor:
128
128
  ) # pragma: no cover
129
129
 
130
130
  # some attributes should be from .mesh, others from ._mesh
131
- mesh_attributes = ("centerOfMass",)
131
+ mesh_attributes = ("center_of_mass",)
132
132
  if attr in mesh_attributes:
133
133
  if hasattr(self.__dict__["mesh"], attr):
134
134
  return getattr(self.__dict__["mesh"], attr)
@@ -67,7 +67,7 @@ def ruler_from_surface(
67
67
  p2 = p1.copy()
68
68
  p2[axis] = 0 # zero the chosen coordinate
69
69
 
70
- pts = root._mesh.intersect_with_line(p1, p2)
70
+ pts = root.mesh.intersect_with_line(p1, p2)
71
71
  surface_point = pts[0]
72
72
 
73
73
  return ruler(p1, surface_point, unit_scale=unit_scale, units=units, s=s)
@@ -119,8 +119,8 @@ class Render:
119
119
 
120
120
  Once an actor is 'corrected' it spawns labels and silhouettes as needed
121
121
  """
122
- # don't apply transforms to points density actors or rulers
123
- if isinstance(actor, PointsDensity) or actor.br_class == "Ruler":
122
+ # don't apply transforms to points density actors
123
+ if isinstance(actor, PointsDensity):
124
124
  logger.debug(
125
125
  f'Not transforming actor "{actor.name} (type: {actor.br_class})"'
126
126
  )
@@ -304,7 +304,7 @@ class Scene(JupyterMixIn, Render):
304
304
  actors.cap()
305
305
  else:
306
306
  for actor in actors:
307
- actor._mesh.cutWithPlane(
307
+ actor._mesh.cut_with_plane(
308
308
  origin=plane.center,
309
309
  normal=plane.normal,
310
310
  )
@@ -1,13 +1,14 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: brainrender
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: Visualisation and exploration of brain atlases and other anatomical data
5
5
  Author-email: "Federico Claudi, Adam Tyson, Luigi Petrucco" <hello@brainglobe.info>
6
6
  License: BSD-3-Clause
7
- Project-URL: homepage, https://brainglobe.info
8
- Project-URL: bug_tracker, https://github.com/brainglobe/brainrender/issues
9
- Project-URL: source_code, https://github.com/brainglobe/brainrender
10
- Project-URL: user_support, https://github.com/brainglobe/brainrender/issues
7
+ Project-URL: Homepage, https://brainglobe.info/
8
+ Project-URL: Source Code, https://github.com/brainglobe/brainrender
9
+ Project-URL: Bug Tracker, https://github.com/brainglobe/brainrender/issues
10
+ Project-URL: Documentation, https://brainglobe.info/documentation/brainrender/index.html
11
+ Project-URL: User Support, https://forum.image.sc/tag/brainglobe
11
12
  Classifier: Development Status :: 3 - Alpha
12
13
  Classifier: Programming Language :: Python
13
14
  Classifier: Programming Language :: Python :: 3
@@ -18,7 +19,7 @@ Classifier: Operating System :: OS Independent
18
19
  Classifier: License :: OSI Approved :: BSD License
19
20
  Classifier: Intended Audience :: Developers
20
21
  Classifier: Intended Audience :: Science/Research
21
- Requires-Python: >=3.8.0
22
+ Requires-Python: >=3.9.0
22
23
  Description-Content-Type: text/markdown
23
24
  License-File: LICENSE
24
25
  Requires-Dist: numpy
@@ -68,8 +69,8 @@ Requires-Dist: PyQt5; extra == "pyqt5"
68
69
  [![Python Version](https://img.shields.io/pypi/pyversions/brainrender.svg)](https://pypi.org/project/brainrender)
69
70
  [![PyPI](https://img.shields.io/pypi/v/brainrender.svg)](https://pypi.org/project/brainrender)
70
71
  [![tests](https://github.com/brainglobe/brainrender/workflows/tests/badge.svg)](https://github.com/brainglobe/brainrender/actions)
72
+ [![codecov](https://codecov.io/gh/brainglobe/brainrender/graph/badge.svg)](https://codecov.io/gh/brainglobe/brainrender)
71
73
  [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
72
- [![Coverage Status](https://coveralls.io/repos/github/brainglobe/brainrender/badge.svg)](https://coveralls.io/github/brainglobe/brainrender)
73
74
  [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
74
75
 
75
76
 
@@ -1,13 +1,9 @@
1
- .coveragerc
2
1
  .gitignore
3
2
  .pre-commit-config.yaml
4
3
  LICENSE
5
4
  MANIFEST.in
6
5
  README.md
7
- getting_started.ipynb
8
6
  pyproject.toml
9
- run_all_examples.sh
10
- tox.ini
11
7
  .github/workflows/test_and_deploy.yml
12
8
  brainrender/__init__.py
13
9
  brainrender/_colors.py
@@ -3,7 +3,7 @@ name = "brainrender"
3
3
  authors = [{name = "Federico Claudi, Adam Tyson, Luigi Petrucco", email="hello@brainglobe.info"}]
4
4
  description = "Visualisation and exploration of brain atlases and other anatomical data"
5
5
  readme = "README.md"
6
- requires-python = ">=3.8.0"
6
+ requires-python = ">=3.9.0"
7
7
  dynamic = ["version"]
8
8
 
9
9
  dependencies = [
@@ -41,10 +41,11 @@ classifiers = [
41
41
  ]
42
42
 
43
43
  [project.urls]
44
- homepage = "https://brainglobe.info"
45
- bug_tracker = "https://github.com/brainglobe/brainrender/issues"
46
- source_code = "https://github.com/brainglobe/brainrender"
47
- user_support = "https://github.com/brainglobe/brainrender/issues"
44
+ Homepage = "https://brainglobe.info/"
45
+ "Source Code" = "https://github.com/brainglobe/brainrender"
46
+ "Bug Tracker" = "https://github.com/brainglobe/brainrender/issues"
47
+ Documentation = "https://brainglobe.info/documentation/brainrender/index.html"
48
+ "User Support" = "https://forum.image.sc/tag/brainglobe"
48
49
 
49
50
  [project.optional-dependencies]
50
51
  dev = [
@@ -91,7 +92,7 @@ markers = [
91
92
  ]
92
93
 
93
94
  [tool.black]
94
- target-version = ['py38', 'py39', 'py310', 'py311']
95
+ target-version = ['py39', 'py310', 'py311']
95
96
  skip-string-normalization = false
96
97
  line-length = 79
97
98
 
@@ -111,7 +112,34 @@ ignore = [
111
112
  # should revisit some of these.
112
113
  [tool.ruff]
113
114
  line-length = 79
114
- exclude = ["__init__.py","build",".eggs","paper","examples"]
115
+ exclude = ["__init__.py","build",".eggs","examples"]
115
116
  select = ["I", "E", "F"]
116
117
  fix = true
117
118
  ignore = ["E501", "E402"]
119
+
120
+
121
+ [tool.tox]
122
+ legacy_tox_ini = """
123
+ [tox]
124
+ envlist = py{39,310,311}
125
+ isolated_build = True
126
+
127
+ [gh-actions]
128
+ python =
129
+ 3.9: py39
130
+ 3.10: py310
131
+ 3.11: py311
132
+
133
+ [testenv]
134
+ extras =
135
+ dev
136
+ commands =
137
+ pytest -v --color=yes --cov=brainrender --cov-report=xml
138
+ passenv =
139
+ CI
140
+ GITHUB_ACTIONS
141
+ DISPLAY
142
+ XAUTHORITY
143
+ NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
144
+ PYVISTA_OFF_SCREEN
145
+ """
@@ -1,14 +0,0 @@
1
- [RUN]
2
- omit =
3
- brainrender/gui/*
4
- brainrender/gui
5
-
6
- [report]
7
- omit =
8
- brainrender/gui/*
9
- brainrender/gui
10
-
11
-
12
- exclude_lines =
13
- def keypress
14
- pragma: no cover
@@ -1,244 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "markdown",
5
- "metadata": {},
6
- "source": [
7
- "## Getting started with brainrender\n",
8
- "This notebooks shows how to get started using brainrender.\n",
9
- "It assumes that you have already installed, if not please install it now:\n",
10
- "```\n",
11
- "pip install brainrneder\n",
12
- "```\n",
13
- "\n",
14
- "For more details about how to install brainrender, [please check the docs](https://brainglobe.info/documentation/brainrender/installation.html)\n",
15
- "\n",
16
- "### Content of this example\n",
17
- "This notebook shows how to:\n",
18
- "* Create a `Scene` in brainrender\n",
19
- "* add `brain regions` to your scene\n",
20
- "* add a `neuronal morphology` to your scene\n",
21
- "\n",
22
- "You can check the [examples](https://github.com/brainglobe/brainrender/tree/master/examples) and the [documentation](https://brainglobe.info/documentation/brainrender/) to learn more about how to use brainrender.\n",
23
- "\n",
24
- "In particular, if you are planning to use brainrender in a Jupyter Notebook, please read the [docs](https://brainglobe.info/documentation/brainrender/usage/using-notebooks.html) about using brainrender in a notebook, and have a look at the [notebooks workflow example](https://github.com/brainglobe/brainrender/blob/master/examples/notebook_workflow.ipynb)"
25
- ]
26
- },
27
- {
28
- "cell_type": "code",
29
- "execution_count": 1,
30
- "metadata": {},
31
- "outputs": [
32
- {
33
- "data": {
34
- "text/plain": [
35
- "False"
36
- ]
37
- },
38
- "execution_count": 1,
39
- "metadata": {},
40
- "output_type": "execute_result"
41
- }
42
- ],
43
- "source": [
44
- "import vedo\n",
45
- "vedo.settings.default_backend == \"k3d\""
46
- ]
47
- },
48
- {
49
- "cell_type": "markdown",
50
- "metadata": {},
51
- "source": [
52
- "### Creating a scene and adding brain regions"
53
- ]
54
- },
55
- {
56
- "cell_type": "code",
57
- "execution_count": 1,
58
- "metadata": {},
59
- "outputs": [
60
- {
61
- "data": {
62
- "text/html": [
63
- "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> acronym id name\n",
64
- "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span> root <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">997</span> root\n",
65
- "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span> grey <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">8</span> Basic cell groups and regions\n",
66
- "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span> CH <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">567</span> Cerebrum\n",
67
- "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span> CTX <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">688</span> Cerebral cortex\n",
68
- "<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span> CTXpl <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">695</span> Cortical plate\n",
69
- "</pre>\n"
70
- ],
71
- "text/plain": [
72
- " acronym id name\n",
73
- "\u001b[1;36m0\u001b[0m root \u001b[1;36m997\u001b[0m root\n",
74
- "\u001b[1;36m1\u001b[0m grey \u001b[1;36m8\u001b[0m Basic cell groups and regions\n",
75
- "\u001b[1;36m2\u001b[0m CH \u001b[1;36m567\u001b[0m Cerebrum\n",
76
- "\u001b[1;36m3\u001b[0m CTX \u001b[1;36m688\u001b[0m Cerebral cortex\n",
77
- "\u001b[1;36m4\u001b[0m CTXpl \u001b[1;36m695\u001b[0m Cortical plate\n"
78
- ]
79
- },
80
- "metadata": {},
81
- "output_type": "display_data"
82
- }
83
- ],
84
- "source": [
85
- "# Import Scene\n",
86
- "from brainrender import Scene # Scene handles the creation of your rendering!\n",
87
- "\n",
88
- "scene = Scene(title='My first rendering') # create an instance of scene\n",
89
- "'''\n",
90
- "If you want to use any of the atlases supported by BrainGlobe's AtlasAPI,\n",
91
- "specify the atlas name when creating an instance of `Scene`!\n",
92
- "'''\n",
93
- "\n",
94
- "# Adding brain regions\n",
95
- "scene.add_brain_region('MOs', 'TH', alpha=.5)\n",
96
- "\n",
97
- "'''\n",
98
- "You can add any number of brain regions at once, just specify the regions' acronym or ID numbers.\n",
99
- "If you are not sure what the acronym/ID is for your region, have a look try:\n",
100
- "\n",
101
- "`scene.atlas.lookup_df`\n",
102
- "\n",
103
- "or:\n",
104
- "`print(scene.atlas.hierarchy)`\n",
105
- "\n",
106
- "which will show the hieararchical organization of the atlas' regions:\n",
107
- "\n",
108
- "root (997)\n",
109
- "├── VS (73)\n",
110
- "│ ├── AQ (140)\n",
111
- "│ ├── V3 (129)\n",
112
- "│ ├── V4 (145)\n",
113
- "│ │ └── V4r (153)\n",
114
- "│ ├── VL (81)\n",
115
- "│ │ ├── SEZ (98)\n",
116
- "│ │ └── chpl (108)\n",
117
- "│ └── c (164)\n",
118
- "├── fiber tracts (1009)\n",
119
- "│ ├── cbf (960)\n",
120
- "│ │ ├── arb (728)\n",
121
- "...\n",
122
- "\n",
123
- "'''\n",
124
- "\n",
125
- "scene.atlas.lookup_df.head()"
126
- ]
127
- },
128
- {
129
- "cell_type": "markdown",
130
- "metadata": {},
131
- "source": [
132
- "### Adding a neuronal morphology\n",
133
- "Brainrender can load neuronal morphologies from .swc files"
134
- ]
135
- },
136
- {
137
- "cell_type": "code",
138
- "execution_count": 3,
139
- "metadata": {
140
- "scrolled": true
141
- },
142
- "outputs": [
143
- {
144
- "data": {
145
- "text/html": [
146
- "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #ffa726; text-decoration-color: #ffa726\">╭──────────────────────────────────╮</span>\n",
147
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"font-weight: bold\"> </span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
148
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ff7043; text-decoration-color: #ff7043; font-weight: bold\">Scene actors</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
149
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ff7043; text-decoration-color: #ff7043; font-weight: bold\">────────────</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
150
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
151
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ffca28; text-decoration-color: #ffca28; font-weight: bold\">- root</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\"> (type: </span><span style=\"color: #ffa726; text-decoration-color: #ffa726\">brain region</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\">)</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
152
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ffca28; text-decoration-color: #ffca28; font-weight: bold\">- title</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\"> (type: </span><span style=\"color: #ffa726; text-decoration-color: #ffa726\">title</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\">)</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
153
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ffca28; text-decoration-color: #ffca28; font-weight: bold\">- MOs</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\"> (type: </span><span style=\"color: #ffa726; text-decoration-color: #ffa726\">brain region</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\">)</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
154
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ffca28; text-decoration-color: #ffca28; font-weight: bold\">- TH</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\"> (type: </span><span style=\"color: #ffa726; text-decoration-color: #ffa726\">brain region</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\">)</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
155
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ffca28; text-decoration-color: #ffca28; font-weight: bold\">- neuron1.swc</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\"> (type: </span><span style=\"color: #ffa726; text-decoration-color: #ffa726\">Neuron</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\">)</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
156
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ffca28; text-decoration-color: #ffca28; font-weight: bold\">- neuron1.swc</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\"> (type: </span><span style=\"color: #ffa726; text-decoration-color: #ffa726\">Neuron</span><span style=\"color: #ef6c00; text-decoration-color: #ef6c00\">)</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
157
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span> <span style=\"color: #ffa726; text-decoration-color: #ffa726\">│</span>\n",
158
- "<span style=\"color: #ffa726; text-decoration-color: #ffa726\">╰──────────────────────────────────╯</span>\n",
159
- "</pre>\n"
160
- ],
161
- "text/plain": [
162
- "\u001b[38;2;255;167;38m╭──────────────────────────────────╮\u001b[0m\n",
163
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1m \u001b[0m\u001b[1m \u001b[0m\u001b[1m \u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
164
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1;38;2;255;112;67mScene actors\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
165
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1;38;2;255;112;67m────────────\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
166
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
167
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1;38;2;255;202;40m- root\u001b[0m\u001b[38;2;239;108;0m (type: \u001b[0m\u001b[38;2;255;167;38mbrain region\u001b[0m\u001b[38;2;239;108;0m)\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
168
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1;38;2;255;202;40m- title\u001b[0m\u001b[38;2;239;108;0m (type: \u001b[0m\u001b[38;2;255;167;38mtitle\u001b[0m\u001b[38;2;239;108;0m)\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
169
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1;38;2;255;202;40m- MOs\u001b[0m\u001b[38;2;239;108;0m (type: \u001b[0m\u001b[38;2;255;167;38mbrain region\u001b[0m\u001b[38;2;239;108;0m)\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
170
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1;38;2;255;202;40m- TH\u001b[0m\u001b[38;2;239;108;0m (type: \u001b[0m\u001b[38;2;255;167;38mbrain region\u001b[0m\u001b[38;2;239;108;0m)\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
171
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1;38;2;255;202;40m- neuron1.swc\u001b[0m\u001b[38;2;239;108;0m (type: \u001b[0m\u001b[38;2;255;167;38mNeuron\u001b[0m\u001b[38;2;239;108;0m)\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
172
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[1;38;2;255;202;40m- neuron1.swc\u001b[0m\u001b[38;2;239;108;0m (type: \u001b[0m\u001b[38;2;255;167;38mNeuron\u001b[0m\u001b[38;2;239;108;0m)\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
173
- "\u001b[38;2;255;167;38m│\u001b[0m \u001b[38;2;255;167;38m│\u001b[0m\n",
174
- "\u001b[38;2;255;167;38m╰──────────────────────────────────╯\u001b[0m\n"
175
- ]
176
- },
177
- "metadata": {},
178
- "output_type": "display_data"
179
- }
180
- ],
181
- "source": [
182
- "from brainrender.actors import Neuron # import the Neuron actor class\n",
183
- "\n",
184
- "scene.add(Neuron(\"examples/data/neuron1.swc\"))\n",
185
- "\n",
186
- "'''\n",
187
- "Scene.add can be used to add actors to your scene. \n",
188
- "It accepts instances of the classes defined in brainrender.actors, \n",
189
- "mesh objects (e.g. loaded with vedo) or path to 3D objects file (e.g. .obj files)\n",
190
- "\n",
191
- "To see what actors are in a scene, use scene.content\n",
192
- "'''\n",
193
- "scene.content"
194
- ]
195
- },
196
- {
197
- "cell_type": "markdown",
198
- "metadata": {},
199
- "source": [
200
- "### Rendering\n",
201
- "Rendering is as simple as `scene.render()`.\n",
202
- "This will create a pop-up window with the interactive 3D rendering of your scene. \n",
203
- "When you're done with it, press \"Esc\" to close the window!"
204
- ]
205
- },
206
- {
207
- "cell_type": "code",
208
- "execution_count": null,
209
- "metadata": {},
210
- "outputs": [],
211
- "source": [
212
- "scene.render()"
213
- ]
214
- },
215
- {
216
- "cell_type": "code",
217
- "execution_count": null,
218
- "metadata": {},
219
- "outputs": [],
220
- "source": []
221
- }
222
- ],
223
- "metadata": {
224
- "kernelspec": {
225
- "display_name": "Python 3 (ipykernel)",
226
- "language": "python",
227
- "name": "python3"
228
- },
229
- "language_info": {
230
- "codemirror_mode": {
231
- "name": "ipython",
232
- "version": 3
233
- },
234
- "file_extension": ".py",
235
- "mimetype": "text/x-python",
236
- "name": "python",
237
- "nbconvert_exporter": "python",
238
- "pygments_lexer": "ipython3",
239
- "version": "3.11.4"
240
- }
241
- },
242
- "nbformat": 4,
243
- "nbformat_minor": 4
244
- }
@@ -1,7 +0,0 @@
1
- for entry in "examples"/*
2
- do
3
- for f in $entry/*
4
- do
5
- python $f
6
- done
7
- done
brainrender-2.1.2/tox.ini DELETED
@@ -1,22 +0,0 @@
1
- [tox]
2
- envlist = py{39,310,311}
3
- isolated_build = True
4
-
5
- [gh-actions]
6
- python =
7
- 3.9: py39
8
- 3.10: py310
9
- 3.11: py311
10
-
11
- [testenv]
12
- extras =
13
- dev
14
- commands =
15
- pytest -v --color=yes --cov=brainrender --cov-report=xml
16
- passenv =
17
- CI
18
- GITHUB_ACTIONS
19
- DISPLAY
20
- XAUTHORITY
21
- NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
22
- PYVISTA_OFF_SCREEN
File without changes
File without changes