synthesis_workflow.circuit

Functions for slicing mvd3 circuit files to place specific cells only.

Functions

create_boundary_mask(atlas_dir, region[, ...])

Create a mask on an atlas to to select voxels away from boundary with some voxel distance.

get_regions_from_composition(cell_composition_path)

Get list of region regex from cell_composition.

build_circuit(cell_composition_path, ...[, ...])

Builds a new circuit by calling brainbuilder.app.cells._place.

circuit_slicer(cells, n_cells[, mtypes, planes, ...])

Selects n_cells mtype in mtypes.

slice_circuit(input_circuit, output_circuit, slicer)

Slices a circuit file using a slicing function.

_get_principal_direction(points)

Return the principal direction of a point cloud.

get_centerline_bounds(layer)

Find centerline bounds using PCA of the voxell position of a given layer in the region.

get_local_bbox(annotation)

Compute bbox where annotation file is strictly positive.

get_layer_tags(atlas_dir, region_structure_path[, region])

Create a VoxelData with layer tags.

Module Contents

create_boundary_mask(atlas_dir, region, boundary_thickness=10)

Create a mask on an atlas to to select voxels away from boundary with some voxel distance.

get_regions_from_composition(cell_composition_path)

Get list of region regex from cell_composition.

build_circuit(cell_composition_path, mtype_taxonomy_path, atlas_path, density_factor=0.01, mask=None, seed=None, region=None)

Builds a new circuit by calling brainbuilder.app.cells._place.

Based on YAML cell composition recipe, build a circuit as MVD3 file with:
  • cell positions

  • required cell properties: ‘layer’, ‘mtype’, ‘etype’

  • additional cell properties prescribed by the recipe and / or atlas

circuit_slicer(cells, n_cells, mtypes=None, planes=None, hemisphere=None)

Selects n_cells mtype in mtypes.

slice_circuit(input_circuit, output_circuit, slicer)

Slices a circuit file using a slicing function.

Parameters:
  • input_circuit (str) – path to input file

  • output_circuit (str) – path to output file

  • slicer (function) – function to slice the cells dataframe

_get_principal_direction(points)

Return the principal direction of a point cloud.

It is the eigen vector of the covariance matrix with the highest eigen value. Taken from neuror.unravel.

get_centerline_bounds(layer)

Find centerline bounds using PCA of the voxell position of a given layer in the region.

get_local_bbox(annotation)

Compute bbox where annotation file is strictly positive.

get_layer_tags(atlas_dir, region_structure_path, region=None)

Create a VoxelData with layer tags.