brainrender 2.1.0__tar.gz → 2.1.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.
- {brainrender-2.1.0 → brainrender-2.1.2}/.pre-commit-config.yaml +4 -4
- {brainrender-2.1.0 → brainrender-2.1.2}/PKG-INFO +4 -4
- {brainrender-2.1.0 → brainrender-2.1.2}/README.md +1 -1
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/actor.py +2 -2
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/actors/points.py +1 -1
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/actors/volume.py +12 -5
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/camera.py +11 -12
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/cameras.py +6 -6
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/render.py +10 -9
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/scene.py +3 -5
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/settings.py +1 -3
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/video.py +4 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender.egg-info/PKG-INFO +4 -4
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender.egg-info/requires.txt +2 -2
- {brainrender-2.1.0 → brainrender-2.1.2}/pyproject.toml +2 -2
- {brainrender-2.1.0 → brainrender-2.1.2}/.coveragerc +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/.github/workflows/test_and_deploy.yml +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/.gitignore +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/LICENSE +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/MANIFEST.in +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/__init__.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/_colors.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/_io.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/_jupyter.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/_utils.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/_video.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/actors/__init__.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/actors/cylinder.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/actors/neurons.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/actors/ruler.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/actors/streamlines.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/atlas.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/atlas_specific/__init__.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/atlas_specific/__pycache__/__init__.cpython-37.pyc +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/atlas_specific/allen_brain_atlas/gene_expression/__init__.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/atlas_specific/allen_brain_atlas/gene_expression/api.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/atlas_specific/allen_brain_atlas/gene_expression/ge_utils.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/atlas_specific/allen_brain_atlas/streamlines.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/__init__.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/app.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/apputils/__init__.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/apputils/actors_control.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/apputils/add_from_file_control.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/apputils/camera_control.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/apputils/regions_control.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/BG_logo_mini.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/__init__.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/box_dark.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/box_light.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/checkedbox_dark.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/checkedbox_light.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/down_dark.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/down_light.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/eye-slash.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/eye.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/right_dark.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/icons/right_light.svg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/style.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/ui.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/utils.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/widgets/__init__.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/widgets/actors_list.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/widgets/add_from_file.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/widgets/add_regions.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/widgets/screenshot_modal.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/gui/widgets/tree.py +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/resources/CC_134_1_ch1inj.obj +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/resources/CC_134_2_ch1inj.obj +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/resources/neuron1.swc +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/resources/random_cells.h5 +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/resources/random_cells.npy +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender/resources/volume.npy +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender.egg-info/SOURCES.txt +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender.egg-info/dependency_links.txt +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender.egg-info/entry_points.txt +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/brainrender.egg-info/top_level.txt +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/getting_started.ipynb +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/run_all_examples.sh +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/setup.cfg +0 -0
- {brainrender-2.1.0 → brainrender-2.1.2}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
repos:
|
|
2
2
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
-
rev: v4.
|
|
3
|
+
rev: v4.5.0
|
|
4
4
|
hooks:
|
|
5
5
|
- id: check-docstring-first
|
|
6
6
|
- id: check-executables-have-shebangs
|
|
@@ -11,11 +11,11 @@ repos:
|
|
|
11
11
|
args: [--fix=lf]
|
|
12
12
|
- id: requirements-txt-fixer
|
|
13
13
|
- id: trailing-whitespace
|
|
14
|
-
- repo: https://github.com/
|
|
15
|
-
rev: v0.
|
|
14
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
15
|
+
rev: v0.1.6
|
|
16
16
|
hooks:
|
|
17
17
|
- id: ruff
|
|
18
18
|
- repo: https://github.com/psf/black
|
|
19
|
-
rev: 23.
|
|
19
|
+
rev: 23.11.0
|
|
20
20
|
hooks:
|
|
21
21
|
- id: black
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: brainrender
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.2
|
|
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
|
|
@@ -23,14 +23,14 @@ Description-Content-Type: text/markdown
|
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
Requires-Dist: numpy
|
|
25
25
|
Requires-Dist: pandas
|
|
26
|
-
Requires-Dist: h5py
|
|
26
|
+
Requires-Dist: h5py
|
|
27
27
|
Requires-Dist: vedo>=2023.5.0
|
|
28
28
|
Requires-Dist: k3d
|
|
29
29
|
Requires-Dist: imio
|
|
30
30
|
Requires-Dist: msgpack
|
|
31
31
|
Requires-Dist: pyyaml>=5.3
|
|
32
32
|
Requires-Dist: pooch
|
|
33
|
-
Requires-Dist: morphapi>=0.1
|
|
33
|
+
Requires-Dist: morphapi>=0.2.1
|
|
34
34
|
Requires-Dist: requests
|
|
35
35
|
Requires-Dist: bg-atlasapi>=1.0.0
|
|
36
36
|
Requires-Dist: tables
|
|
@@ -67,7 +67,7 @@ Requires-Dist: PyQt5; extra == "pyqt5"
|
|
|
67
67
|
|
|
68
68
|
[](https://pypi.org/project/brainrender)
|
|
69
69
|
[](https://pypi.org/project/brainrender)
|
|
70
|
-
[](https://github.com/brainglobe/brainrender/actions)
|
|
71
71
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
72
72
|
[](https://coveralls.io/github/brainglobe/brainrender)
|
|
73
73
|
[](https://github.com/python/black)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
[](https://pypi.org/project/brainrender)
|
|
8
8
|
[](https://pypi.org/project/brainrender)
|
|
9
|
-
[](https://github.com/brainglobe/brainrender/actions)
|
|
10
10
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
11
11
|
[](https://coveralls.io/github/brainglobe/brainrender)
|
|
12
12
|
[](https://github.com/python/black)
|
|
@@ -39,7 +39,7 @@ def make_actor_label(
|
|
|
39
39
|
default_offset = np.array([0, -200, 100])
|
|
40
40
|
|
|
41
41
|
new_actors = []
|
|
42
|
-
for
|
|
42
|
+
for _, (actor, label) in enumerate(zip(listify(actors), listify(labels))):
|
|
43
43
|
# Get label color
|
|
44
44
|
if color is None:
|
|
45
45
|
color = [0.2, 0.2, 0.2]
|
|
@@ -74,7 +74,7 @@ def make_actor_label(
|
|
|
74
74
|
return new_actors
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
class Actor
|
|
77
|
+
class Actor:
|
|
78
78
|
_needs_label = False # needs to make a label
|
|
79
79
|
_needs_silhouette = False # needs to make a silhouette
|
|
80
80
|
_is_transformed = False # has been transformed to correct axes orientation
|
|
@@ -75,15 +75,22 @@ class Volume(Actor):
|
|
|
75
75
|
|
|
76
76
|
def _from_numpy(self, griddata, voxel_size, color, **volume_kwargs):
|
|
77
77
|
"""
|
|
78
|
-
Creates a vedo.Volume actor from a 3D numpy array
|
|
79
|
-
with volume data
|
|
78
|
+
Creates a vedo.Volume actor from a 3D numpy array with volume data.
|
|
80
79
|
"""
|
|
81
|
-
|
|
82
|
-
return VedoVolume(
|
|
80
|
+
vvol = VedoVolume(
|
|
83
81
|
griddata,
|
|
84
82
|
spacing=[voxel_size, voxel_size, voxel_size],
|
|
85
83
|
**volume_kwargs,
|
|
86
|
-
)
|
|
84
|
+
)
|
|
85
|
+
vvol.cmap(color)
|
|
86
|
+
# The transformation below is ALREADY applied
|
|
87
|
+
# to vedo.Volume instances in render.py
|
|
88
|
+
# so we should not apply it here.
|
|
89
|
+
# Flip volume so that it's oriented as in the atlas
|
|
90
|
+
# vvol.permute_axes(2, 1, 0)
|
|
91
|
+
# mtx = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, -1, 0], [0, 0, 0, 1]]
|
|
92
|
+
# vvol.apply_transform(mtx)
|
|
93
|
+
return vvol
|
|
87
94
|
|
|
88
95
|
def _from_file(self, filepath, voxel_size, color, **volume_kwargs):
|
|
89
96
|
"""
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import vtk
|
|
2
1
|
from loguru import logger
|
|
2
|
+
from vtkmodules.vtkRenderingCore import vtkCamera
|
|
3
3
|
|
|
4
4
|
from brainrender.cameras import cameras
|
|
5
5
|
|
|
@@ -24,14 +24,14 @@ def check_camera_param(camera):
|
|
|
24
24
|
if isinstance(camera, str):
|
|
25
25
|
return get_camera(camera)
|
|
26
26
|
else:
|
|
27
|
-
params = ["pos", "viewup", "
|
|
27
|
+
params = ["pos", "viewup", "clipping_range"]
|
|
28
28
|
for param in params:
|
|
29
29
|
if param not in list(camera.keys()):
|
|
30
30
|
raise ValueError(
|
|
31
31
|
f"Camera parameters dict should include the following keys: {params}, missing: {param}"
|
|
32
32
|
)
|
|
33
|
-
if "
|
|
34
|
-
camera["
|
|
33
|
+
if "focal_point" not in camera.keys():
|
|
34
|
+
camera["focal_point"] = None
|
|
35
35
|
return camera
|
|
36
36
|
|
|
37
37
|
|
|
@@ -45,10 +45,10 @@ def set_camera_params(camera, params):
|
|
|
45
45
|
# Apply camera parameters
|
|
46
46
|
camera.SetPosition(params["pos"])
|
|
47
47
|
camera.SetViewUp(params["viewup"])
|
|
48
|
-
camera.SetClippingRange(params["
|
|
48
|
+
camera.SetClippingRange(params["clipping_range"])
|
|
49
49
|
|
|
50
|
-
if "
|
|
51
|
-
camera.SetFocalPoint(params["
|
|
50
|
+
if "focal_point" in params.keys() and params["focal_point"] is not None:
|
|
51
|
+
camera.SetFocalPoint(params["focal_point"])
|
|
52
52
|
if "distance" in params.keys():
|
|
53
53
|
camera.SetDistance(params["distance"])
|
|
54
54
|
|
|
@@ -60,12 +60,11 @@ def set_camera(scene, camera):
|
|
|
60
60
|
:param scene: instance of Scene
|
|
61
61
|
:param camera: either a string with the name of one of the pre-defined cameras, or
|
|
62
62
|
a dictionary of camera parameters.
|
|
63
|
-
|
|
64
63
|
"""
|
|
65
64
|
if camera is None:
|
|
66
|
-
return
|
|
65
|
+
return None
|
|
67
66
|
|
|
68
|
-
if not isinstance(camera,
|
|
67
|
+
if not isinstance(camera, vtkCamera):
|
|
69
68
|
# Get camera params
|
|
70
69
|
camera = check_camera_param(camera)
|
|
71
70
|
|
|
@@ -103,10 +102,10 @@ def get_camera_params(scene=None, camera=None):
|
|
|
103
102
|
|
|
104
103
|
params = dict(
|
|
105
104
|
pos=clean(cam.GetPosition()),
|
|
106
|
-
|
|
105
|
+
focal_point=clean(cam.GetFocalPoint()),
|
|
107
106
|
viewup=clean(cam.GetViewUp()),
|
|
108
107
|
distance=clean(cam.GetDistance()),
|
|
109
|
-
|
|
108
|
+
clipping_range=clean(cam.GetClippingRange()),
|
|
110
109
|
# orientation=clean(cam.GetOrientation()),
|
|
111
110
|
)
|
|
112
111
|
return params
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
sagittal_camera = {
|
|
2
2
|
"pos": (6514, -34, 36854),
|
|
3
3
|
"viewup": (0, -1, 0),
|
|
4
|
-
"
|
|
4
|
+
"clipping_range": (24098, 49971),
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
sagittal_camera2 = {
|
|
8
8
|
"pos": (9782, 1795, -40999),
|
|
9
9
|
"viewup": (0, -1, 0),
|
|
10
|
-
"
|
|
10
|
+
"clipping_range": (23256, 51031),
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
frontal_camera = {
|
|
15
15
|
"pos": (-19199, -1428, -5763),
|
|
16
16
|
"viewup": (0, -1, 0),
|
|
17
|
-
"
|
|
17
|
+
"clipping_range": (19531, 40903),
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
top_camera = {
|
|
21
21
|
"pos": (7760, -31645, -5943),
|
|
22
22
|
"viewup": (-1, 0, 0),
|
|
23
|
-
"
|
|
23
|
+
"clipping_range": (27262, 45988),
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
top_side_camera = {
|
|
27
27
|
"pos": (4405, -31597, -5411),
|
|
28
28
|
"viewup": (0, 0, -1),
|
|
29
|
-
"
|
|
29
|
+
"clipping_range": (26892, 46454),
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
three_quarters_camera = {
|
|
33
33
|
"pos": (-20169, -7298, 14832),
|
|
34
34
|
"viewup": (0, -1, 0),
|
|
35
|
-
"
|
|
35
|
+
"clipping_range": (16955, 58963),
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
cameras = dict(
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
from pathlib import Path
|
|
3
3
|
|
|
4
|
-
import matplotlib.pyplot as plt
|
|
5
4
|
import numpy as np
|
|
6
5
|
from loguru import logger
|
|
7
6
|
from myterial import amber, deep_purple_light, orange, teal
|
|
@@ -55,7 +54,7 @@ class Render:
|
|
|
55
54
|
title="brainrender",
|
|
56
55
|
bg=settings.BACKGROUND_COLOR,
|
|
57
56
|
offscreen=settings.OFFSCREEN,
|
|
58
|
-
size="full" if settings.WHOLE_SCREEN else
|
|
57
|
+
size="full" if settings.WHOLE_SCREEN else (1600, 1200),
|
|
59
58
|
)
|
|
60
59
|
|
|
61
60
|
self.plotter.keyPressFunction = self.keypress
|
|
@@ -135,6 +134,9 @@ class Render:
|
|
|
135
134
|
if isinstance(actor._mesh, VedoVolume):
|
|
136
135
|
actor._mesh.permute_axes(2, 1, 0)
|
|
137
136
|
actor._mesh.apply_transform(mtx, True)
|
|
137
|
+
actor._mesh.transform = (
|
|
138
|
+
None # otherwise it gets applied twice
|
|
139
|
+
)
|
|
138
140
|
elif actor.br_class in ["None", "Gene Data"]:
|
|
139
141
|
actor._mesh.apply_transform(mtx_swap_x_z)
|
|
140
142
|
actor._mesh.apply_transform(mtx)
|
|
@@ -153,7 +155,6 @@ class Render:
|
|
|
153
155
|
logger.debug(
|
|
154
156
|
f'Failed to reverse actor: "{actor.name} (type: {actor.br_class})"'
|
|
155
157
|
)
|
|
156
|
-
pass
|
|
157
158
|
actor._is_transformed = True
|
|
158
159
|
|
|
159
160
|
# Add silhouette and labels
|
|
@@ -224,8 +225,8 @@ class Render:
|
|
|
224
225
|
else:
|
|
225
226
|
camera = check_camera_param(camera)
|
|
226
227
|
|
|
227
|
-
if "
|
|
228
|
-
camera["
|
|
228
|
+
if "focal_point" not in camera.keys() or camera["focal_point"] is None:
|
|
229
|
+
camera["focal_point"] = self.root._mesh.center_of_mass()
|
|
229
230
|
|
|
230
231
|
if not self.backend and camera is not None:
|
|
231
232
|
camera = set_camera(self, camera)
|
|
@@ -290,7 +291,7 @@ class Render:
|
|
|
290
291
|
)
|
|
291
292
|
|
|
292
293
|
def close(self):
|
|
293
|
-
|
|
294
|
+
self.plotter.close()
|
|
294
295
|
|
|
295
296
|
def export(self, savepath):
|
|
296
297
|
"""
|
|
@@ -362,7 +363,7 @@ class Render:
|
|
|
362
363
|
def _print_camera(self):
|
|
363
364
|
pms = get_camera_params(scene=self)
|
|
364
365
|
|
|
365
|
-
focal = pms.pop("
|
|
366
|
+
focal = pms.pop("focal_point", None)
|
|
366
367
|
dst = pms.pop("distance", None)
|
|
367
368
|
|
|
368
369
|
names = [
|
|
@@ -375,7 +376,7 @@ class Render:
|
|
|
375
376
|
*names,
|
|
376
377
|
f"[{orange}] }}",
|
|
377
378
|
f"[{deep_purple_light}]Additional, (optional) parameters:",
|
|
378
|
-
f"[green bold] '
|
|
379
|
+
f"[green bold] 'focal_point'[/green bold]: [{amber}]{focal},",
|
|
379
380
|
f"[green bold] 'distance'[/green bold]: [{amber}]{dst},",
|
|
380
381
|
sep="\n",
|
|
381
382
|
)
|
|
@@ -390,7 +391,7 @@ class Render:
|
|
|
390
391
|
if key == "s":
|
|
391
392
|
self.screenshot()
|
|
392
393
|
|
|
393
|
-
elif key
|
|
394
|
+
elif key in ("q", "Esc"):
|
|
394
395
|
self.close()
|
|
395
396
|
|
|
396
397
|
elif key == "c":
|
|
@@ -70,9 +70,7 @@ class Scene(JupyterMixIn, Render):
|
|
|
70
70
|
"root",
|
|
71
71
|
alpha=settings.ROOT_ALPHA,
|
|
72
72
|
color=settings.ROOT_COLOR,
|
|
73
|
-
silhouette=
|
|
74
|
-
if root and settings.SHADER_STYLE == "cartoon"
|
|
75
|
-
else False,
|
|
73
|
+
silhouette=bool(root and settings.SHADER_STYLE == "cartoon"),
|
|
76
74
|
)
|
|
77
75
|
self.atlas.root = self.root # give atlas access to root
|
|
78
76
|
self._root_mesh = self.root.mesh.clone()
|
|
@@ -108,7 +106,7 @@ class Scene(JupyterMixIn, Render):
|
|
|
108
106
|
Creates a small inset showing the brain's orientation
|
|
109
107
|
"""
|
|
110
108
|
if settings.OFFSCREEN:
|
|
111
|
-
return
|
|
109
|
+
return
|
|
112
110
|
|
|
113
111
|
inset = self._root_mesh.clone()
|
|
114
112
|
inset.alpha(1) # scale(0.5)
|
|
@@ -401,7 +399,7 @@ class Scene(JupyterMixIn, Render):
|
|
|
401
399
|
f"[bold][{amber}]- {act.name}[/bold][{orange_darker}] (type: [{orange}]{act.br_class}[/{orange}])"
|
|
402
400
|
)
|
|
403
401
|
|
|
404
|
-
if "win32"
|
|
402
|
+
if sys.platform != "win32":
|
|
405
403
|
actors.print()
|
|
406
404
|
else:
|
|
407
405
|
print(pi.utils.stringify(actors, maxlen=-1))
|
|
@@ -17,8 +17,6 @@ vsettings.max_number_of_peels = 12
|
|
|
17
17
|
vsettings.occlusion_ratio = 0.1
|
|
18
18
|
vsettings.multi_samples = 0 if sys.platform == "darwin" else 8
|
|
19
19
|
|
|
20
|
-
# vsettings.useSSAO = True
|
|
21
|
-
|
|
22
20
|
# For transparent background with screenshots
|
|
23
21
|
vsettings.screenshot_transparent_background = False # vedo for transparent bg
|
|
24
22
|
vsettings.use_fxaa = False
|
|
@@ -36,5 +34,5 @@ ROOT_ALPHA = 0.2 # transparency of the overall brain model's actor'
|
|
|
36
34
|
SCREENSHOT_SCALE = 1
|
|
37
35
|
SHADER_STYLE = "cartoon" # affects the look of rendered brain regions: [metallic, plastic, shiny, glossy]
|
|
38
36
|
SHOW_AXES = True
|
|
39
|
-
WHOLE_SCREEN =
|
|
37
|
+
WHOLE_SCREEN = False # If true render window is full screen
|
|
40
38
|
OFFSCREEN = False
|
|
@@ -200,6 +200,10 @@ class Animation(VideoMaker):
|
|
|
200
200
|
self.keyframes[0] = dict( # make sure first frame is a keyframe
|
|
201
201
|
zoom=None, camera=None, callback=None
|
|
202
202
|
)
|
|
203
|
+
self.keyframes_numbers = 0
|
|
204
|
+
self.nframes = 0
|
|
205
|
+
self.last_keyframe = 0
|
|
206
|
+
self.segment_fact = 0
|
|
203
207
|
|
|
204
208
|
def add_keyframe(
|
|
205
209
|
self,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: brainrender
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.2
|
|
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
|
|
@@ -23,14 +23,14 @@ Description-Content-Type: text/markdown
|
|
|
23
23
|
License-File: LICENSE
|
|
24
24
|
Requires-Dist: numpy
|
|
25
25
|
Requires-Dist: pandas
|
|
26
|
-
Requires-Dist: h5py
|
|
26
|
+
Requires-Dist: h5py
|
|
27
27
|
Requires-Dist: vedo>=2023.5.0
|
|
28
28
|
Requires-Dist: k3d
|
|
29
29
|
Requires-Dist: imio
|
|
30
30
|
Requires-Dist: msgpack
|
|
31
31
|
Requires-Dist: pyyaml>=5.3
|
|
32
32
|
Requires-Dist: pooch
|
|
33
|
-
Requires-Dist: morphapi>=0.1
|
|
33
|
+
Requires-Dist: morphapi>=0.2.1
|
|
34
34
|
Requires-Dist: requests
|
|
35
35
|
Requires-Dist: bg-atlasapi>=1.0.0
|
|
36
36
|
Requires-Dist: tables
|
|
@@ -67,7 +67,7 @@ Requires-Dist: PyQt5; extra == "pyqt5"
|
|
|
67
67
|
|
|
68
68
|
[](https://pypi.org/project/brainrender)
|
|
69
69
|
[](https://pypi.org/project/brainrender)
|
|
70
|
-
[](https://github.com/brainglobe/brainrender/actions)
|
|
71
71
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
|
72
72
|
[](https://coveralls.io/github/brainglobe/brainrender)
|
|
73
73
|
[](https://github.com/python/black)
|
|
@@ -9,14 +9,14 @@ dynamic = ["version"]
|
|
|
9
9
|
dependencies = [
|
|
10
10
|
"numpy",
|
|
11
11
|
"pandas",
|
|
12
|
-
"h5py
|
|
12
|
+
"h5py",
|
|
13
13
|
"vedo>=2023.5.0",
|
|
14
14
|
"k3d",
|
|
15
15
|
"imio",
|
|
16
16
|
"msgpack",
|
|
17
17
|
"pyyaml>=5.3",
|
|
18
18
|
"pooch",
|
|
19
|
-
"morphapi>=0.1
|
|
19
|
+
"morphapi>=0.2.1",
|
|
20
20
|
"requests",
|
|
21
21
|
"bg-atlasapi>=1.0.0",
|
|
22
22
|
"tables",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{brainrender-2.1.0 → brainrender-2.1.2}/brainrender/atlas_specific/allen_brain_atlas/streamlines.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|