NeuraLib2

atlas imaging parser metric utils license

A modular Python toolkit for rodent systems neuroscience research.

NeuraLib2 is a collection of lightweight, modular packages designed for neuroscience data analysis. It is the successor to neuralib, split into focused packages to minimize dependencies and enable case-specific installation.

Atlas Tools

Brain atlas interfaces, 3D visualization, and anatomical data manipulation.

Atlas
Imaging Analysis

Spike inference, image registration, and widefield imaging analysis.

Imaging
Data Parsers

Unified interfaces for segmentation, tracking, and microscopy data.

Parser
Analysis Metrics

Dimensionality reduction, Bayesian decoding, and locomotion analysis.

Metric

Installation

Install only the packages you need:

pip install neuralib-atlas
pip install neuralib-imaging            # Basic
pip install neuralib-imaging[cascade]   # With spike inference
pip install neuralib-imaging[widefield] # With widefield analysis
pip install neuralib-imaging[all]       # All features
pip install neuralib-parser           # Basic
pip install neuralib-parser[suite2p]  # Suite2p support
pip install neuralib-parser[czi]      # CZI format support
pip install neuralib-parser[all]      # All features
pip install neuralib-metric              # Basic
pip install neuralib-metric[rastermap]   # With rastermap
pip install neuralib-metric[all]         # All features
pip install neuralib-utils              # Basic (required by all)
pip install neuralib-utils[dashboard]   # With Bokeh dashboard
pip install neuralib-utils[plot]        # With plotting tools
pip install neuralib-utils[all]         # All features
git clone https://github.com/ytsimon2004/neuralib2.git
cd neuralib2/packages/<package-name>
uv pip install -e .        # Basic
uv pip install -e ".[all]" # With all features

Packages

neuralib-atlas

PyPI · Changelog

Brain atlas tools and hierarchical representations of mouse brain anatomy.

neuralib.atlas

Atlas data access (Allen CCF, Kim, Perens, Princeton)

neuralib.atlas.ccf

Allen Common Coordinate Framework operations

neuralib.atlas.cellatlas

Cell type distributions across brain regions

neuralib.atlas.brainrender

3D brain region visualization

neuralib-imaging

PyPI · Changelog

Cellular imaging and widefield imaging analysis tools.

neuralib.spikes

Spike inference (CASCADE, OASIS deconvolution)

neuralib.registration

Coordinate transformation and atlas alignment

neuralib.widefield

Widefield imaging (FFT, SVD, hemodynamic correction)

neuralib-parser

PyPI · Changelog

Data parsers for neuroscience tools and file formats.

neuralib.cellpose

Cellpose segmentation result parser

neuralib.stardist

StarDist segmentation parser and CLI

neuralib.suite2p

Suite2p imaging data parser

neuralib.scanbox

Scanbox imaging data parser

neuralib.deeplabcut

DeepLabCut tracking parser

neuralib.facemap

Facemap behavioral tracking parser

neuralib.morpho

Neuron morphology (SWC files)

neuralib.scan

Confocal microscopy (Zeiss CZI, LSM)

neuralib-metric

PyPI · Changelog

Analysis metrics and computational modeling tools.

Rastermap

Dimensionality reduction for neural data

Bayesian decoding

Position decoding from neural activity

Locomotion

Locomotion epoch detection

neuralib-utils

PyPI · Changelog

Core utilities and foundational tools. Required by all other packages.

neuralib.io

File I/O (HDF5, JSON, CSV)

neuralib.typing

Unified type system (pandas/polars DataFrames)

neuralib.util

Logging, DataFrame ops, GPU monitoring

neuralib.persistence

Persistence decorator for structured data caching

neuralib.plot

Publication-quality plotting (PSTH, Venn)

neuralib.dashboard

Bokeh-based interactive visualization

neuralib.imglib

Image processing utilities

neuralib.tools

External integrations (Google Sheets, Slack)


Command-Line Tools

nl_brainrender

Visualize brain region data with built-in rendering support. See BrainRender for examples.

nl_brainrender -h

nl_widefield

Widefield imaging CLI analysis. See WideField for examples.

nl_wfield -h

Documentation

Reference


Array Annotation Syntax

Used in documentation to describe array-shaped data structures:

Array[DType, [*Shape]]

  • DType = data type (e.g., int, float, bool)

  • Shape = array shape (e.g., [N, T])

  • | = union of shapes or types

Examples:

  • Array[int|bool, [N, 3]] — Boolean or integer array with shape (N, 3)

  • Array[float, [N, 2] | [N, T, 2]] — Float array with shape (N, 2) or (N, T, 2)


Indices and Tables