Skip to content

Commit 2fb2bf4

Browse files
committed
Fix code examples in readme
1 parent e9d6cf2 commit 2fb2bf4

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

README.md

+13-17
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ The starting point for a heatmap visualization is a `dict` assigning scalar valu
1818
For example:
1919

2020
```python
21-
regions = dict( # scalar values for each region
22-
TH=1,
23-
RSP=0.2,
24-
AI=0.4,
25-
SS=-3,
26-
MO=2.6,
27-
...
28-
)
21+
values = dict( # scalar values for each region
22+
TH=1,
23+
RSP=0.2,
24+
AI=0.4,
25+
SS=-3,
26+
MO=2.6,
27+
...
28+
)
2929
```
3030

3131
`brainglobe-heatmap` creates a brainrender 3D `Scene` with the given regions colored according the values in the dictionary.
@@ -55,7 +55,7 @@ import brainglobe_heatmap as bgh
5555

5656

5757
planner = bgh.plan(
58-
regions,
58+
values,
5959
position=(
6060
8000,
6161
5000,
@@ -102,7 +102,6 @@ f = bgh.Heatmap(
102102
Once happy with the position of the slicing planes, creating a visualization is as simple as:
103103

104104
```python
105-
106105
bgh.Heatmap(
107106
values,
108107
position=(
@@ -115,7 +114,7 @@ bgh.Heatmap(
115114
title="horizontal view",
116115
vmin=-5,
117116
vmax=3,
118-
cmap='Red',
117+
cmap='Reds',
119118
format="2D",
120119
).show()
121120
```
@@ -127,11 +126,9 @@ You can use `brainglobe-heatmap` to get the coordinates of the 2D 'slices' (in t
127126

128127

129128
```python
130-
131129
regions = ['TH', 'RSP', 'AI', 'SS', 'MO', 'PVZ', 'LZ', 'VIS', 'AUD', 'RHP', 'STR', 'CB', 'FRP', 'HIP', 'PA']
132130

133-
134-
coordinates = bgh.get_plane_coordinates(
131+
coordinates = bgh.get_structures_slice_coords(
135132
regions,
136133
position=(
137134
8000,
@@ -144,7 +141,7 @@ coordinates = bgh.get_plane_coordinates(
144141

145142
## Using `brainglobe-heatmap` with other atlases.
146143

147-
`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!
144+
`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!
148145
For more information see the API's [documentation](https://brainglobe.info/documentation/brainglobe-atlasapi/index.html).
149146

150147
## Seeking help or contributing
@@ -154,7 +151,7 @@ We are always happy to help users of our tools, and welcome any contributions. I
154151
If you use `brainglobe-heatmap` in your work, please cite it as:
155152

156153
```
157-
Federico Claudi, & Luigi Petrucco. (2022). brainglobe/bg-heatmaps: (V0.2). Zenodo. https://doi.org/10.5281/zenodo.5891814
154+
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
158155
```
159156

160157
If you use `brainrender` via `brainglobe-heatmap` (i.e. for 3D visualisation), please also cite it:
@@ -176,5 +173,4 @@ title = {{Visualizing anatomically registered data with brainrender}},
176173
volume = {10},
177174
year = {2021}
178175
}
179-
180176
```

0 commit comments

Comments
 (0)