bmtk.builder.auxi package

Submodules

bmtk.builder.auxi.edge_connectors module

bmtk.builder.auxi.edge_connectors.connect_random(source, target, nsyn_min=0, nsyn_max=10, distribution=None)[source]
bmtk.builder.auxi.edge_connectors.distance_connector(source, target, d_weight_min, d_weight_max, d_max, nsyn_min, nsyn_max)[source]

bmtk.builder.auxi.node_params module

bmtk.builder.auxi.node_params.plot_positions(x, y, z, ax, labels)[source]
bmtk.builder.auxi.node_params.positions_columinar(N=1, center=[0.0, 50.0, 0.0], height=100.0, min_radius=0.0, max_radius=1.0, plot=False)[source]

Returns a set of random x,y,z coordinates within a given cylinder or cylindrical ring. Height is given as the y (index 1) coordinates.

Parameters
  • N – Number of points to return

  • center – center of sphere

  • height – maximum length of sphere (y coord)

  • min_radius – minimum horizontal radius on x-z plane

  • max_radius – maximum horizontal radius on x-z plane

Returns

A (N, 3) matrix

bmtk.builder.auxi.node_params.positions_columnar(N=1, center=[0.0, 50.0, 0.0], height=100.0, min_radius=0.0, max_radius=1.0, plot=False)

Returns a set of random x,y,z coordinates within a given cylinder or cylindrical ring. Height is given as the y (index 1) coordinates.

Parameters
  • N – Number of points to return

  • center – center of sphere

  • height – maximum length of sphere (y coord)

  • min_radius – minimum horizontal radius on x-z plane

  • max_radius – maximum horizontal radius on x-z plane

Returns

A (N, 3) matrix

bmtk.builder.auxi.node_params.positions_cuboid(N=1, center=[0.0, 0.0, 0.0], height=100.0, xside_length=100.0, yside_length=100.0, min_dist=20.0, plot=False)[source]

This function distributes the cells in a 3D cuboid (x,y,z sides may have different lengths). The method used assures cells cannot be placed too close to one another (must be > min_dist apart) WARNING: If cell density is high and there is more than 1 population of cells, there is a high chance cells will be placed on top of one another. You can use positions_list() to avoid this…

Written by Ben Latimer at University of Missouri (latimerb@missouri.edu)

Returns

A (N, 3) matrix

bmtk.builder.auxi.node_params.positions_density_matrix(mat, position_scale=array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]), plot=False, CCF_orientation=False)[source]

This function places random x,y,z coordinates according to a supplied 3D array of densities (cells/mm^3). The optional position_scale parameter defines a transformation matrix A to physical space such that: [x_phys, y_phys, z_phys] = A * [x_mat, y_mat, z_mat]

Note: position_scale and output coordinates are in units of microns, while density is specified in mm^3.

Parameters
Returns

A (N, 3) matrix (microns)

bmtk.builder.auxi.node_params.positions_ellipsoid(N=1, center=[0.0, 50.0, 0.0], height=50, x_length=100.0, z_length=200.0, plot=False)[source]

Returns a set of random x,y,z coordinates within an ellipsoid. Height is given as the y (index 1) coordinates.

Parameters
  • N – Number of points to return

  • center – center of ellipsoid

  • height – height of ellipsoid (y-coordinate)

  • x_length – length of ellipsoid in x

  • z_length – length of ellipsoid in z

Returns

A (N, 3) matrix

bmtk.builder.auxi.node_params.positions_list(positions=array([[0, 0, 0], [0, 0, 1]]))[source]

This function is designed to be used with an externally supplied array of x,y,z coordinates. It is useful to avoid cell overlap in high density situations or to make some unique geometry. After you create each population, delete those positions from the “master” list of coordinates. This will assure that no cells are placed on top of one another.

Written by Ben Latimer at University of Missouri (latimerb@missouri.edu)

Parameters

positions

Returns

bmtk.builder.auxi.node_params.positions_nrrd(nrrd_filename, max_dens_per_mm3, split_bilateral=None, plot=False)[source]

Generates random cell positions based on a *.nrrd file. Matrix values are interpreted as cell densities for each voxel. The maximum density is scaled to max_dens_per_mm3 (cells/mm^3). If the *.nrrd file is a structural mask, cells will be placed uniformly at max_dens_per_mm3 within the structure geometry. By default, only one hemisphere is shown, but this can be disabled by setting bilateral=True.

Parameters
  • nrrd_filename – path to *.nrrd file

  • max_dens_per_mm3 – desired density at maximum value of nrrd array (cells/mm^3)

  • split_bilateral – return only unilateral structure by removing half of the array along the given axis. If no splitting is desired, pass in None

Returns

A (N, 3) matrix (microns)

bmtk.builder.auxi.node_params.positions_rect_prism(N=1, center=[0.0, 50.0, 0.0], height=20.0, x_length=100.0, z_length=100.0, plot=False)[source]

Returns a set of random x,y,z coordinates within a rectangular prism. Height is given as the y (index 1) coordinates.

Parameters
  • N – Number of points to return

  • center – center of rectangular prism

  • height – height of prism (y-coordinate)

  • x_length – length of prism in x

  • z_length – length of prism in z

Returns

A (N, 3) matrix

bmtk.builder.auxi.node_params.xiter_random(N=1, min_x=0.0, max_x=1.0)[source]

Module contents