Skip to main content
bioRxiv
  • Home
  • About
  • Submit
  • ALERTS / RSS
Advanced Search
New Results

Brainrender. A python based software for visualisation of neuroanatomical and morphological data

View ORCID ProfileFederico Claudi, View ORCID ProfileAdam L. Tyson, Tiago Branco
doi: https://doi.org/10.1101/2020.02.23.961748
Federico Claudi
1Sainsbury Wellcome Centre for Neural Circuits and Behaviour, UCL, London, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Federico Claudi
  • For correspondence: federico.claudi.17@ucl.ac.uk
Adam L. Tyson
1Sainsbury Wellcome Centre for Neural Circuits and Behaviour, UCL, London, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • ORCID record for Adam L. Tyson
Tiago Branco
1Sainsbury Wellcome Centre for Neural Circuits and Behaviour, UCL, London, UK
  • Find this author on Google Scholar
  • Find this author on PubMed
  • Search for this author on this site
  • Abstract
  • Full Text
  • Info/History
  • Metrics
  • Data/Code
  • Preview PDF
Loading

Abstract

Here we present brainrender, an open source python package for rendering three-dimensional neuroanatomical data aligned to the Allen Mouse Atlas. Brainrender can be used to explore, visualise and compare data from publicly available datasets (e.g. from the Mouse Light project from Janelia) as well as data generated within individual laboratories. Brainrender facilitates the exploration of neuroanatomical data with three-dimensional renderings, aiding the design and interpretation of experiments and the dissemination of anatomical findings. Additionally, brainrender can also be used to generate high-quality, publication-ready, figures for scientific publications.

Introduction

In recent years, the study of mouse neuroanatomy greatly benefited from the development of a high resolution three dimensional reference atlas from the Allen Institute (here-after referred to as the Allen atlas [1; 2]). This has enabled large scale projects aimed at mapping mesoscale connections across the entire murine brain (e.g. Allen’s Mouse Connectome project [3]) and reconstructing the three-dimensional morphology of over 1000 neurons (e.g. Janelia’s Mouse Light [4]). The Allen atlas is also used as a reference for registering anatomical data produced with high throughput techniques such as serial two-photon tomography [5; 6], which is a crucial step in the analysis of data generated with these techniques [7]. Visualisation of anatomical data registered to the Allen atlas often requires custom-made code, a time consuming effort that is technically not trivial. Here we present brainrender, an easy to use and open source python package for the visualisation of anatomical data registered to the Allen atlas.

As the use of the Allen atlas has become more widespread in the research community, software has been developed to visualise anatomical data. These include Brain Explorer [8] and Neuron Browser [9] which can be used to explore data from the Allen Institute projects and the Mouse Light project respectively. Using these software packages does not require any programming experience making them widely accessible. However, they cannot be used to visualise user-generated data alongside that from publicly available datasets. Furthermore, they offer little room for users to personalise the look of the rendered data, a key feature for any software that is to be used to generate figures for scientific articles.

In addition to the software discussed above, open source packages with similar functionalities have been developed in popular programming languages such as R and Matlab [10; 11; 12]. These can be used to either explore a publicly available dataset or visualise user-generated data, but not both at the same time. Furthermore, there are currently no such packages written in Python, a programming language that is being increasingly adopted by the neuroscience community [13].

For these reasons we developed brainrender. Development of brainrender was instructed by two design goals: first, to provide a single software package for the visualisation of both publicly available and user-generated neuroanatomical data. Second, to facilitate the creation of high quality renderings of neuroanatomical data to be used for figures in scientific publications. In addition, we made the software user-friendly by handling the API interactions (necessary to download data from public databases) and data rendering behind the scenes, needing minimal user input. This means that using brainrender requires little coding experience, facilitating its adoption by the research community. We believe that brainrender will be useful in guiding the design and interpretation of neuroanatomical studies as well as the dissemination of anatomical findings.

