Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

A python interface to the rat brain atlas

Purpose
-------
Using the rat brain atlas...
1) construct 3d point clouds of various brain regions
2) lookup the area for a given location (ML, DV, AP coordinate)
3) grab the containing section image for a given location
4) plot a location on a flattened cortical surface


Installation details
--------------------
Due to copyright reasons, this module does not contain the eps files
from the cd that comes with the rat brain atlas. These files are
however required for the module to function.

You can either pass in the path of the eps files to the necessary
functions (such as Section.__init__) or copy the eps files
(of at least the coronal sections) to atlas/eps.

How to
------

get the section index for the containing section
>>> pyatlas.py section 6.5 3.5 -7

plot a location on a section (show and save the plot)
>>> pyatlas.py section 6.5 3.5 -7 -ps

get the area for a location
>>> pyatlas.py area 6.5 3.5 -7

get a point cloud of an area (saved to meshes/<area>.asc) [takes a while]
>>> pyatlas.py points V2L -m

plot a location on a flattened cortex
>>> pyatlas.py cortex 6.5 3.5 -7 -ps

Several calls to plot on a flattened cortical surface will go much faster
if the area points are recomputed like so
>>> pyatlas.py area -p area.p
>>> pyatals.py cortex <ML> <DV> <AP> -A area.p


Notes
-----
this is buggy and hacky as all heck

what I wanted was to generate a 3d mesh of a selected brain area from a stack of labeled brain atlas images

Steps:
1) take eps files of a brain atlas
2) find location of a selected area label within each eps file
3) render eps file to bitmap format
4) find pixels that correspond to the border of the selected area
5) map image to brain coordinates
6) output 3d brain coordinates for border of selected area at each slice
7) use meshlab to generate mesh from points

this is terribly hacky and relied on:
3) manually generating the mesh using ball-pivoting in meshlab

what I would really like is to
2) make a more flexible mapping for all atlas slices
3) automatically generate mesh

Meshlab
-------
1) load in a points file for an area (ex: V1.asc)
2) simplify the points:
Filter -> Cleaning -> Merge: ~.05 world units
3) save as mesh (ex: .ply)
4) reload
3) mesh the points:
Filter -> Remeshing -> Surface Reconstruction (ball pivoting): ~.5 world units (or .7 for V2L)
5) close holes
5) smooth:
Filter -> Smoothing -> Laplace Smooth: 2 iterations
6) save as mesh (ex: .ply)

Metadata

Release files for brainatlas dev

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brainatlas dev
File Size Uploaded Provenance Actions
brainatlas-dev.tar.gz 14.4 kB Without provenance Details for brainatlas-dev.tar.gz

Release files / brainatlas-dev.tar.gz

Download URL brainatlas-dev.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9cb4ad27c7f4d640924dac9c3822a09230306cd0918bceb821d1af013ca0730f
BLAKE2b-256 checksum
How to use checksums
a429af407c43c0ded78ee6c7f534a4382a998e5da15472b1d1ad31109bc9afab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for brainatlas dev

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page