plugins¶
Plugins subpackage.
It includes all science related features and optional components.
atlas¶
- class AtlasColumnHighlight(position: ~brayns.plugins.atlas.ColumnPosition, color: ~brayns.utils.color.Color4, neighbors: list[~brayns.plugins.atlas.ColumnNeighbor] = <factory>)¶
Bases:
AtlasUsecase
Place a column and (optionally) its neighbors.
Columns are always aligned on the Y axis so their position uses only XZ.
- Parameters:
position (ColumnPosition) – Column coordinates.
color (Color4) – Color to apply to the column.
neighbors (list[ColumnNeighbor], optional) – Neighbors to color, defaults to empty.
- get_properties() dict[str, Any] ¶
Low level API.
- class property name: str¶
Low level API.
- neighbors: list[ColumnNeighbor]¶
- position: ColumnPosition¶
- class AtlasDensity¶
Bases:
AtlasUsecase
Display the volume density.
The relation between the density and the color can be changed using the color ramp of the model created.
- get_properties() dict[str, Any] ¶
Low level API.
- class property name: str¶
Low level API.
- class AtlasDistanceType(value)¶
Bases:
Enum
Type of distance displayed for an atlas layer.
- Params LOWER:
Distance of the current layer from the one below.
- Params UPPER:
Distance of the current layer from the one above.
- LOWER = 'lower'¶
- UPPER = 'upper'¶
- class AtlasFlatmapAreas¶
Bases:
AtlasUsecase
Display the volumne flatmap areas.
- get_properties() dict[str, Any] ¶
Low level API.
- class property name: str¶
Low level API.
- class AtlasLayerDistance(distance_type: AtlasDistanceType)¶
Bases:
AtlasUsecase
Display the volume as the distance of a layer from its neighbors.
- distance_type: AtlasDistanceType¶
- get_properties() dict[str, Any] ¶
Low level API.
- class property name: str¶
Low level API.
- class AtlasOrientationField¶
Bases:
AtlasUsecase
Display the volume data as an orientation field.
- get_properties() dict[str, Any] ¶
Low level API.
- class property name: str¶
Low level API.
- class AtlasShellOutline¶
Bases:
AtlasUsecase
Display the volume using its shell outline.
This is the default atlas volume usecase and is always supported.
- get_properties() dict[str, Any] ¶
Low level API.
- class property name: str¶
Low level API.
- class AtlasUsecase¶
Bases:
ABC
Base class for all atlas visualization usecases.
- abstract get_properties() dict[str, Any] ¶
Low level API.
- abstract class property name: str¶
Low level API.
- class ColumnNeighbor(position: ColumnPosition, color: Color4)¶
Bases:
object
Column neighbor position and color.
The position is relative to the main column coordinates.
- position: ColumnPosition¶
- class ColumnPosition(x: int = 0, z: int = 0)¶
Bases:
Vector
[int
]Column position XZ.
- Parameters:
x (float) – X component.
z (float) – Z component.
- property x: float¶
- property z: float¶
- get_atlas_usecases(instance: Instance, model_id: int) list[tuple[str, JsonSchema]] ¶
Return the list of visualization usecases supported by an atlas volume.
- Parameters:
instance (Instance) – Instance.
model_id (int) – ID of the atlas volume model.
- Returns:
Names of the supported usecase (see
AtlasUsecase.name
)- Return type:
list[str]
cell_placement¶
- class CellPlacementLoader(morphologies_folder: str = '', density: float = 1.0, extension: str | None = None, ids: list[int] | None = None, morphology: Morphology = <factory>)¶
Bases:
Loader
Partial circuit loader.
Loads the cells from the circuit builder intermediate files.
To load morphologies, a base folder must be specified as the H5 file only contains filenames.
- Parameters:
morphologies_folder (str) – Path to the folder containing the morphologies.
density (float, optional) – Density of morphologies to load [0-1].
extension (str | None, optional) – Morphology file extension (will be guessed from folder if empty).
ids (list[str] | None, optional) – IDs of the nodes to load, overrides density if not None.
morphology (Morphology, optional) – Morphology settings.
- density: float = 1.0¶
- extension: str | None = None¶
- get_properties() dict[str, Any] ¶
Low level API to serialize to JSON.
- ids: list[int] | None = None¶
- morphologies_folder: str = ''¶
- morphology: Morphology¶
- class property name: str¶
Get the loader name.
Can be compared with
LoaderInfo.name
.- Returns:
Loader name.
- Return type:
str
circuit¶
- class CircuitColorMethod¶
Bases:
object
Available coloring methods for circuits.
- ETYPE: ClassVar[str] = 'etype'¶
- HEMISPHERE: ClassVar[str] = 'hemisphere'¶
- ID: ClassVar[str] = 'id'¶
- LAYER: ClassVar[str] = 'layer'¶
- MORPHOLOGY: ClassVar[str] = 'morphology'¶
- MORPHOLOGY_CLASS: ClassVar[str] = 'morphology class'¶
- MORPHOLOGY_SECTION: ClassVar[str] = 'morphology section'¶
- MTYPE: ClassVar[str] = 'mtype'¶
- REGION: ClassVar[str] = 'region'¶
- SUBREGION: ClassVar[str] = 'subregion'¶
- SYNAPSE_CLASS: ClassVar[str] = 'synapse class'¶
- get_circuit_ids(instance: Instance, model_id: int) list[int] ¶
Retreive the list of loaded neurons / astrocytes / vasculatures by ID.
- Parameters:
instance (Instance) – Instance.
model_id (int) – ID of the circuit model.
- Returns:
ID list of the element loaded in given circuit.
- Return type:
list[int]
- set_circuit_thickness(instance: Instance, model_id: int, radius_multiplier: float) None ¶
Multiply the radius of all primitives of a circuit by given factor.
- Parameters:
instance (Instance) – Instance.
model_id (int) – Circuit model ID.
radius_multiplier (float) – Scaling factor for capsules and spheres.
morphology¶
- class GeometryType(value)¶
Bases:
Enum
Type of geometry to use when loading a morphology.
- Parameters:
ORIGINAL – Use raw geometries dimensions.
SMOOTH – Smooth radius changes between geometries for better visual.
SECTION_SMOOTH – Smooth radius change between whole sections.
CONSTANT_RADII – Apply the same radius to all geometries.
- CONSTANT_RADII = 'constant_radii'¶
- ORIGINAL = 'original'¶
- SECTION_SMOOTH = 'section_smooth'¶
- SMOOTH = 'smooth'¶
- SPHERES = 'spheres'¶
- class Morphology(radius_multiplier: float = 1.0, load_soma: bool = False, load_axon: bool = False, load_dendrites: bool = False, geometry_type: GeometryType = GeometryType.SMOOTH, resampling: float = 2, subsampling: int = 1)¶
Bases:
object
Describe how to load a morphology.
If no sections are selected (default), a sphere of
radius_multiplier
is used.- Parameters:
radius_multiplier (float, optional) – Radius scaling, defaults to 1.
load_soma (bool, optional) – Wether to load somas, defaults to False.
load_axon (bool, optional) – Wether to load axons, defaults to False.
load_dendrites (bool, optional) – Wether to load dendrites, defaults to False.
geometry_type (GeometryType, optional) – How to load geometries, defaults to smooth.
resampling (float, optional) – Min cos of angle between two segments to merge them (disabled if > 1).
subsampling (int, optional) – Step factor to skip morphology samples.
- static full() Morphology ¶
Return settings to load all sections of a morphology.
- Returns:
Morphology: Settings for full morphology loading.
- geometry_type: GeometryType = 'smooth'¶
- load_axon: bool = False¶
- load_dendrites: bool = False¶
- load_soma: bool = False¶
- radius_multiplier: float = 1.0¶
- resampling: float = 2¶
- subsampling: int = 1¶
- class MorphologyColorMethod¶
Bases:
object
Available coloring methods for morphologies.
- MORPHOLOGY_SECTION: ClassVar[str] = 'morphology section'¶
- MORPHOLOGY_SECTION_GEOMETRY: ClassVar[str] = 'morphology section geometry'¶
- class MorphologyLoader(morphology: ~brayns.plugins.morphology.Morphology = <factory>)¶
Bases:
Loader
Loader for morphology files.
- Parameters:
morphology (Morphology, optional) – How to load the morphologies, default constructed.
- ASC: ClassVar[str] = 'asc'¶
- H5: ClassVar[str] = 'h5'¶
- SWC: ClassVar[str] = 'swc'¶
- get_properties() dict[str, Any] ¶
Low level API to serialize to JSON.
- morphology: Morphology¶
- class property name: str¶
Get the loader name.
Can be compared with
LoaderInfo.name
.- Returns:
Loader name.
- Return type:
str
nrrd¶
- class NrrdLoader(voxel_type: VoxelType)¶
Bases:
Loader
Loader for NRRD volumes.
- Parameters:
voxel_type (VoxelType) – Defines the representation of the volume voxels.
- NRRD: ClassVar[str] = 'nrrd'¶
- get_properties() dict[str, Any] ¶
Low level API to serialize to JSON.
- class property name: str¶
Get the loader name.
Can be compared with
LoaderInfo.name
.- Returns:
Loader name.
- Return type:
str
- class VoxelType(value)¶
Bases:
Enum
Defines the representation of the voxels of an NRRD volume.
- Parameters:
SCALAR – Each voxel holds a single scalar value.
ORIENTATION – Each voxel holds a quaternion (orientation field).
FLATMAP – Each voxel is a pair of integer.
- FLATMAP = 'flatmap'¶
- ORIENTATION = 'orientation'¶
- SCALAR = 'scalar'¶
sonata¶
- class SonataEdgePopulation(name: str, afferent: bool, density: float = 1.0, radius: float = 2.0, report: str | None = None)¶
Bases:
object
SONATA edge population parameters.
- Parameters:
name (str) – Population name.
afferent (bool) – If these edges are afferent or efferent ones.
afferent – If these edges are afferent ones.
density (float, optional) – Proportion of edges to load, defaults to 1.
radius (float, optional) – Edge radii, defaults to 2.
report (str | None, optional) – Report name, defaults to None.
- afferent: bool¶
- density: float = 1.0¶
- name: str¶
- radius: float = 2.0¶
- report: str | None = None¶
- class SonataLoader(node_populations: list[SonataNodePopulation])¶
Bases:
Loader
Loader for SONATA circuit files.
- Parameters:
node_populations (list[SonataNodePopulation]) – Nodes to load.
- JSON: ClassVar[str] = 'json'¶
- get_properties() dict[str, Any] ¶
Low level API to serialize to JSON.
- class property name: str¶
Get the loader name.
Can be compared with
LoaderInfo.name
.- Returns:
Loader name.
- Return type:
str
- node_populations: list[SonataNodePopulation]¶
- class SonataNodePopulation(name: str, nodes: SonataNodes = <factory>, report: SonataReport | None = None, edges: list[SonataEdgePopulation] | None = None, morphology: Morphology = <factory>, vasculature_radius_multiplier: float = 1.0)¶
Bases:
object
SONATA node population parameters.
- Parameters:
name (str) – Population name.
nodes (SonataNodes, optional) – Nodes to load, defaults to 0.01% of all nodes.
report (SonataReport | None, optional) – Report to load, defaults to None.
edges (list[SonataEdgePopulation] | None, optional) – Edges to load, defaults to None.
morphology (Morphology, optional) – How to load the morphologies, default constructed.
vasculature_radius_multiplier (float, optional) – Vasculature scale, defaults to 1.
- edges: list[SonataEdgePopulation] | None = None¶
- morphology: Morphology¶
- name: str¶
- nodes: SonataNodes¶
- report: SonataReport | None = None¶
- vasculature_radius_multiplier: float = 1.0¶
- class SonataNodes(density: float | None = None, names: list[str] | None = None, ids: list[int] | None = None, node_count_limit: int | None = None)¶
Bases:
object
Specify how to load SONATA nodes.
Use one of the factory methods to create this object.
- static all() SonataNodes ¶
Load all nodes.
- static default() SonataNodes ¶
Load a reasonable proportion of nodes.
- density: float | None = None¶
- static from_density(density: float) SonataNodes ¶
Load a proportion of all nodes (0 = none, 1 = all).
- static from_ids(ids: list[int]) SonataNodes ¶
Load nodes with given IDs.
- static from_names(names: list[str], density: float = 1.0) SonataNodes ¶
Load from node group names with optional density.
- ids: list[int] | None = None¶
- limit(node_count_limit: int) SonataNodes ¶
Limit the number nodes to be loaded.
- names: list[str] | None = None¶
- node_count_limit: int | None = None¶
- class SonataReport(type: SonataReportType, name: str | None = None, spike_transition_time: float | None = None)¶
Bases:
object
Describe a SONATA report to load.
Use one of the factory methods to create this object.
- static bloodflow_pressure(name: str) SonataReport ¶
Bloodflow pressure report with given name.
- static bloodflow_radii(name: str) SonataReport ¶
Bloodflow radii report with given name.
- static bloodflow_speed(name: str) SonataReport ¶
Bloodflow speed report with given name.
- static compartment(name: str) SonataReport ¶
Compartment report with given name.
- name: str | None = None¶
- static none() SonataReport ¶
No report to load.
- spike_transition_time: float | None = None¶
- static spikes(spike_transition_time: float = 1.0) SonataReport ¶
Spike report with transition time (units from report).
- static summation(name: str) SonataReport ¶
Simulation report with given name.
- static synapse(name: str) SonataReport ¶
Synapse report with given name.
- type: SonataReportType¶
- class SonataReportType(value)¶
Bases:
Enum
All available SONATA report types.
- BLOODFLOW_PRESSURE = 'bloodflow_pressure'¶
- BLOODFLOW_RADII = 'bloodflow_radii'¶
- BLOODFLOW_SPEED = 'bloodflow_speed'¶
- COMPARTMENT = 'compartment'¶
- NONE = 'none'¶
- SPIKES = 'spikes'¶
- SUMMATION = 'summation'¶
- SYNAPSE = 'synapse'¶