# BrainGlobe future vision
## Past
- Developed some general tools
- BG Atlas API
- brainrender
- Incorporated some existing tools for whole-brain brain microscopy
- brainreg
- cellfinder
- Developed workflows to link the above
- brainreg-segment
## Current
### BrainGlobe
- Tools seem to be used well (based on downloads, citations etc.)
- Tend to be used in isolation (cellfinder or brainrender etc)
- Confusion about naming (cellfinder, cellfinder-core etc.)
- Little (?) sense of an ecosystem
### Community
- Lots of teams developing the latest, greatest algorithm for X
- Lots of teams developing specific workflows for labs, institutes, corsortia etc
- Fast development in the open-source bioimage analysis space - scikit-image, napari, itk etc
### Problem (as seen by AT)
**Nobody is developing workflows for "normal" neuroscience problems**
All the building blocks (atlases, registration algorithms, cell detection methods) exist, but there is no "glue" to allow non-expert users to chain them together quickly, flexibly and easily.
## Future
### Aim
BrainGlobe should become this "glue". A user should be able to use BrainGlobe tools alongside other packages in the same environment (whether Python script/notebook or napari).
Users should be able to process data from N (TBC) most common workflows by following a simple guide, in a single platform. E.g.:
- Mouse/rat/zfish 2/3D data
- Cell detection
- Bulk region segmentation
- Visualisation
- Comparison to community data
These workflows shouldn't just be possible, but easily findable, documented, validated and supported.
### Structure
BrainGlobe will consist of:
- **"Glue packages"** that bring "neuroanatomical context" to existing tools:
- Atlas API
- Layer interpreters (e.g. assigning cells to brain regions, analysing distribution of a lesion)
- Visualisation of data in a neuroscience-first manner (e.g. show me V1, not `object.load("/path/to/V1.obj"`)
- **Wrappers** around existing algorithms (e.g. using itk-elastix to register to a BrainGlobe Atlas)
- **Standalone tools** - e.g. brainreg/cellfinder
All tools will exist as a Python API and a napari plugin. Users should be able to do everything within napari, and experts can use the Python API. Eventually we should be able to export the napari commands (c.f. ImageJ macro recorder). We will provide batch scripts for use on e.g. HPC (replacing inflexible command-line tools).
### Naming and release
The ecosystem will become simply "BrainGlobe" with one version, and a simplified release mechanism. Internally we will refer to cellfinder etc, but for users it could be "BrainGlobe atlas registration". Each package will be released seperately, but we will advertise new releases of "BrainGlobe".
There should be a BrainGlobe napari metapackage, and maybe a single namespace, e.g.:
```python=
from brainglobe import brainreg, cellfinder
# OR
from brainglobe import registration, cell detection
```
### Packages
Some are done, some will need adapting, and some do not exist yet.
Should we develop a common interface between inputs/processing/outputs?

## Workflows/user stories
#### Priority I
- Visualisation within napari
- Atlas data
- publicly available cell coordinates
- publicly available cell morphology
[Existing brainrender examples](https://github.com/brainglobe/brainrender/tree/master/examples)
- 3D serial 2p data (already catered to in BG)
- Count cells per brain region
- Analyse distribution of fluorescently labelled regions (e.g. neuropixels tracks)
- Analyse lesion volume
- Transform objects to atlas space
- Mouse & rat?
- 3D whole-brain LSFM data
- Mouse
- iDISCO & ... (whatever clearing method used at SWC)
- 2D thin section (e.g. slide scanner) data
- Count cells per brain region
- Analyse distribution of fluorescently labelled regions
- Analyse lesion volume
- Transform objects to atlas space
- Mouse & rat?
- Coronal, then saggital, then arbitrary orientation
In three imaging modes for two rodent species, be able to at a minimum
* detect labelled cells and regions
* register these to an atlas
* count cells per brain region
* analyse distribution of fluorescence
* visualise the results in a nice and exportable way
#### Priority II
- Register 3D brain subvolume (e.g. cleared tissue)
- Filled cells after acute recordings
- Register other species
- Adult/larval zebrafish
-