Skip to content

Commit

Permalink
Merge pull request #66 from brainglobe/readme-updates
Browse files Browse the repository at this point in the history
Fix code examples in readme
  • Loading branch information
alessandrofelder authored Nov 12, 2024
2 parents e9d6cf2 + 2fb2bf4 commit 476cd79
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,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 @@ -55,7 +55,7 @@ import brainglobe_heatmap as bgh


planner = bgh.plan(
regions,
values,
position=(
8000,
5000,
Expand Down Expand Up @@ -102,7 +102,6 @@ f = bgh.Heatmap(
Once happy with the position of the slicing planes, creating a visualization is as simple as:

```python

bgh.Heatmap(
values,
position=(
Expand All @@ -115,7 +114,7 @@ bgh.Heatmap(
title="horizontal view",
vmin=-5,
vmax=3,
cmap='Red',
cmap='Reds',
format="2D",
).show()
```
Expand All @@ -127,11 +126,9 @@ You can use `brainglobe-heatmap` to get the coordinates of the 2D 'slices' (in t


```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 @@ -144,7 +141,7 @@ 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](https://brainglobe.info/documentation/brainglobe-atlasapi/index.html).

## Seeking help or contributing
Expand All @@ -154,7 +151,7 @@ We are always happy to help users of our tools, and welcome any contributions. I
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:
Expand All @@ -176,5 +173,4 @@ title = {{Visualizing anatomically registered data with brainrender}},
volume = {10},
year = {2021}
}
```

0 comments on commit 476cd79

Please sign in to comment.