Skip to main content

UNKNOWN

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brainatlas-dev.tar.gz (14.4 kB view details)

Uploaded Source

File details

Details for the file brainatlas-dev.tar.gz.

File metadata

  • Download URL: brainatlas-dev.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for brainatlas-dev.tar.gz
Algorithm Hash digest
SHA256 9cb4ad27c7f4d640924dac9c3822a09230306cd0918bceb821d1af013ca0730f
MD5 2178c26fd790155874c2defd32b71557
BLAKE2b-256 a429af407c43c0ded78ee6c7f534a4382a998e5da15472b1d1ad31109bc9afab

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page