In this preprint, we begin by showing how brainrender can be used to visualise data from the Allen atlas, Mouse Connectome and Mouse Light projects and conclude with a demonstration of how it can be used to visualise the results of retrograde tracing experiments. Brainrender’s code is made available at its github repository (https://github.com/BrancoLab/BrainRender) alongside numerous examples and tutorials.

Public datasets

Brainrender supports interaction with the Allen atlas and two large publicly available datasets: the Mouse Connectome project from Allen [3] and the Mouse Light project from the Janelia Research Campus [4]. In this section we will show examples of how brainrender can be used to visualise the three dimensional organisation of brain structures, mesoscale connectomics (afferent and efferent projections from a target area) and neuronal morphological reconstructions.

Brain structures

To contextualise anatomical and morphological data, it is helpful to be able to visualise a subset of brain regions relevant to the data at hand. This can be done in brainrender by specifying which of the brain regions in the Allen atlas to visualise (see Fig 1a, b). Behind the scenes, brainrender uses the Allen’s API services to download and render the three dimensional anatomy of selected brain regions.

Figure 1.
  • Download figure
  • Open in new tab
Figure 1. Visualisation of data from open-acces datasets.

a) Subregions of the thalamus. Solid red: ventral posterior complex of the thalamus, wireframe red: thalamus. b) Cortical layers in the barrel field of the primary somatosensory cortex. c) Efferent anatomical projections from the periaqueductal gray visualised as streamlines. d) Afferent projections to the zona incerta visualised as tractography. Injection sites and tractography tracts are coloured according to the target region of the virus injection. e) Visualisation of a pyramidal neuron in the primary motor cortex. Data from MouseLight project (doi:10.25378/janelia.5527438). f) Rendering of morphological reconstructions of pyramidal neurons. Data from http://neuromorpho.org/ [14].

Mesoscale connectomics

Mesoscale connectivity data from the Mouse Connectome project can be visualised in two ways: 1) efferent projections can be rendered as streamlines (Fig 1c) and 2) afferent projections can be visualised as tractography data (Fig 1d).

As part of the Mouse Connectome project mice were injected with viruses expressing fluorescent markers. Fluorescence was then measured across the entire brain and the data were registered to the common coordinate framework of the Allen atlas before being made publicly available. The streamlines visualisation relies on the use of a fast marching algorithm on the fluorescence data to reconstruct efferent projections from the site of virus injection. The results of this analysis were shared by Neuroinformatics NL (https://neuroinformatics.nl/drupal). Brainrender can be used to automatically download and visualise efferent projections from a target brain region, as illustrated in Fig 1c for the periaqueductal gray.

To visualise afferent projections to a region of interests, brainrender selects the set of tracing experiments in the Mouse Connectome project that resulted in fluorescence signal in the selected region by using the Allen institute’s SDK and API services. Then, the location of virus injection of each selected experiment and the projections to the region of interest are rendered as displayed in Fig. 1d.

Neuronal morphology

The visualisation of afferent and efferent projections from a brain region can be combined to build a qualitative understanding of the input and output connectivity of the circuit being studied. A more precise understanding of the projections of individual neurons can be obtained by rendering morphological data for neurons located in (or projecting to) the region of interest. Brainrender can be used to easily download and visualise morphological reconstructions registered to the Allen atlas from the Mouse Light project, as illustrated in Fig. 1e.

Brainrender can also render morphological reconstructions from other sources (e.g. see Fig. 1f). Thus brainrender can be used to visualise the large body of open access neuron morphologies currently available (e.g. from the Allen Cell Types project or from the https://neuromorpho.org free database, [14]).

User generated data

Tracing experiments

To demonstrate how brainrender can be used to visualise the results of tracing experiments, we used unpublished data that are part of an ongoing project investigating the location of neurons projecting to the motor (deep) part of the superior colliculus (SCm). SCm projecting neurons were labelled with the tdTomato fluorescent marker by injecting a retrogradely transported viral particle expressing CRE and enhanced GFP (AAV2r-CRE-eGFP) in a Flex-tdTomato mouse line. Injection of the virus in the right SCm resulted in labelled neurons across several cortical and subcortical areas. In agreement with previous tracing studies, numerous labelled neurons were identified unilaterally in the secondary motor cortex (MOs) and zona incerta (ZI), ipsilaterally to the injection site. In the ventrolateral hypothalamus (VMH) labelled neurons were equally distributed across both hemispheres (see Fig 2d).

Figure 2.
  • Download figure
  • Open in new tab
Figure 2. Visualisation of user-generated data.

a), b), c) Visualisation of virus injection site (red) in the motor superior colliculus (fuchsia). a) Coronal view of the injection site. b) Top view of the injection site. c) Angled view of the injection site. d) Labelled cells in the secondary motor cortex, zona incerta and ventrolateral hypothalamus. e) Labelled cells in the isocortex. An animated visualisation of panel d can be found at: https://raw.githubusercontent.com/BrancoLab/BrainRender/master/Docs/Media/cells.gif

