Skip to content
Data processing pipeline for Allen Institute for Brain Science voxel connectivity data
Jupyter Notebook Python MATLAB
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
2d connectivity.ipynb
errors in projection.ipynb
matrices test.ipynb


Tools for working with Allen Institute for Brain Science voxel-scale connectivity data.


  • numpy
  • scipy
  • h5py
  • allensdk (tested with 0.13.1, NOT guaranteed to work with later versions)
  • skimage, mayavi (optional, for visualization)

To fit connectomes:

Generating a voxel linear model

  1. Edit This sets which structures will be included, the values of the regularization parameter, etc.
  2. python This will create a hierarchy of directories for model fitting with nested cross-validation.
  3. Run the commands in model_fitting_cmds (located in the project directory) to perform the model fits.
  4. Run python In the inner cross-validation loop, evaluate the errors and perform model selection.
  5. Run the commands in model_fitting_after_selection_cmds. This will fit the selected models.
  6. Run python This will both evaluate the errors of the voxel models as well as fit regional models and compare their errors to the voxel models.

Visualizing voxel model

  1. Run python This performs fake injections into VISp, plotting the results. Also saves volumetric data & region labeled plot.
  2. You can turn the virtual injection pictures into a movie easily: avconv -q 4 -r 7 -b 9600 -i int_virt_inj%d.png movie.mp4
  3. You can visualize the volumetric data in VTK format (.vti files). Use Paraview.

Generating a regional model

First edit the following scripts to set the data and output directories, then run:


If you want to compare the output of this model to that from Oh et al. (2014), this can be accomplished with

Flat cortex 2-D connectivity

Run in this order:

Note that the streamlines needed to generate top view and flatmap 2-D cortical projections are available from CCF 2017 informatics.

You can’t perform that action at this time.