Skip to main content

Load and plot Allen Mouse Brain Connectivity data

Project description

Brain Street View bsv

Load and plot Allen Connectivity Data (Oh et al., Nature, 2014)

Available in both MATLAB and Python.

🏁 Quick start

Python (recommended):

pip install brain-street-view

Then open example.ipynb or run example.py. The first run downloads images from the Allen API and caches them locally. Subsequent runs load from cache.

MATLAB: See the script gettingStarted.mlx. Requires MATLAB>=2019a.

⚒️ Installation

Python

pip install brain-street-view

Or from source:

git clone https://github.com/Julie-Fabre/brain_street_view.git
cd brain_street_view
pip install -e .

You also need the Allen CCF atlas files (not included):

  • allenCCF — annotation volumes and structure trees

MATLAB

MATLAB dependencies:

📖 Usage

Python

import bsv

# 1. Find experiments
experiment_ids = bsv.find_connectivity_experiments(['VISp', 'VISl'])

# 2. Fetch data
imgs, inj_summary, _, _ = bsv.fetch_connectivity_data(
    experiment_ids, '/path/to/cache', '',
    'injectionIntensity', False,
    allen_atlas_path='/path/to/allenCCF')

# 3. Plot projections to striatum
bsv.plot_connectivity(imgs, '/path/to/allenCCF', 'CP',
                       10, 15, 'coronal', True, 2, 'global', None,
                       'injectionIntensity')

# 4. 3D visualization
bsv.plot_connectivity_3d(inj_summary, '/path/to/allenCCF', 'CP',
                          plot_patch=True)

See example.ipynb for the full workflow including region grouping, thresholding, and CP subregion analysis.

MATLAB

% 1. Find experiments
experimentIDs = bsv.findConnectivityExperiments({'VISp', 'VISl'});

% 2. Fetch data
[experimentImgs, injectionSummary] = bsv.fetchConnectivityData(experimentIDs, ...
    saveLocation, fileName, 'injectionIntensity', false, '', allenAtlasPath);

% 3. Plot
bsv.plotConnectivity(experimentImgs, allenAtlasPath, 'CP', 10, 15, ...
    'coronal', true, 2, 'global', [], 'injectionIntensity')

See +bsv/example.m for the full MATLAB workflow.

🖼️ Gallery

  • projections from visual cortices to striatum: injection sites and striatum plotted in 3D
  • example injections in primary visual cortex (VISp)
  • example injections in antero-lateral visual cortex (VISal)
  • projections from visual cortices (VIS) to striatum (CP)

📬 Contact me

If you run into any issues or if you have any suggestions, please raise a github issue, create a pull request or email me: juliemfabre[at]gmail[dot]com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brain_street_view-0.1.1.tar.gz (8.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brain_street_view-0.1.1-py3-none-any.whl (74.4 kB view details)

Uploaded Python 3

File details

Details for the file brain_street_view-0.1.1.tar.gz.

File metadata

  • Download URL: brain_street_view-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for brain_street_view-0.1.1.tar.gz
Algorithm Hash digest
SHA256 903ef385022f3d5b1ca3df06bedc7becbfbac15ea6bb3b2f7c2ea5966c201765
MD5 69751e57fdf3e78e86e3e493f6c17497
BLAKE2b-256 71eebc4c595cdf30cf8e63a9df76d89ab16d86e2108fdd3d12aec54afc426cb4

See more details on using hashes here.

File details

Details for the file brain_street_view-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for brain_street_view-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6f61f99751e07d959b24f51f60c8621b2daa593d697d693ec4caf0e7cb568ba1
MD5 12210a7ba49a1d245339e820ff1be86b
BLAKE2b-256 27ee655c53d52d5e5e39f30394cdccb5cedaee92b9f4096f203063c6e67609bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page