Skip to contents

Generates a cross section of a cylinder bundle with a given density and voxel size. The cross section is generated by simulating a random distribution of cylinders and computing the intersection of the cylinders with a plane. The radii of the cylinders are drawn from a Gamma distribution fitted from data retrieved by histology in the genu of the corpus callosum (Aboitiz et al., 1992). The number of cylinders is determined by the density and the voxel size.

Usage

simulate_bundle(
  density = 0.5,
  voxel_size = 10,
  rel_tol = 0.001,
  verbose = FALSE
)

Arguments

density

A numeric value between 0 and 1 specifying the density of the cylinders in the voxel. Defaults to 0.5.

voxel_size

A numeric value specifying the size of the voxel in micro- meters. Defaults to 10.

rel_tol

A numeric value specifying the relative tolerance to reach the target volume defined as density * voxel_size^2. Defaults to 1e-3.

verbose

A logical value specifying whether to print messages. Defaults to FALSE.

Value

A list with the following components:

  • sections: A numeric matrix with 3 columns:

    • x: The x-coordinates of the centers of the cylinders;

    • y: The y-coordinates of the centers of the cylinders;

    • r: The radii of the cylinders in micrometers.

  • voxel_size: The size of the voxel in micrometers

References

Aboitiz, F., Scheibel, A. B., Fisher, R. S., & Zaidel, E. (1992). Fiber composition of the human corpus callosum. Brain research, 598(1-2), 143-153.

Examples

density <- 0.5
voxel_size <- 5 # micrometers
withr::with_seed(1234, {
  out <- simulate_bundle(density, voxel_size)
})

# Actual density in the simulated substrate
sum(out$sections[, "r"]^2 * pi) / voxel_size^2
#> [1] 0.4996497