Skip to main content
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 1.0

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 1.0
File Size Uploaded
brainatlas-1.0.tar.gz 14.4 kB Details

Release files / brainatlas-1.0.tar.gz

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

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

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