To extract the precise location of labelled neurons registered to the Allen atlas, the entire brain was imaged with a two-photon tomography setup [15]. We then used cellfinder, a novel tool for cell detection in whole-brain images, to extract the location of labelled cells [16]. Cellfinder relies on amap [7] for registering image data to the Allen atlas, yielding the coordinates of labelled cells in the common coordinate space which can easily be visualised in brainrender. The boundaries of the injection site were extracted from the imaging data using custom python code, which will be made available as part of the neuro python package (www.github.com/SainsburyWellcomeCentre/neuro). In brief, the whole brain imaging data was thresholded and binarised to identify the location of the injection site. Then, a marching cubes algorithm was utilised to extract the surface of the injection site, which was then converted to a mesh structure and rendered.

After extracting the coordinates of the injection site and labelled cells, data were rendered in brainrender alongside the relevant brain regions (Fig 2) Visualisation of the injection site (Fig 2a, b and c) demonstrated that the injection was not entirely confined to the SCm but also included part of the superficial superior colliculus. The location of all labelled neurons in MOs, ZI and VMH is shown in Fig 2d while Fig 2e while shows the position of neurons in across the entire isocortex.

Implanted devices

Brainrender can also be used to visualise the position of devices implanted in the brain, such as optic fibres and electrodes arrays implanted in the brain (e.g. see Fig 3). This can be used to confirm and visualise the correct placement of implanted devices as well as to create schematics of proposed experiments.

Figure 3.
  • Download figure
  • Open in new tab
Figure 3. Additional types of data visualisation in brainrender.

a) Example of how the position of an implanted electrodes array can be visualised. Electrodes (grey) are shown in position in the CA1 field of the hippocampus. b) Schematic illustration of two optic fibres (light blue) implanted over the central amygdala (salmon). The basolateral amygdala is shown in grey.

Thanks to the flexibility afforded by the rendering engine that brainrender relies upon (vtkplotter, [17]), custom devices can also be rendered. In fact, brainrender can be used to visualise any three dimensional object by loading mesh data from ‘.obj’ and ‘.stl’ files. This allows for the possibility of visualising custom designed devices alongside neuroanatomical data.

Discussion

In this preprint we presented brainrender, an open source python package for rendering three dimensional anatomical data aligned to the Allen atlas. Brainrender can be used to explore anatomical and connectomics data from projects carried out by the Allen Institute as well as neuronal morphological reconstructions from the Mouse Light project. Thus, brainrender can be used to rapidly obtain a qualitative understanding of the input/output connectivity of a brain region, guiding the design of further experiments.

Brainrender can also be used to visualise neuroanatomical data generated within individual laboratories, facilitating the interpretation and dissemination of anatomical findings. To further aid the dissemination of anatomical data, brainrender also provides a simple way to generate high quality renderings of anatomical data for scientific figures and illustrations.

Code availability

Brainrender is available as a stand alone python package on PyPI. Brainrender’s code is public and available on Github: https://github.com/BrancoLab/BrainRender. Contributions to brainrender are welcomed and encouraged. For bug reports, feature requests and code contributions, please open an issue at the Github repository or contact the authors directly.

Footnotes

  • https://github.com/BrancoLab/BrainRender

