Last active
August 29, 2025 12:45
-
-
Save adamltyson/6eea1da2a29d8eee15aa18bf1b55cdda to your computer and use it in GitHub Desktop.
Visualise blackcap traced cells alongside injection site
This file contains hidden or 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
| from pathlib import Path | |
| from brainrender.scene import Scene | |
| from brainrender.actors import Points, Cylinder | |
| from brainrender import settings | |
| from myterial import indigo_darker, light_green, amber, salmon, blue_light, green | |
| settings.SHADER_STYLE = "plastic" | |
| settings.SHOW_AXES = False | |
| cells_path = Path("/Users/adamtyson/UCL Dropbox/Adam Tyson/AT/data_analysis/blackcap_analysis/2024-11-25/brainmapper") / "points.npy" | |
| # Create a brainrender scene | |
| scene = Scene(atlas_name="oldenburg_blackcap_25um", inset=False) | |
| # Create points actor & add cells | |
| cells = Points(cells_path, radius=25, colors=blue_light, alpha=0.9) | |
| scene.add(cells) | |
| # Add "top" brain regions | |
| scene.add_brain_region("H", color=green, alpha=0.2) | |
| scene.add_brain_region("HP", color=amber, alpha=0.2) | |
| scene.add_brain_region("M", color=salmon, alpha=0.2) | |
| # Coordinate picked in image, then multipled by 25 to get into micron space | |
| coords = [3000, 1825, 8575] | |
| injection_cylinder = Cylinder( | |
| coords, # center the cylinder at the center of mass of th | |
| scene.root, | |
| radius=100 | |
| ) | |
| scene.add(injection_cylinder) | |
| scene.render() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment