Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add human example script and some other fixes #40

Merged
merged 9 commits into from
May 21, 2024
39 changes: 1 addition & 38 deletions brainglobe_heatmap/heatmaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def check_values(values: dict, atlas: Atlas) -> Tuple[float, float]:
class heatmap:
def __init__(
self,
values: Dict[str, float],
values: Dict,
position: Union[list, tuple, np.ndarray],
orientation: Union[str, tuple] = "frontal",
hemisphere: str = "both",
Expand Down Expand Up @@ -253,40 +253,3 @@ def plot(
plt.show()

return f


if __name__ == "__main__":
values = dict( # scalar values for each region
TH=1,
RSP=0.2,
AI=0.4,
SS=-3,
MO=2.6,
PVZ=-4,
LZ=-3,
VIS=2,
AUD=0.3,
RHP=-0.2,
STR=0.5,
CB=0.5,
FRP=-1.7,
HIP=3,
PA=-4,
)

heatmap(
values,
position=None,
# or 'sagittal', or 'horizontal' or a tuple (x,y,z)
orientation=(
1,
1,
0,
),
# thickness of the slices used for rendering (in microns)
thickness=250,
title="frontal",
vmin=-5,
vmax=3,
format="3D",
).show()
19 changes: 19 additions & 0 deletions examples/heatmap_human_brain.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
This example shows how to generate a heatmap with the `allen_human_500um`
human brain atlas.

N.B. the physical scales are very different to e.g. the small animal atlases.
"""

import brainglobe_heatmap as bgh

values = dict(SFG=1, PrCG=2, Ca=4, Pu=10) # scalar values for each region


scene = bgh.heatmap(
values,
position=(100000, 100000, 100000),
thickness=1000,
atlas_name="allen_human_500um",
format="2D",
).show()
File renamed without changes.
Loading