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

Merge with atlasgen #199

Merged
merged 119 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
636d801
Initial commit
vigji Sep 2, 2020
f06c2d5
Update README.md
vigji Sep 2, 2020
c42e115
First commit
vigji Sep 2, 2020
8173167
gitignore
vigji Sep 2, 2020
921c007
Almost at complete atlas autogeneration
vigji Sep 2, 2020
6ca9c7e
Finalized script for automatic atlas generation
vigji Sep 3, 2020
461820f
Added template script for atlas generation
vigji Sep 3, 2020
b42ea88
Template description
vigji Sep 3, 2020
e6c7ed6
First working version of script for auto deployment
vigji Sep 3, 2020
252f806
Fixed metadata link
vigji Sep 3, 2020
24c9e8a
Trying to fix windows permission error when deleting folders
vigji Sep 4, 2020
2fcf04f
add 50um to allen mouse
adamltyson Sep 4, 2020
b05c2db
Merge pull request #1 from brainglobe/add_res
adamltyson Sep 4, 2020
97e4d1c
v1.2 for allen mouse
vigji Oct 21, 2020
375a03c
blacked
vigji Oct 21, 2020
bc32f7f
Update requirements
adamltyson Oct 23, 2020
6132575
vtkplotter -> vedo
adamltyson Oct 23, 2020
2bcd6f3
Format with black
adamltyson Oct 23, 2020
dfcadc8
Update kim mouse atlas generation
adamltyson Oct 23, 2020
c0cbf69
Improve downsampling
adamltyson Oct 23, 2020
1c63191
revert roations
adamltyson Oct 23, 2020
e821b8d
add kim to main script
adamltyson Oct 23, 2020
2d82ad7
rotate annotation volume for meshes
adamltyson Oct 26, 2020
837cff9
Merge pull request #2 from brainglobe/kim_atlas
adamltyson Oct 26, 2020
2c0962f
add osten mouse atlas
adamltyson Dec 3, 2020
86caab9
Merge pull request #3 from brainglobe/osten_atlas
adamltyson Dec 4, 2020
4264649
Added function for creating intermediate hierarchy structures masks
vigji Jun 30, 2021
068d04e
Merge branch 'master' of https://github.com/brainglobe/bg-atlasgen
vigji Jun 30, 2021
bc7518d
Fix extract_largest_region and compare_mesh_volume
MathieuBo Jul 21, 2021
f944baa
Merge pull request #7 from MathieuBo/fix-mesh-utils
adamltyson Jul 31, 2021
370dfb0
reformat with black
adamltyson Aug 6, 2021
707905a
save additional metadata
adamltyson Aug 6, 2021
fb22377
consistent syntax for empty dict
adamltyson Aug 10, 2021
56b2e00
Update docstring
adamltyson Aug 10, 2021
7c0c4bf
Add atlas packager metadata
adamltyson Aug 10, 2021
8140a82
python 3.8 compatibility
adamltyson Aug 10, 2021
547b3e6
Merge pull request #9 from adamltyson/metadata
adamltyson Aug 12, 2021
9612e91
Add mouse spinal cord atlas
adamltyson Aug 12, 2021
f37ee5d
Merge pull request #10 from MetaCell/cord-atlas
adamltyson Aug 27, 2021
19ef461
add WHS SD Rat atlas
bkntr Oct 31, 2021
f9e1d85
add xmltodict to requirements.txt
bkntr Nov 4, 2021
79a6446
remove structures that are missing from annotation volume
bkntr Nov 7, 2021
ca31ce7
remove structures that are missing from annotation volume
bkntr Nov 7, 2021
2e44cca
Fixed vedo Slicer import issue
kailynkfields Nov 9, 2021
3276068
Update mesh_utils.py
kailynkfields Nov 9, 2021
016c4ff
Merge branch 'brainglobe:master' into master
kailynkfields Nov 9, 2021
55f52d4
Create azba_zfish.py
kailynkfields Nov 19, 2021
05f043e
Merge pull request #12 from bkntr/master
adamltyson Nov 21, 2021
53e23db
Standardise temporary output directory
adamltyson Nov 21, 2021
844592b
add [allenmouse] extra dependency (#17)
adamltyson Nov 26, 2021
74b08ee
Allow multiple downloads at once, updated citation
kailynkfields Nov 30, 2021
cda0d3e
Merge pull request #14 from kailynkfields/master
vigji Dec 1, 2021
4384efb
Mesh cleaning improvements (#15)
FedeClaudi Jan 19, 2022
4b6f765
Update azba_zfish.py
kailynkfields Jan 28, 2022
670b214
Merge pull request #19 from kailynkfields/patch-1
vigji Jan 31, 2022
d6ac454
some fixes for mpin atlas
vigji Feb 9, 2022
51c79dc
Merge pull request #20 from brainglobe/improved-mpin
vigji Feb 10, 2022
eea5259
Fix tiny typo (#22)
adamltyson May 30, 2022
2e4320b
Update README.md
adamltyson May 31, 2022
fcd5f87
Add lsfm atlas script (#18)
Gubra-ApS May 31, 2022
7530600
Update requirements.txt
adamltyson May 31, 2022
6e2f8c7
Add ADMBA 3D developing mouse atlases (#25)
yoda-vid Jul 1, 2022
c9d090d
Add script for the Princeton mouse brain atlas. (#27)
samclothier Aug 31, 2022
9190e1e
KimLabDevCCFv001 (neuroinformatics team form) (#31)
JoeZiminski Jan 6, 2023
d5dbe27
Add testing config (#35)
dstansby Feb 1, 2023
577cd06
Replace brainglobe with NI actions (#37)
dstansby Feb 3, 2023
a226d5d
Use pyproject.toml
dstansby Feb 21, 2023
c9b04b9
Update supported Python metadata
dstansby Feb 24, 2023
d00db2f
Clean manifest check
dstansby Feb 24, 2023
ebdb976
Remove cibuildwheel config
dstansby Feb 24, 2023
c536ed4
Merge pull request #38 from dstansby/pyproject
dstansby Feb 24, 2023
ea9acb6
Catch warnings during tests (#39)
dstansby Feb 27, 2023
3b92d54
Add standard pre-commit config (#40)
dstansby Feb 27, 2023
423598b
Fix branches that CI is run on (#42)
dstansby Mar 20, 2023
b1ee389
Update link (#48)
adamltyson Jun 19, 2023
a7e10ee
[pre-commit.ci] pre-commit autoupdate (#49)
pre-commit-ci[bot] Jun 20, 2023
fdf3190
[pre-commit.ci] pre-commit autoupdate (#50)
pre-commit-ci[bot] Jun 27, 2023
ad79edb
[pre-commit.ci] pre-commit autoupdate (#52)
pre-commit-ci[bot] Jul 4, 2023
a3200c3
[pre-commit.ci] pre-commit autoupdate (#53)
pre-commit-ci[bot] Jul 11, 2023
ec229da
[pre-commit.ci] pre-commit autoupdate (#54)
pre-commit-ci[bot] Jul 18, 2023
21a3162
[pre-commit.ci] pre-commit autoupdate (#55)
pre-commit-ci[bot] Jul 25, 2023
f9e4cc1
[pre-commit.ci] pre-commit autoupdate (#57)
pre-commit-ci[bot] Aug 1, 2023
2140031
[pre-commit.ci] pre-commit autoupdate (#59)
pre-commit-ci[bot] Aug 8, 2023
c732275
Update to newer vedo API (#58)
alessandrofelder Aug 10, 2023
5dd3890
[pre-commit.ci] pre-commit autoupdate (#64)
pre-commit-ci[bot] Aug 17, 2023
fc4e4cb
scale mesh points before mapping to new anatomical space (#62)
alessandrofelder Aug 21, 2023
399b6b2
[pre-commit.ci] pre-commit autoupdate (#66)
pre-commit-ci[bot] Aug 22, 2023
d946d4f
[pre-commit.ci] pre-commit autoupdate (#67)
pre-commit-ci[bot] Aug 29, 2023
70fd901
Set pre-commit autoupdate frequency to monthly (#68)
adamltyson Aug 29, 2023
495cdc3
[pre-commit.ci] pre-commit autoupdate (#70)
pre-commit-ci[bot] Sep 5, 2023
510f7d3
[pre-commit.ci] pre-commit autoupdate (#83)
pre-commit-ci[bot] Oct 3, 2023
8e71c22
[pre-commit.ci] pre-commit autoupdate (#95)
pre-commit-ci[bot] Nov 7, 2023
d304152
[pre-commit.ci] pre-commit autoupdate (#107)
pre-commit-ci[bot] Dec 5, 2023
24bae47
[pre-commit.ci] pre-commit autoupdate (#109)
pre-commit-ci[bot] Jan 2, 2024
93e95ab
draft validation functions (#90)
viktorpm Jan 22, 2024
a4acdb4
Structure validation (#110)
viktorpm Jan 23, 2024
9259796
simplify validation function (#113)
alessandrofelder Jan 29, 2024
12252af
[pre-commit.ci] pre-commit autoupdate (#117)
pre-commit-ci[bot] Feb 6, 2024
ae19fad
Add manifest to ci (#118)
willGraham01 Feb 6, 2024
03392f3
printing data frames with validation function information (#115)
viktorpm Feb 12, 2024
795bddd
bg-atlasapi -> brainglobe-atlasapi
willGraham01 Feb 12, 2024
120c3b2
bg_atlasapi -> brainglobe_atlasapi, package restructure
willGraham01 Feb 12, 2024
639aafc
Move tests for API into separate subfolder
willGraham01 Feb 12, 2024
80152d1
Revert "bg_atlasapi -> brainglobe_atlasapi, package restructure"
willGraham01 Feb 12, 2024
7d585e9
bg_atlasapi -> brainglobe_atlasapi, package restructure
willGraham01 Feb 12, 2024
c055cb4
Update manifest
willGraham01 Feb 12, 2024
d96b91e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 12, 2024
7ca6f63
Pre-commit pass
willGraham01 Feb 12, 2024
b195cb6
fixing small bug: validation_functions function argument as variable …
viktorpm Feb 12, 2024
eb37112
Bump NIU action versions
willGraham01 Feb 12, 2024
dd314e7
Move conftest back to top-level directory
willGraham01 Feb 14, 2024
ae673a2
First pass merge
willGraham01 Feb 14, 2024
8da5382
Refactor atlasgen into a submodule
willGraham01 Feb 14, 2024
ab6432d
pre-commit pass
willGraham01 Feb 14, 2024
76a513a
test functions for validate_mesh_structure_pairs (#114)
viktorpm Feb 21, 2024
c9d9136
Revert "Prepare for merge and rename (#198)"
willGraham01 Feb 23, 2024
8f1245a
Merge branch 'revert-depre' into atlasgen-merge
willGraham01 Feb 23, 2024
58c5d94
Merge remote-tracking branch 'atlasgen/main' into atlasgen-merge
willGraham01 Feb 23, 2024
33498a0
Update pyproject.toml
willGraham01 Feb 23, 2024
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
13 changes: 4 additions & 9 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/lint@v1
- uses: neuroinformatics-unit/actions/lint@v2

manifest:
runs-on: ubuntu-latest
Expand All @@ -36,22 +36,17 @@ jobs:
python-version: "3.9"

steps:
- uses: neuroinformatics-unit/actions/test@v1
- uses: neuroinformatics-unit/actions/test@v2
with:
python-version: ${{ matrix.python-version }}

build_sdist_wheels:
name: Build source distribution and wheel
needs: [test]
if: (
github.event_name == 'push' && github.ref_type == 'tag'
) || (
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'Test packaging')
)
if: github.event_name == 'push' && github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v1
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2

upload_all:
name: Publish build distributions
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
bg_atlasapi/bg_config.conf
brainglobe_atlasapi/bg_config.conf

workspace.py
.vscode/

# Byte-compiled / optimized / DLL files
__pycache__
*.__pycache__
__pycache__/
*.py[cod]
*$py.class
Expand Down Expand Up @@ -138,6 +140,5 @@ dmypy.json
.vs/
*.~lock.*


# macOS
*.DS_Store
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,3 @@ repos:
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
additional_dependencies:
- types-setuptools
- types-requests
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ authors:
affiliation: 'Sainsbury Wellcome Centre, University College London'
orcid: 'https://orcid.org/0000-0003-3225-1130'
email: [email protected]
repository-code: 'https://github.com/brainglobe/bg-atlasapi'
repository-code: 'https://github.com/brainglobe/brainglobe-atlasapi'
url: >-
https://brainglobe.info/documentation/bg-atlasapi/index.html
https://brainglobe.info/documentation/brainglobe-atlasapi/index.html
abstract: >-
A common interface for programmers to download and process
brain atlas data from multiple sources.
Expand Down
10 changes: 4 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
BSD 3-Clause License

Copyright (c) 2020, brainglobe
Copyright (c) 2020, BrainGlobe
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
- Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

Expand Down
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ include README.md
include requirements.txt

exclude .codecov.yml
exclude .pre-commit-config.yaml

graft brainglobe_atlasapi *.py

prune tests
prune tutorials
126 changes: 82 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,61 @@
# This package has moved!
# brainglobe-atlasapi

This package has been renamed to `brainglobe-atlasapi`.
To continue receiving updates, please switch over to using [the new package](https://github.com/brainglobe/brainglobe-atlasapi).

# BG-atlasAPI

[![Python Version](https://img.shields.io/pypi/pyversions/bg-atlasapi.svg)](https://pypi.org/project/bg-atlasapi)
[![PyPI](https://img.shields.io/pypi/v/bg-atlasapi.svg)](https://pypi.org/project/bg-atlasapi/)
[![Wheel](https://img.shields.io/pypi/wheel/bg-atlasapi.svg)](https://pypi.org/project/bg-atlasapi)
[![Python Version](https://img.shields.io/pypi/pyversions/brainglobe-atlasapi.svg)](https://pypi.org/project/brainglobe-atlasapi)
[![PyPI](https://img.shields.io/pypi/v/brainglobe-atlasapi.svg)](https://pypi.org/project/brainglobe-atlasapi/)
[![Wheel](https://img.shields.io/pypi/wheel/brainglobe-atlasapi.svg)](https://pypi.org/project/brainglobe-atlasapi)
[![Development Status](https://img.shields.io/pypi/status/brainatlas-api.svg)](https://github.com/SainsburyWellcomeCentre/brainatlas-api)
[![Downloads](https://pepy.tech/badge/bg-atlasapi)](https://pepy.tech/project/bg-atlasapi)
[![Tests](https://img.shields.io/github/actions/workflow/status/brainglobe/bg-atlasapi/test_and_deploy.yml?branch=main)](
https://github.com/brainglobe/bg-atlasapi/actions)
[![codecov](https://codecov.io/gh/brainglobe/bg-atlasapi/branch/master/graph/badge.svg?token=WTFPFW0TE4)](https://codecov.io/gh/brainglobe/bg-atlasapi)
[![Downloads](https://pepy.tech/badge/brainglobe-atlasapi)](https://pepy.tech/project/brainglobe-atlasapi)
[![Tests](https://img.shields.io/github/actions/workflow/status/brainglobe/brainglobe-atlasapi/test_and_deploy.yml?branch=main)](
https://github.com/brainglobe/brainglobe-atlasapi/actions)
[![codecov](https://codecov.io/gh/brainglobe/brainglobe-atlasapi/branch/master/graph/badge.svg?token=WTFPFW0TE4)](https://codecov.io/gh/brainglobe/brainglobe-atlasapi)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.02668/status.svg)](https://doi.org/10.21105/joss.02668)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Contributions](https://img.shields.io/badge/Contributions-Welcome-brightgreen.svg)](https://docs.brainglobe.info/cellfinder/contributing)
[![Website](https://img.shields.io/website?up_message=online&url=https%3A%2F%2Fbrainglobe.info)](https://brainglobe.info/documentation/bg-atlasapi/index.html)
[![Website](https://img.shields.io/website?up_message=online&url=https%3A%2F%2Fbrainglobe.info)](https://brainglobe.info/documentation/brainglobe-atlasapi/index.html)
[![Twitter](https://img.shields.io/twitter/follow/brain_globe?style=social)](https://twitter.com/brain_globe)


The brainglobe atlas API (BG-AtlasAPI) provides a common interface for programmers to download and process brain atlas data from multiple sources.
The brainglobe atlas API (brainglobe-atlasapi) provides a common interface for programmers to download and process brain atlas data from multiple sources.

## Atlases available

A number of atlases are in development, but those available currently are:
* [Allen Mouse Brain Atlas](https://www.brain-map.org) at 10, 25, 50 and 100 micron resolutions
* [Allen Human Brain Atlas](https://www.brain-map.org) at 100 micron resolution
* [Max Planck Zebrafish Brain Atlas](http://fishatlas.neuro.mpg.de) at 1 micron resolution
* [Enhanced and Unified Mouse Brain Atlas](https://kimlab.io/brain-map/atlas/) at 10, 25, 50 and 100 micron resolutions
* [Smoothed version of the Kim et al. mouse reference atlas](https://doi.org/10.1016/j.celrep.2014.12.014) at 10, 25, 50 and 100 micron resolutions
* [Gubra's LSFM mouse brain atlas](https://doi.org/10.1007/s12021-020-09490-8) at 20 micron resolution
* [3D version of the Allen mouse spinal cord atlas](https://doi.org/10.1101/2021.05.06.443008) at 20 x 10 x 10 micron resolution
* [AZBA: A 3D Adult Zebrafish Brain Atlas](https://doi.org/10.1101/2021.05.04.442625) at 4 micron resolution
* [Waxholm Space atlas of the Sprague Dawley rat brain](https://doi.org/10.1016/j.neuroimage.2014.04.001) at 39 micron resolution
* [3D Edge-Aware Refined Atlases Derived from the Allen Developing Mouse Brain Atlases](https://doi.org/10.7554/eLife.61408) (E13, E15, E18, P4, P14, P28 & P56)
* [Princeton Mouse Brain Atlas](https://brainmaps.princeton.edu/2020/09/princeton-mouse-brain-atlas-links) at 20 micron resolution
* [Kim Lab Developmental CCF (P56)](https://data.mendeley.com/datasets/2svx788ddf/1) at 10 micron resolution with 8 reference images - STP, LSFM (iDISCO) and MRI (a0, adc, dwo, fa, MTR, T2)

- [Allen Mouse Brain Atlas](https://www.brain-map.org) at 10, 25, 50 and 100 micron resolutions
- [Allen Human Brain Atlas](https://www.brain-map.org) at 100 micron resolution
- [Max Planck Zebrafish Brain Atlas](http://fishatlas.neuro.mpg.de) at 1 micron resolution
- [Enhanced and Unified Mouse Brain Atlas](https://kimlab.io/brain-map/atlas/) at 10, 25, 50 and 100 micron resolutions
- [Smoothed version of the Kim et al. mouse reference atlas](https://doi.org/10.1016/j.celrep.2014.12.014) at 10, 25, 50 and 100 micron resolutions
- [Gubra's LSFM mouse brain atlas](https://doi.org/10.1007/s12021-020-09490-8) at 20 micron resolution
- [3D version of the Allen mouse spinal cord atlas](https://doi.org/10.1101/2021.05.06.443008) at 20 x 10 x 10 micron resolution
- [AZBA: A 3D Adult Zebrafish Brain Atlas](https://doi.org/10.1101/2021.05.04.442625) at 4 micron resolution
- [Waxholm Space atlas of the Sprague Dawley rat brain](https://doi.org/10.1016/j.neuroimage.2014.04.001) at 39 micron resolution
- [3D Edge-Aware Refined Atlases Derived from the Allen Developing Mouse Brain Atlases](https://doi.org/10.7554/eLife.61408) (E13, E15, E18, P4, P14, P28 & P56)
- [Princeton Mouse Brain Atlas](https://brainmaps.princeton.edu/2020/09/princeton-mouse-brain-atlas-links) at 20 micron resolution
- [Kim Lab Developmental CCF (P56)](https://data.mendeley.com/datasets/2svx788ddf/1) at 10 micron resolution with 8 reference images - STP, LSFM (iDISCO) and MRI (a0, adc, dwo, fa, MTR, T2)

## Installation
BG-AtlasAPI works with Python >3.6, and can be installed from PyPI with:

brainglobe-atlasapi works with Python >3.6, and can be installed from PyPI with:

```bash
pip install bg-atlasapi
pip install brainglobe-atlasapi
```

## Usage
Full information can be found in the [documentation](https://brainglobe.info/documentation/bg-atlasapi/index.html)

Full information can be found in the [documentation](https://brainglobe.info/documentation/brainglobe-atlasapi/index.html)

### Python API
**List of atlases**

To see a list of atlases use `bg_atlasapi.show_atlases`
#### List of atlases

To see a list of atlases use `brainglobe_atlasapi.show_atlases`

```python
from bg_atlasapi import show_atlases
from brainglobe_atlasapi import show_atlases
show_atlases()
# Brainglobe Atlases
# ╭──────────────────────────────────┬────────────┬───────────────┬──────────────╮
Expand All @@ -71,19 +72,19 @@ show_atlases()
# ╰──────────────────────────────────┴────────────┴───────────────┴──────────────╯
```

**Using the atlases**
#### Using the atlases

All the features of each atlas can be accessed via the `BrainGlobeAtlas` class.


e.g. for the 25um Allen Mouse Brain Atlas:

```python
from bg_atlasapi.bg_atlas import BrainGlobeAtlas
from brainglobe_atlasapi.bg_atlas import BrainGlobeAtlas
atlas = BrainGlobeAtlas("allen_mouse_25um")
```

The various files associated with the atlas can then be accessed as attributes of the class:

```python
# reference image
reference_image = atlas.reference
Expand All @@ -101,9 +102,10 @@ print(hemispheres_image.shape)
# (528, 320, 456)
```

**Brain regions**
#### Brain regions

There are multiple ways to work with individual brain regions. To see a dataframe of each brain region, with it's unique ID, acronym and full name, use `atlas.lookup_df`:

```python
atlas.lookup_df.head(8)
# acronym id name
Expand All @@ -118,6 +120,7 @@ atlas.lookup_df.head(8)
```

Each brain region can also be access by the acronym, e.g. for primary visual cortex (VISp):

```python
from pprint import pprint
VISp = atlas.structures["VISp"]
Expand All @@ -131,20 +134,55 @@ pprint(VISp)
# 'structure_id_path': [997, 8, 567, 688, 695, 315, 669, 385]}
```

### Note on coordinates in `bg-atlasapi`
Working with both image coordinates and cartesian coordinates in the same space can be confusing! In `bg-atlasapi`, the origin is always assumed to be in the upper left corner of the image (sectioning along the first dimension), the "ij" convention. This means that when plotting meshes and points using cartesian systems, you might encounter confusing behaviors coming from the fact that in cartesian plots one axis is inverted with respect to ij coordinates (vertical axis increases going up, image row indexes increase going down). To make things as consistent as possible, in `bg-atlasapi` the 0 of the meshes coordinates is assumed to coincide with the 0 index of the images stack, and meshes coordinates increase following the direction stack indexes increase.
To deal with transformations between your data space and `bg-atlasapi`, you might find the [brainglobe-space](https://github.com/brainglobe/brainglobe-space) package helpful.
### Note on coordinates in `brainglobe-atlasapi`

Working with both image coordinates and cartesian coordinates in the same space can be confusing!
In `brainglobe-atlasapi`, the origin is always assumed to be in the upper left corner of the image (sectioning along the first dimension), the "ij" convention.
This means that when plotting meshes and points using cartesian systems, you might encounter confusing behaviors coming from the fact that in cartesian plots one axis is inverted with respect to ij coordinates (vertical axis increases going up, image row indexes increase going down).
To make things as consistent as possible, in `brainglobe-atlasapi` the 0 of the meshes coordinates is assumed to coincide with the 0 index of the images stack, and meshes coordinates increase following the direction stack indexes increase.
To deal with transformations between your data space and `brainglobe-atlasapi`, you might find the [brainglobe-space](https://github.com/brainglobe/brainglobe-space) package helpful.

## Contributing to brainglobe-atlasapi

# Contributing to bg-atlasapi
**Contributors to bg-atlaspi are absolutely encouraged**, whether you want to fix bugs, add/request new features or simply ask questions.

If you would like to contribute to `bg-atlasapi` (or any of the downstream tools like [brainrender](https://github.com/brainglobe/brainrender) etc.) please get in touch by opening a new issue or pull request on [GitHub](https://github.com/brainglobe/bg-atlasapi). Please also see the [developers guide](https://brainglobe.info/developers/index.html).
If you would like to contribute to `brainglobe-atlasapi` (or any of the downstream tools like [brainrender](https://github.com/brainglobe/brainrender) etc.) please get in touch by opening a new issue or pull request on [GitHub](https://github.com/brainglobe/brainglobe-atlasapi).
Please also see the [developers guide](https://brainglobe.info/developers/index.html).

Someone might have already asked a question you might have, so if you're not sure where to start, check out the [issues](https://github.com/brainglobe/bg-atlasapi/issues) (and the issues of the other repositories).
Someone might have already asked a question you might have, so if you're not sure where to start, check out the [issues](https://github.com/brainglobe/brainglobe-atlasapi/issues) (and the issues of the other repositories).

## Citation

If you find the BrainGlobe Atlas API useful, please cite the paper in your work:

>Claudi, F., Petrucco, L., Tyson, A. L., Branco, T., Margrie, T. W. and Portugues, R. (2020). BrainGlobe Atlas API: a common interface for neuroanatomical atlases. Journal of Open Source Software, 5(54), 2668, https://doi.org/10.21105/joss.02668

**Don't forget to cite the developers of the atlas that you used!**

---

# Atlas Generation and Adding a New Atlas

For full instructions to add a new BrainGlobe atlas, please see [here](https://brainglobe.info/documentation/brainglobe_atlasapi/adding-a-new-atlas.html).

The `brainglobe_atlasapi.atlas_generation` submodule contains code for the generation of cleaned-up data, for the main `brainglobe_atlasapi` module.
This code was previously the `bg-atlasgen` module.

## To contribute

1. Fork this repo
2. Clone your repo
3. Run `git clone https://github.com/brainglobe/brainglobe-atlasapi`
4. Install an editable version of the package; by running `pip install -e .` within the cloned directory
5. Create a script to package your atlas, and place into `brainglobe_atlasapi/atlas_generation/atlas_scripts`. Please see other scripts for examples.

Your script should contain everything required to run.
The raw data should be hosted on a publicly accessible repository so that anyone can run the script to recreate the atlas.

If you need to add any dependencies, please add them as an extra in the `pyproject.toml` file, e.g.:

```python
[project.optional-dependencies]
allenmouse = ["allensdk"]
newatlas = ["dependency_1", "dependency_2"]
```
22 changes: 0 additions & 22 deletions bg_atlasapi/__init__.py

This file was deleted.

13 changes: 13 additions & 0 deletions brainglobe_atlasapi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from importlib.metadata import PackageNotFoundError, metadata

try:
__version__ = metadata("brainglobe-atlasapi")["Version"]
__author__ = metadata("brainglobe-atlasapi")["Author"]
del metadata
except PackageNotFoundError:
# package is not installed
pass


from brainglobe_atlasapi.bg_atlas import BrainGlobeAtlas
from brainglobe_atlasapi.list_atlases import show_atlases
5 changes: 5 additions & 0 deletions brainglobe_atlasapi/atlas_generation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__version__ = "1" # will set major version of all atlases

from rich.traceback import install

install()
Empty file.
Loading
Loading