Projecting mouse connectivity to the cortical surface

Good morning,

I would like to analyze the mouse connectivity not inside the 3D space but rather on the 2D surface of the cortex. To do so, I need to project the 3D space from the isocortex radially to its external surface.

I found in the Mouse Common Coordinate Framework documentation (available here Documentation - Mouse Connectivity) that a curved cortical coordinate system were made using Laplace equation, then streamlines being computed. These streamlines are exactly what’s needed to do the radial projection from 3D space to the 2D surface.

However I couldn’t find these processing inside the allen sdk api, would you have an idea of whether this is available in the api or how to implement it ?

Thank you very much,
Nathan Vinçon

We recently made public a package to do that projection of cortical coordinates to a flattened surface - it’s available on PyPI, and the documentation is here:

The GitHub page is here:

The documentation pages link to files with the calculated streamlines and other information needed to perform the projections.

1 Like

Thank you for the package. Now I would like to project to a 2D surface that is not deformed (a 2D surface inside a 3D space), for example a 3D mesh.

The idea is to run quantitative analysis, not vizualisation, so I need to be able to have homogeneous surface “parcels”. Do you have any idea how to do this from your package ?

I’m not entirely clear on what you mean; maybe you could give more specifics on what you’re trying to accomplish? Each surface voxel of the isocortex has a streamline associated with it, so I think those are akin to the “parcels” you mention. Depending on what you’re trying to do, we may be able to add that kind of functionality to the ccf_streamlines package.

The voxels belonging to every streamline are in the paths data set in the file surface_paths_10_v3.h5 linked on the data files page. The values in that data structure are the indices of the voxels in the CCF space when that space is reshaped to one dimension; each row of the 2D paths array is a streamline. The first voxel of each streamline is on the surface of the isocortex.

The 2D projection files arrange those streamlines in a spatially coherent way, as if by either viewing the cortex from a particular direction, or by flattening it to see as much of the cortex as possible without tearing, etc.

It’s true that not every streamline is included in a given projection file, but calculations could be done using every streamline - the question then is how to organize those results in a useful way (other than spatially in 2D).

What I’m trying to do, is to compute the connectivity not between brain areas, which we consider “too big”, but rather between smaller spatial zones (what I called “parcels” before). In other word, we want to integrate the connectivity density along the radial axis in order to analyze “parcels” of any given size (e.g. 100, 1000 etc). To do so, streamlines are a perfect tool because they allow to project any neuron inside the isocortex volume to the surface of the isocortex.

However, as we want to run quantitative analysis, we need to make sure that these parcels have homogeneous size (i.e. the 100 or 1000 parcels have the same surface). I think the actual view lookups are deforming the surface and therefore cannot be used for quantitative purposes. Is it clearer now ?

Thank you very much for your help

Yes, that clarifies things a lot - thanks!

I think the questions that would be helpful for building functions that would be useful to you are:

  • What format of data would you be using as inputs? (e.g., 3D volumes, 3D coordinates)
  • What operations need to be done per streamline (e.g., sum, average, minimum/maximum value)?
  • What would be useful outputs for you? If we assign a per-streamline summary value to the first voxel of the streamline in 3D space (i.e., the point on the cortical surface associated with that streamline), we could represent that as a set of 3D coordinates, a sparse 3D volume, etc.

Data in different formats can be converted to each other, of course, but it probably makes sense to use something that doesn’t require a lot of extra work on either end.

The input data will be a 3D volume (from MouseConnectivityCache.get_projection_density), the operation will be a sum and the best output format I think could be a set of 3D coordinates with the related metadata such as the surface aggregated / volume integrated.

Sounds good - I’ll work up something that can do that kind of operation for every streamline. I think the grouping of streamlines into “parcels” is probably outside the scope for the package, but the goal would be to provide output that could then be grouped by someone like you based on whatever methods you like.

I’ve updated ccf_streamlines to version 1.1, which adds the IsocortexEntireProjector class. You can read about it in the User’s Guide. Here’s an example of summing all the streamlines of a connectivity atlas volume:

(I’m actually only plotting a tenth of the points so the graphic renders faster, but all ~1.5M streamlines have values.)

Thank you very much !