ibllib.atlas.regions

Functions

regions_from_allen_csv

Reads csv file containing the ALlen Ontology and instantiates a BrainRegions object :return: BrainRegions object

Classes

BrainRegions

The Allen atlas ids are kept intact but lateralized as follows: labels are duplicated and ids multiplied by -1, with the understanding that left hemisphere regions have negative ids.

FranklinPaxinosRegions

class FranklinPaxinosRegions[source]

Bases: _BrainRegions

id: ndarray
name: object
acronym: object
rgb: uint8
level: ndarray
parent: ndarray
order: uint16
class BrainRegions(brainmap='Allen')[source]

Bases: _BrainRegions

The Allen atlas ids are kept intact but lateralized as follows: labels are duplicated and ids multiplied by -1, with the understanding that left hemisphere regions have negative ids.

compute_hierarchy()[source]

Creates a self.hierarchy attributes that is a n_levels by n_region array of indices. This is useful to perform fast vectorized computations of ancestors and descendants. :return:

remap(region_ids, source_map='Allen', target_map='Beryl')[source]

Remap atlas regions ids from source map to target map

Parameters
  • region_ids – atlas ids to map

  • source_map – map name which original region_ids are in

  • target_map – map name onto which to map

Returns

id: ndarray
name: object
acronym: object
rgb: uint8
level: ndarray
parent: ndarray
order: uint16
regions_from_allen_csv()[source]

Reads csv file containing the ALlen Ontology and instantiates a BrainRegions object :return: BrainRegions object