Git Product home page Git Product logo

flexible-annotation-atlas's Introduction

Flexible annotation atlas (FAA) of the mouse brain

This repository contains Python codes for our papers (Sci Rep and bioRxiv) "Flexible annotation atlas of the mouse brain: combining and dividing brain structures of the Allen Brain Atlas while maintaining anatomical hierarchy".

Several FAAs are available in an FAAs folder including FAAocd that was used in NeuroImage for cortico-striatal-thalamo (CST) circuitry analysis.

Highlihgts

  • A flexible annotation atlas (FAA) for the mouse brain is proposed.
  • FAA is expected to improve whole brain ROI-definition consistency among laboratories.
  • The ROI can be combined or divided objectively while maintaining anatomical hierarchy by leveraging public resources of the Allen Institute for Brain Science.
  • A mere two-step procedure with user-specified, text-based inforamtion and Python codes constructs FAAs with total ROI counts from 1 to more than 1,000.

Examples of FAA

FAA consists of a JSON-formatted text file (anatomical ontology, AO) and a three-dimensional volume file of the mouse brain (annotation volume, AV). Examples of FAA are shown below: FAAsegment (total node count: 4), FAAcoarse (101), and FAAdetailed (1381). In FAAdetailed, nodes for the hippocampus and striatum were divided to two (dorsal and ventral regions) based on gene expression and fiber projection, respectively.

An icicle plot shows anatomical hierarchy of FAAdetailed with a brain structure acronym and its volume in nL ( e.g. "CH_R: 138284" stands for a brain structure "Cerebrum" in the right hemisphere "_R" with a volume size of 138,284 nl). In an FAAs folder, some FAAs and an HTML file for zoomable visualization of anatomical hierarchy are available. FAA-example-AVs FAA-example-AOdetailed

Steps to construct your annotation atlas

0. Preprocessing

Run Prepare_AObaseAVbase.ipynb to obtain preprocessed files in the data folder: a text file ( AObase.json) and a volume file ( AVbase.nrrd). This preprocessing eliminates destructive brain structures in the original anatomical ontology file and an annotation volume of the mouse brain provided by the Allen Institute for Brain Science (AIBS).

1. Combining brain structures

Copy AObase.json and rename it to AObase_c.json in the data folder. Edit AObase_c.json with a text editor to combine brain structures in AVbase.nrrd. Specifically, delete all contents within brackets [] of a key "children" for an inner node to combine its all descendent nodes. For example, "children": [ {"id":8, ... }, ..., {"id": 73, ..., "voxel_count": 6136}], "voxel_count": null would be "children": [], "voxel_count": 12345 (Any number, including null, can be used for 12345, as it will be automatically corrected later. Specifying the volume of the ROI facilitates easier viewing of the follwoing visualization) in a file AObase_c.json. Zoomable visualization of anatomical hierarchy of AObase_c.json is available using an HTML file, which facilitates ROI volume check and is useful to decide which brain structures to be combined or not.

2. Dividing a brain structure based on gene expression and/or fiber projection.

Specify text-based information in Divide_nodes.ipynb: 1) IDs of brain structures ( Target_ROI_IDs), 2) Experimental ID ( ExpID) of a gene of interest, and 3) Acronyms of a brain structures which are a source and a target of neuronal fiber innervation. Then, run Divide_nodes.ipynb to obtain your FAA, which consists of an ontology text file ( AO_LR_remapID.json) and an annotation volume ( AV_LR_remapID_RAS.nii) in the data folder.

A more detailed manual describing the step-by-step procedure is available here or at Supplementary Tables 2-4 in our paper.

You can use Python scripts (Prepare_AObaseAVbase.py, Divide_nodes.py) instead of these Jupyter notebooks. For example, execute ipython Prepare_AObaseAVbase.py in an Anaconda Prompt.

Q & As

How to share your original FAA

There are two methods to share your FAA:

  • Direct Sharing: Share the FAA files directly. This includes the 'AO_LR_remapID.json' and 'AV_LR_remapID_RAS.nii' files.
  • Text-Based Sharing: Share text-based information that allows others to reconstruct your FAA. For example, please refer to the 'FAAs' folder.

Transforming NRRD images to NiFTI Format

NRRD images can be converted into NiFTI format in RAS orientation using the code.

Downloading Structural images

Structural images, such as 'average_template_100.nrrd', can be downloaded from the Allen Institute's webpage

Precaution for dividing a ROI based on a gene expression energy

Software environment

The pipeline for FAA construction was created with Python (3.7.1) using AllenSDK (version 0.16.1, python3 -m pip install allensdk) written in Jupyter Notebook (5.6.0) on Anaconda (2018.12) on Windows 10 (Professional 64 bit, Microsoft). The yaml file for the anaconda environment is available in a yaml folder. Nbparameterise is also necessary.

flexible-annotation-atlas's People

Contributors

ntakata avatar

Stargazers

Ron Finn avatar Qiyu avatar Yuki Ishikawa avatar  avatar  avatar Niko Sirmpilatze avatar

Watchers

 avatar  avatar

flexible-annotation-atlas's Issues

ROI division fails when gene expression energy lacks bimodal Gaussian mixture distribution

The ROI division process for a gene can fail if the gene expression energy does not exhibit a bimodal Gaussian mixture distribution. This is due to the code in Divide_ROI_with_gene_expression_data.ipynb, which assumes that gene expression energy can be represented by two Gaussian distributions. The inflection point of these distributions is used to divide a ROI.

For instance, the gene expression energy (a black area) for the Wolfram syndrome 1 homolog (Wfs1, Exp ID: 74881161) in the hippocampal field CA1 ROI can be successfully fitted with two normal distributions (gray trace). The inflection point (a vertical dashed line) is then used for dividing the target ROI.
Wfs1 in CA1

However, for tachykinin 2 (Tac2, Exp ID: 72339556) in the hypothalamus (HY) ROI, bimodal Gaussian fitting failed, resulting in the inflection point being set at the extreme right, which led to inappropriate ROI division.
Tacw in HY

We recommend checking the distribution of gene expression in a ROI using Divide_ROI_with_gene_expression_data.ipynb.
Special thanks to X.G. for highlighting this issue.

Potential misalignment in gene expression data registration leading to incorrect ROI division

Misalignment in gene expression data registration can result in inaccurate ROI division. For example, the original data for tachykinin 2 (Tac2, Exp ID: 72339556) gene expression appears to be slightly shifted to the left. This shift was identified in the original NRRD data (downloaded from the Allen deposit using Divide_ROI_with_gene_expression_data.ipynb). The shift is evident when comparing the Tac2 expression (Left), the anatomical template from the Allen Institute (Middle), and the merged image (Right, with a horizontal line marking brain's midline).

Tac2 CCFv3 merged

A similar observation was made using the Brain Explorer, showing a gene expression in the original reference atlas (Left) and in CCFv3 (Right).

Tac2 & original reference atlas Tac2 & CCFv3

Additional alignment between gene expression data and CCFv3 might be necessary for accurate ROI division, although this correction is not straightforward due to the pre-existing registration of gene expression outlines with CCFv3.
Special thanks to X.G. for reminding this pitfall.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.