Giter Club home page Giter Club logo

atlas-commons's Introduction

Overview

This project contains the common functions used in the context of brain atlases. It is used by the projects:

Installation

git clone https://github.com/BlueBrain/atlas-commons
cd atlas-commons
pip install -e .

Examples

Create a mask for the region defined by query

from atlas_commons import utils
from voxcell.nexus.voxelbrain import Atlas

# see voxcell documentation for more more information
atlas = Atlas.open('.')
annotation = atlas.load_data('brain_regions')
region_map = atlas.load_region_map()

region = {
    "query": "Isocortex",
    "attribute": "acronym",
    "with_descendants": True,
}
mask = utils.query_region_mask(region, annotation, region_map)

Split input 3D volume into two halves using the middle plane orthogonal to the z-axis

from atlas_commons import utils
import numpy as np

volume = np.array(
    [
        [[0, 1, 2], [2, 3, 4]],
        [[4, 5, 6], [7, 8, 9]],
    ],
    dtype=np.int64,
)
halves = utils.split_into_halves(volume)

Instructions for developers

Run the following commands before submitting your code for review:

cd atlas-commons
isort -l 100 --profile black atlas_commons tests setup.py
black -l 100 atlas_commons tests setup.py

These formatting operations will help you pass the linting check testenv:lint defined in tox.ini.

Acknowledgements

The development of this software was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH Board of the Swiss Federal Institutes of Technology.

For license and authors, see LICENSE.txt and AUTHORS.txt respectively.

Copyright © 2022 Blue Brain Project/EPFL

atlas-commons's People

Contributors

mgeplf avatar lguyot avatar

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.