ibllib.atlas.flatmaps

Module that hold techniques to project the brain volume onto 2D images for visualisation purposes

Functions

annotate_swanson

Display annotations on the flatmap

circles

param N

number of circles

plot_swanson

Displays the 2D image corresponding to the swanson flatmap.

swanson

circles(N=5, atlas=None, display='flat')[source]
Parameters
  • N – number of circles

  • atlas – brain atlas at 25 m

  • display – “flat” or “pyramid”

Returns

2D map of indices, ap_coordinate, ml_coordinate

swanson(filename='swanson2allen.npz')[source]
plot_swanson(acronyms=None, values=None, ax=None, hemisphere=None, br=None, orientation='landscape', annotate=False, empty_color='silver', **kwargs)[source]

Displays the 2D image corresponding to the swanson flatmap. This case is different from the others in the sense that only a region maps to another regions, there is no correspondency from the spatial 3D coordinates.

Parameters
  • acronyms

  • values

  • hemisphere – hemisphere to display, options are ‘left’, ‘right’, ‘both’ or ‘mirror’

  • br – ibllib.atlas.BrainRegions object

  • ax – matplotlib axis object to plot onto

  • orientation – ‘landscape’ (default) or ‘portrait’

  • annotate – (False) if True, labels regions with acronyms

  • empty_color – (grey) matplotlib color code or rgb_a int8 tuple defining the filling of brain regions not provided. Defaults to ‘silver’

  • kwargs – arguments for imshow

Returns

annotate_swanson(ax, acronyms=None, orientation='landscape', br=None, **kwargs)[source]

Display annotations on the flatmap

Parameters
  • ax

  • acronyms – (None) list or np.array of acronyms or allen region ids. If None plot all.

  • orientation

  • br – BrainRegions object

  • kwargs – arguments for the annotate function

Returns