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

minor doc improvements/additions #204

Merged
merged 4 commits into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ Do not use 0 (zero) as the id of a structure, because the annotation stack will

## How to generate an atlas programmatically?

**Atlas generation takes place in two steps:**

1. Generate an “Atlas script” written in python
2. Use the atlas generation code [available from BrainGlobe](https:/brainglobe/brainglobe-atlasapi/tree/main/brainglobe_atlasapi/atlas_generation/)
3. to generate the atlas from the atlas script.
Each BrainGlobe atlas is generated by its custom atlas script, written in Python. Reusable functionality for atlas generation is [available from BrainGlobe](https:/brainglobe/brainglobe-atlasapi/tree/main/brainglobe_atlasapi/atlas_generation/), such as the `create_region_mesh` function. To use this functionality in your Python virtual (`conda`) environment, install `brainglobe-atlasapi` with optional dependencies `[dev, atlasgen]`.

### Atlas scripts

Expand Down Expand Up @@ -110,11 +106,11 @@ of each brain region
### Atlas generation

Once an atlas script has been written which sets out all the necessary metadata and loads all the files required,
code provided by BrainGlobe’s atlas generation repository can be used to format the data as needed by the BrainGlobe
AtlasAPI. Atlasgen provides one convenient function `wrapup_atlas_from_data` which takes all the metadata and data
code provided by BrainGlobe’s atlas generation submodule can be used to format the data as needed by the BrainGlobe
AtlasAPI. The atlas generation submodule provides one convenient function `wrapup_atlas_from_data` which takes all the metadata and data
from above and creates the data structures required. These data structures include .tiff files with the various images,
csv files with the structures metadata information, a README file laying out the atlas content, etc. The same function
creates a compressed folder which can be loaded to GIN for distribution (see above).
creates a compressed folder which can be uploaded to GIN for distribution (see above).

### Extracting meshes

Expand Down Expand Up @@ -154,7 +150,29 @@ inspect_meshes_folder("~/.brainglobe/temp/allen_mouse_10um_v1.0/meshes")
```

Once an atlas is created with BrainGlobe’s atlas generation tools, it can be used with most software from the BrainGlobe software suite.
This includes [brainrender](/documentation/brainrender/index) which provides a convenient GUI for visually inspecting the generated atlas meshes.
These include [brainrender](/documentation/brainrender/index) and [brainrender-napari](/tutorials/visualise-atlas-napari) which provide a convenient way to visually inspect the generated atlas meshes.

For example, you can visualise various parts of the Max Planck Zebrafish Brain Atlas next to each other by running the script below. You can do the same with your own newly-packaged atlas (or any other BrainGlobe atlas) by replacing as explained in the comments.

```python
from brainrender_napari.napari_atlas_representation import NapariAtlasRepresentation
from brainglobe_atlasapi import BrainGlobeAtlas
import napari

if __name__ == "__main__":
viewer = napari.Viewer()
viewer.dims.ndisplay = 3
# replace "mpin_zfish_1um" with atlas of interest below
napari_atlas = NapariAtlasRepresentation(BrainGlobeAtlas("mpin_zfish_1um"), viewer)
napari_atlas.add_to_viewer()

# replace "GADb1" with name of additional reference for your atlas (if it has any)
napari_atlas.add_additional_reference("GADb1")

# replace "root" with acronym of structure of interest below
napari_atlas.add_structure_to_viewer("<structure_id>")
napari.run()
```

## Uploading the atlas

Expand Down