-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* example to show probe tracks * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Standardise script --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Adam Tyson <[email protected]>
- Loading branch information
1 parent
874c24d
commit 52b1ec0
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
""" | ||
This example visualizes `.npy` files exported from brainglobe-segmentation | ||
""" | ||
|
||
from pathlib import Path | ||
import numpy as np | ||
|
||
from brainrender import Scene | ||
from brainrender.actors import Points | ||
|
||
data_path = Path(__file__).parent.parent / "brainrender" / "resources" | ||
|
||
scene = Scene(title="Silicon Probe Visualization") | ||
|
||
# Visualise the probe target regions | ||
cp = scene.add_brain_region("CP", alpha=0.15) | ||
rsp = scene.add_brain_region("RSP", alpha=0.15) | ||
|
||
# Add probes to the scene. | ||
# Each .npy file should contain a numpy array with the coordinates of each | ||
# part of the probe. | ||
scene.add( | ||
Points( | ||
np.load(data_path / "probe_1_striatum.npy"), | ||
name="probe_1", | ||
colors="darkred", | ||
radius=50, | ||
) | ||
) | ||
scene.add( | ||
Points( | ||
np.load(data_path / "probe_2_RSP.npy"), | ||
name="probe_2", | ||
colors="darkred", | ||
radius=50, | ||
) | ||
) | ||
|
||
# render | ||
scene.render() |