Skip to content

Commit

Permalink
Add brainrender export
Browse files Browse the repository at this point in the history
  • Loading branch information
adamltyson committed Jan 8, 2024
1 parent 624eca2 commit 09fec95
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions brainglobe_utils/brainmapper/export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import numpy as np
from typing import Union
from pathlib import Path

def export_points_to_brainrender(
points: np.ndarray,
resolution: float,
output_filename: Union[str, Path],
) -> None:
"""
Export points in atlas space for visualization in brainrender.
Points are scaled from atlas coordinates to real units and saved
as a numpy file.
Parameters
----------
points : np.ndarray
A numpy array containing the points in atlas space.
resolution : float
A numerical value representing the resolution scale to be
applied to the points.
output_filename : Union[str, Path]
The path where the numpy file will be saved. Can be a string
or a Path object.
Returns
-------
None
"""
np.save(output_filename, points * resolution)

0 comments on commit 09fec95

Please sign in to comment.