References

  1. [1].↵
    Leonard Kuan, Yang Li, Chris Lau, David Feng, Amy Bernard, Susan M Sunkin, Hongkui Zeng, Chinh Dang, Michael Hawrylycz, and Lydia Ng. Neuroinformatics of the allen mouse brain connectivity atlas. Methods, 73:4–17, February 2015.
    OpenUrlCrossRefPubMed
  2. [2].↵
    Ed S Lein, Michael J Hawrylycz, Nancy Ao, Mikael Ayres, Amy Bensinger, Amy Bernard, Andrew F Boe, Mark S Boguski, Kevin S Brockway, Emi J Byrnes, Lin Chen, Li Chen, Tsuey-Ming Chen, Mei Chi Chin, Jimmy Chong, Brian E Crook, Aneta Czaplinska, Chinh N Dang, Suvro Datta, Nick R Dee, Aimee L Desaki, Tsega Desta, Ellen Diep, Tim A Dolbeare, Matthew J Donelan, Hong-Wei Dong, Jennifer G Dougherty, Ben J Dun-can, Amanda J Ebbert, Gregor Eichele, Lili K Estin, Casey Faber, Benjamin A Facer, Rick Fields, Shanna R Fischer, Tim P Fliss, Cliff Frensley, Sabrina N Gates, Katie J Glattfelder, Kevin R Halverson, Matthew R Hart, John G Hohmann, Maureen P Howell, Darren P Jeung, Rebecca A Johnson, Patrick T Karr, Reena Kawal, Jolene M Kidney, Rachel H Knapik, Chihchau L Kuan, James H Lake, Annabel R Laramee, Kirk D Larsen, Christopher Lau, Tracy A Lemon, Agnes J Liang, Ying Liu, Lon T Luong, Jesse Michaels, Ju-dith J Morgan, Rebecca J Morgan, Marty T Mortrud, Nerick F Mosqueda, Lydia L Ng, Randy Ng, Geralyn J Orta, Caroline C Overly, Tu H Pak, Sheana E Parry, Sayan D Pathak, Owen C Pearson, Ralph B Puchalski, Zackery L Riley, Hannah R Rockett, Stephen A Rowland, Joshua J Royall, Marcos J Ruiz, Nadia R Sarno, Katherine Schaffnit, Nadiya V Shapovalova, Taz Sivisay, Clifford R Slaughterbeck, Simon C Smith, Kimberly A Smith, Bryan I Smith, Andy J Sodt, Nick N Stewart, Kenda-Ruth Stumpf, Susan M Sunkin, Madhavi Sutram, Angelene Tam, Carey D Teemer, Christina Thaller, Carol L Thompson, Lee R Varnam, Axel Visel, Ray M Whitlock, Paul E Wohnoutka, Crissa K Wolkey, Victoria Y Wong, Matthew Wood, Murat B Yaylaoglu, Rob C Young, Brian L Youngstrom, Xu Feng Yuan, Bin Zhang, Theresa A Zwingman, and Allan R Jones. Genome-wide atlas of gene expression in the adult mouse brain. Nature, 445(7124):168–176, January 2007.
    OpenUrlCrossRefPubMedWeb of Science
  3. [3].↵
    Seung Wook Oh, Julie A Harris, Lydia Ng, Brent Winslow, Nicholas Cain, Stefan Mihalas, Quanxin Wang, Chris Lau, Leonard Kuan, Alex M Henry, Marty T Mortrud, Benjamin Ouellette, Thuc Nghi Nguyen, Staci A Sorensen, Clifford R Slaughterbeck, Wayne Wakeman, Yang Li, David Feng, Anh Ho, Eric Nicholas, Karla E Hirokawa, Phillip Bohn, Kevin M Joines, Hanchuan Peng, Michael J Hawrylycz, John W Phillips, John G Hohmann, Paul Wohnoutka, Charles R Gerfen, Christof Koch, Amy Bernard, Chinh Dang, Allan R Jones, and Hongkui Zeng. A mesoscale connectome of the mouse brain. Nature, 508(7495):207–214, April 2014.
    OpenUrlCrossRefPubMedWeb of Science
  4. [4].↵
    Johan Winnubst, Erhan Bas, Tiago A Ferreira, Zhuhao Wu, Michael N Economo, Patrick Edson, Ben J Arthur, Christopher Bruns, Konrad Rokicki, David Schauder, Donald J Olbris, Sean D Murphy, David G Ackerman, Cameron Arshadi, Perry Baldwin, Regina Blake, Ahmad Elsayed, Mashtura Hasan, Daniel Ramirez, Bruno Dos Santos, Monet Weldon, Amina Zafar, Joshua T Dudman, Charles R Gerfen, Adam W Hantman, Wyatt Korff, Scott M Sternson, Nelson Spruston, Karel Svoboda, and Jayaram Chandrashekar. Reconstruction of 1,000 projection neurons reveals new cell types and organization of Long-Range connectivity in the mouse brain. Cell, 179(1):268–281.e13, September 2019.
    OpenUrl
  5. [5].↵
    Pavel Osten and Troy W Margrie. Mapping brain circuitry with a light microscope. Nat. Methods, 10(6):515–523, June 2013.
    OpenUrlCrossRefPubMedWeb of Science
  6. [6].↵
    Timothy Ragan, Lolahon R Kadiri, Kannan Umadevi Venkataraju, Karsten Bahlmann, Jason Sutin, Julian Taranda, Ignacio Arganda-Carreras, Yongsoo Kim, H Sebastian Seung, and Pavel Osten. Serial two-photon tomography for automated ex vivo mouse brain imaging. Nat. Methods, 9(3):255–258, January 2012.
    OpenUrlCrossRefPubMedWeb of Science
  7. [7].↵
    Christian J Niedworok, Alexander P Y Brown, M Jorge Cardoso, Pavel Osten, Sebastien Ourselin, Marc Modat, and Troy W Margrie. aMAP is a validated pipeline for registration and segmentation of high-resolution mouse brain data. Nat. Commun., 7:11879, July 2016. doi:10.5281/zenodo.3582162.
    OpenUrlCrossRef
  8. [8].↵
    Allen Institute. Brain explorer. http://mouse.brain-map.org/static/brainexplorer, 2019.
  9. [9].↵
    Janelia Research Campus. Neuron explorer. http://ml-neuronbrowser.janelia.org/, 2019.
  10. [10].↵
    Bates AS and Jefferis GSXE. mouselightr: R client utilities for interacting with the mouselight project. r package version 0.1.0. https://github.com/natverse/mouselightr, 2019.
  11. [11].↵
    Allen Institute. Cocoframer. https://github.com/AllenInstitute/cocoframer.
  12. [12].↵
    Philip Shamash, Matteo Carandini, Kenneth Harris, and Nick Steinmetz. A tool for analyzing electrode tracks from slice histology. bioRxiv, page 447995, October 2018.
  13. [13].↵
    Eilif Muller, James A Bednar, Markus Diesmann, Marc-Oliver Gewaltig, Michael Hines, and Andrew P Davison. Python in neuroscience. Front. Neuroinform., 9:11, April 2015.
    OpenUrl
  14. [14].↵
    Giorgio A Ascoli, Duncan E Donohue, and Maryam Halavi. NeuroMorpho.Org: a central resource for neuronal morphologies. J. Neurosci., 27(35):9247–9251, August 2007.
    OpenUrlFREE Full Text
  15. [15].↵
    Rob Campbell. Bakingtray. https://github.com/SainsburyWellcomeCentre/BakingTray, 2020. http://doi.org/10.5281/zenodo.3631610.
  16. [16].↵
    Adam L. Tyson, Charly V. Rousseau, Christian J. Niedworok, and Troy W. Margrie. cellfinder: automated 3d cell detection and registration of whole-brain images. https://github.com/SainsburyWellcomeCentre/cellfinder, 2020. doi:10.5281/zenodo.3665329.
    OpenUrlCrossRef
  17. [17].↵
    Musy Marco et al. vtkplotter, a python module for scientific visualization and analysis of 3d objects and point clouds based on vtk (visualization toolkit). https://zenodo.org/record/2561402#.XeKN4NXLffs, 2019. doi:10.5281/zenodo.2561402.
    OpenUrlCrossRef
