Skip to content

Commit

Permalink
deploy: f992318
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrofelder committed Nov 12, 2024
1 parent 30dac42 commit dd521cc
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 45 deletions.
58 changes: 36 additions & 22 deletions _sources/documentation/brainglobe-heatmap/index.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ The starting point for a heatmap visualization is a `dict` assigning scalar valu
For example:

```python
regions = dict( # scalar values for each region
TH=1,
RSP=0.2,
AI=0.4,
SS=-3,
MO=2.6,
...
)
values = dict( # scalar values for each region
TH=1,
RSP=0.2,
AI=0.4,
SS=-3,
MO=2.6,
...
)
```

`brainglobe-heatmap` creates a brainrender 3D `Scene` with the given regions colored according the values in the dictionary.
Expand Down Expand Up @@ -56,9 +56,8 @@ In `examples/plan.py` there's an example showing how to use the `planner`:
```python
import brainglobe_heatmap as bgh


planner = bgh.plan(
regions,
values,
position=(
8000,
5000,
Expand All @@ -74,7 +73,7 @@ The position of the center of the plane is given by a set of `(x, y, z)` coordin
When using one of the named orientations, you don't need to pass a whole set of `(x, y, z)` coordinates for the plane center. A single value is sufficient as the other two won't affect the plane position:

```python
f = bgh.heatmap(
f = bgh.Heatmap(
values,
position=1000,
orientation="sagittal", # 'frontal' or 'sagittal', or 'horizontal' or a tuple (x,y,z)
Expand All @@ -88,7 +87,7 @@ f = bgh.heatmap(
Also, you can create a slice with a plane centered in the brain by passing `position=None`:

```python
f = bgh.heatmap(
f = bgh.Heatmap(
values,
position=None,
orientation="sagittal", # 'frontal' or 'sagittal', or 'horizontal' or a tuple (x,y,z)
Expand All @@ -104,8 +103,7 @@ f = bgh.heatmap(
Once happy with the position of the slicing planes, creating a visualization is as simple as:

```python

bgh.heatmap(
bgh.Heatmap(
values,
position=(
8000,
Expand All @@ -116,7 +114,7 @@ bgh.heatmap(
title="horizontal view",
vmin=-5,
vmax=3,
cmap='Red',
cmap='Reds',
format="2D",
).show()
```
Expand All @@ -128,11 +126,9 @@ Here, `format` specifies if a 2D plot should be made (using `matplotlib`) or a 3
You can use `brainglobe-heatmap` to get the coordinates of the 2D 'slices' (in the 2D plane's coordinates system):

```python

regions = ['TH', 'RSP', 'AI', 'SS', 'MO', 'PVZ', 'LZ', 'VIS', 'AUD', 'RHP', 'STR', 'CB', 'FRP', 'HIP', 'PA']


coordinates = bgh.get_plane_coordinates(
coordinates = bgh.get_structures_slice_coords(
regions,
position=(
8000,
Expand All @@ -145,19 +141,37 @@ coordinates = bgh.get_plane_coordinates(

## Using `brainglobe-heatmap` with other atlases

`brainglobe-heatmap` uses `brainrender` which, in turn, uses brainglobe's `Atlas API` under the hood. That means that all of `brainglobe-heatmap`'s functionality is compatible with any of the atlases supported by the atlas API. `bgh.heatmap`, `bgh.planner` and `bgh.get_plane_coordinates` all accept a `atlas_name` argument, pass the name of the atlas name you'd like to use!
`brainglobe-heatmap` uses `brainrender` which, in turn, uses brainglobe's `Atlas API` under the hood. That means that all of `brainglobe-heatmap`'s functionality is compatible with any of the atlases supported by the atlas API. `bgh.Heatmap`, `bgh.planner` and `bgh.get_structures_slice_coords` all accept a `atlas_name` argument, pass the name of the atlas name you'd like to use!
For more information see the API's [documentation](../brainglobe-atlasapi/index.md).

## Contributing

Contributions to `brainglobe-heatmap` are more than welcome. Please see the [Developer's guide](https://github.com/brainglobe/.github/blob/main/CONTRIBUTING.md).

## Citing `brainglobe-heatmap`

If you use `brainglobe-heatmap` in your work, please cite it as:

```
Federico Claudi, & Luigi Petrucco. (2022). brainglobe/bg-heatmaps: (V0.2). Zenodo. https://doi.org/10.5281/zenodo.5891814
Federico Claudi, Adam Tyson, Luigi Petrucco, Mathieu Bourdenx, carlocastoldi, Rami Hamati, & Alessandro Felder. (2024). brainglobe/brainglobe-heatmap. Zenodo. https://doi.org/10.5281/zenodo.10375287
```

If you use `brainrender` via `brainglobe-heatmap` (i.e. for 3D visualisation), please also cite it:
```
Claudi, F., Tyson, A. L., Petrucco, L., Margrie, T.W., Portugues, R., Branco, T. (2021) "Visualizing anatomically registered data with Brainrender&quot; <i>eLife</i> 2021;10:e65751 [doi.org/10.7554/eLife.65751](https://doi.org/10.7554/eLife.65751)
```

`brainglobe-heatmap` was originally developed by Federico Claudi and Luigi Petrucco, with the help of Marco Musy (the developer of [`vedo`](https://github.com/marcomusy/vedo))
BibTeX:

``` bibtex
@article{Claudi2021,
author = {Claudi, Federico and Tyson, Adam L. and Petrucco, Luigi and Margrie, Troy W. and Portugues, Ruben and Branco, Tiago},
doi = {10.7554/eLife.65751},
issn = {2050084X},
journal = {eLife},
pages = {1--16},
pmid = {33739286},
title = {{Visualizing anatomically registered data with brainrender}},
volume = {10},
year = {2021}
}
```
Loading

0 comments on commit dd521cc

Please sign in to comment.