diff --git a/brainglobe_utils/brainmapper/export.py b/brainglobe_utils/brainmapper/export.py new file mode 100644 index 0000000..4a14fff --- /dev/null +++ b/brainglobe_utils/brainmapper/export.py @@ -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) \ No newline at end of file