-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
624eca2
commit 09fec95
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
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,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) |