Back to top
PreviousNext
Posted February 25, 2020.
Download PDF
Data/Code
Email

Thank you for your interest in spreading the word about bioRxiv.

NOTE: Your email address is requested solely to identify you as the sender of this article.

Enter multiple addresses on separate lines or separate them with commas.
Brainrender. A python based software for visualisation of neuroanatomical and morphological data
(Your Name) has forwarded a page to you from bioRxiv
(Your Name) thought you would like to see this page from the bioRxiv website.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Share
Brainrender. A python based software for visualisation of neuroanatomical and morphological data
Federico Claudi, Adam L. Tyson, Tiago Branco
bioRxiv 2020.02.23.961748; doi: https://doi.org/10.1101/2020.02.23.961748
Digg logo Reddit logo Twitter logo Facebook logo Google logo LinkedIn logo Mendeley logo
Citation Tools
Brainrender. A python based software for visualisation of neuroanatomical and morphological data
Federico Claudi, Adam L. Tyson, Tiago Branco
bioRxiv 2020.02.23.961748; doi: https://doi.org/10.1101/2020.02.23.961748

Citation Manager Formats

  • BibTeX
  • Bookends
  • EasyBib
  • EndNote (tagged)
  • EndNote 8 (xml)
  • Medlars
  • Mendeley
  • Papers
  • RefWorks Tagged
  • Ref Manager
  • RIS
  • Zotero
  • Tweet Widget
  • Facebook Like
  • Google Plus One

Subject Area

  • Neuroscience
Subject Areas
All Articles
  • Animal Behavior and Cognition (4078)
  • Biochemistry (8750)
  • Bioengineering (6467)
  • Bioinformatics (23314)
  • Biophysics (11719)
  • Cancer Biology (9134)
  • Cell Biology (13227)
  • Clinical Trials (138)
  • Developmental Biology (7404)
  • Ecology (11360)
  • Epidemiology (2066)
  • Evolutionary Biology (15078)
  • Genetics (10390)
  • Genomics (14001)
  • Immunology (9109)
  • Microbiology (22025)
  • Molecular Biology (8773)
  • Neuroscience (47316)
  • Paleontology (350)
  • Pathology (1419)
  • Pharmacology and Toxicology (2480)
  • Physiology (3701)
  • Plant Biology (8044)
  • Scientific Communication and Education (1427)
  • Synthetic Biology (2206)
  • Systems Biology (6009)
  • Zoology (1247)