Models module

class bsb.models.CellType(name, placement=None)[source]

A CellType represents a population of cells.

list_all_morphologies()[source]

Return a list of all the morphology identifiers that can represent this cell type in the simulation volume.

place()[source]

Place this cell type.

set_morphology(morphology)[source]

Set the Morphology class for this cell type.

Parameters

morphology (Instance of a subclass of scaffold.morphologies.Morphology) – Defines the geometrical constraints for the axon and dendrites of the cell type.

set_placement(placement)[source]

Set the placement strategy for this cell type.

validate()[source]

Check whether this CellType is valid to be used in the simulation.

class bsb.models.ConnectivitySet(handler, tag)[source]

Connectivity sets store connections.

property connection_types

Return all the ConnectionStrategies that contributed to the creation of this connectivity set.

property connections

Return a list of Intersections. Connections contain pre- & postsynaptic identifiers.

property from_identifiers

Return a list with the presynaptic identifier of each connection.

get_postsynaptic_types()[source]

Return a list of the postsynaptic cell types found in this set.

get_presynaptic_types()[source]

Return a list of the presynaptic cell types found in this set.

has_compartment_data()[source]

Check if compartment data exists for this connectivity set.

property intersections

Return a list of Intersections. Intersections contain pre- & postsynaptic identifiers and the intersecting compartments.

property meta

Retrieve the metadata associated with this connectivity set. Returns None if the connectivity set does not exist.

Returns

Metadata

Return type

dict

property to_identifiers

Return a list with the postsynaptic identifier of each connection.

class bsb.models.Layer(name, origin, dimensions, scaling=True)[source]

A Layer represents a compartment of the topology of the simulation volume that slices the volume in horizontally stacked portions.

scale_to_reference()[source]

Compute scaled layer volume

To compute layer thickness, we scale the current layer to the combined volume of the reference layers. A ratio between the dimension can be specified to alter the shape of the layer. By default equal ratios are used and a cubic layer is obtained (given by dimension_ratios).

The volume of the current layer (= X*Y*Z) is scaled with respect to the volume of reference layers by a factor volume_scale, so:

X*Y*Z = volume_reference_layers / volume_scale [A]

Supposing that the current layer dimensions (X,Y,Z) are each one depending on the dimension Y according to dimension_ratios, we obtain:

X*Y*Z = (Y*dimension_ratios[0] * Y * (Y*dimension_ratios[2]) [B] X*Y*Z = (Y^3) * prod(dimension_ratios) [C]

Therefore putting together [A] and [C]: (Y^3) * prod(dimension_ratios) = volume_reference_layers / volume_scale

from which we derive the normalized_size Y, according to the following formula:

Y = cubic_root((volume_reference_layers * volume_scale) / prod(dimension_ratios))

class bsb.models.PlacementSet(handler, cell_type)[source]

Fetches placement data from storage. You can either access the parallel-array datasets .identifiers, .positions and .rotations individually or create a collection of Cells that each contain their own identifier, position and rotation.

Note

Use core.get_placement_set() to correctly obtain a PlacementSet.

property cells

Reorganize the available datasets into a collection of Cells

property identifiers

Return a list of cell identifiers.

property positions

Return a dataset of cell positions.

property rotations

Return a dataset of cell rotations.

Raises

DatasetNotFoundError when there is no rotation information for this cell type.