Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 17, 2024
1 parent d7ab457 commit 4663c1f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
46 changes: 23 additions & 23 deletions examples/line.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import vedo
vedo.settings.default_backend= 'vtk'

vedo.settings.default_backend = "vtk"

from brainrender import Scene
from brainrender.actors import Points, Line
Expand All @@ -12,32 +13,31 @@
scene.add_brain_region(688, alpha=0.2, color="green")

# Add two points identifying the positions of two cortical neurons.
point_coordinates = np.array([
[4575, 5050, 9750],
[4275, 2775, 6100]
])
point_coordinates = np.array([[4575, 5050, 9750], [4275, 2775, 6100]])

scene.add(Points(point_coordinates, radius=100, colors="blue"))

# Display the shortest path within cortex boundaries between the two points.
path_coordinates = np.array([
[4575, 5050, 9750],
[4575, 4800, 9500],
[4575, 4550, 9250],
[4575, 4300, 9000],
[4575, 4050, 8750],
[4350, 3800, 8500],
[4225, 3550, 8250],
[4200, 3300, 8000],
[4200, 3100, 7750],
[4200, 2950, 7500],
[4200, 2800, 7250],
[4200, 2700, 7000],
[4200, 2650, 6750],
[4200, 2650, 6500],
[4200, 2650, 6250],
[4275, 2775, 6100],
])
path_coordinates = np.array(
[
[4575, 5050, 9750],
[4575, 4800, 9500],
[4575, 4550, 9250],
[4575, 4300, 9000],
[4575, 4050, 8750],
[4350, 3800, 8500],
[4225, 3550, 8250],
[4200, 3300, 8000],
[4200, 3100, 7750],
[4200, 2950, 7500],
[4200, 2800, 7250],
[4200, 2700, 7000],
[4200, 2650, 6750],
[4200, 2650, 6500],
[4200, 2650, 6250],
[4275, 2775, 6100],
]
)

scene.add(Line(path_coordinates, linewidth=3, color="black"))

Expand Down
13 changes: 8 additions & 5 deletions tests/test_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
from brainrender.actor import Actor
from brainrender.actors import Line


def test_line():
s = Scene()

line = Line(
np.array([
[0, 0, 0],
[1, 1, 1],
[2, 2, 2],
])
np.array(
[
[0, 0, 0],
[1, 1, 1],
[2, 2, 2],
]
)
)

s.add(line)
Expand Down

0 comments on commit 4663c1f

Please sign in to comment.