brainglobe / brainglobe-heatmap

Rendering anatomical heatmaps with brainrender and matplotlib
https://brainglobe.info
MIT License
34 stars 10 forks source link

Human brain plots won't work #14

Closed jonrot1906 closed 5 months ago

jonrot1906 commented 1 year ago

Describe the bug While creating plots for zebrafish and mice brains works perfectly for me, using bg-heatmaps with the "allen_human_500um" is an actual challenge. I only get a thin bar as results, but no plotted brain slice. Can you provide some info on how to use bg-heatmaps with the human bran atlas? Are there any differences?

To Reproduce


values = dict(  # scalar values for each region
    Mo=1,
    PrCG=0.2,
    OccL=0.4,
    FroL=-3,
    ITG=2.6,
    HiF=-4,
)

f = bgh.heatmap(
    values,
    position=10,
    orientation="horizontal",  # 'frontal' or 'sagittal', or 'horizontal' or a tuple (x,y,z)
    thickness=500,
    atlas_name="allen_human_500um",
    format="2D",
    title="human brain heatmap",
).show(xlabel="AP (μm)", ylabel="DV (μm)")

Screenshots

Bildschirmfoto 2023-05-13 um 15 54 48

adamltyson commented 11 months ago

Hi @jonrot1906 sorry for the delay responding to this. I can reproduce, and we'll look into the problem.

adamltyson commented 5 months ago

Hi @jonrot1906, sorry this took so long for me to look into!

The problem seems to just be that the scale of the human atlas is so different to the other animal model atlases that the scale of the position needs to be much larger (it's in microns).

I've added an example script now in #40, but for ease, it's here:

import brainglobe_heatmap as bgh

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

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

This produces: human_brain

N.B. The newest version of this atlas in BrainGlobe contains both hemispheres, so if you want to only plot one hemisphere, you'll have to use the hemisphere parameter.