navis 1.4.0
  • Install
  • Quickstart
  • Tutorials
  • API
  • Changelog
  • Github
  • Ecosystem
  • Site
    • Page
        • navis.voxelize
          • voxelize()

    navis.voxelize¶

    navis.voxelize(x, pitch, bounds=None, counts=False, vectors=False, alphas=False, smooth=0)[source]¶

    Turn neuron into voxels.

    Parameters:
    • x (TreeNeuron | MeshNeuron | Dotprops) – Neuron(s) to voxelize. Uses the neurons’ nodes, vertices and points, respectively.

    • pitch (float | iterable thereof) – Side length(s) voxels. Can be isometric (float) or an iterable of dimensions in (x, y, z).

    • bounds ((3, 2) or (2, 3) array, optional) – Boundaries [in units of x] for the voxel grid. If not provided, will use x.bbox.

    • counts (bool) – If True, voxel grid will have point counts for values instead of just True/False.

    • vectors (bool) – If True, will also attach a vector field as .vectors property.

    • alphas (bool) – If True, will also return a grid with alpha values as .alpha property.

    • smooth (int) – If non-zero, will apply a Gaussian filter with smooth as sigma.

    • parallel (bool) – If True and input is NeuronList, use parallel processing. Requires pathos.

    • n_cores (int, optional) – Numbers of cores to use if parallel=True. Defaults to half the available cores.

    • progress (bool) – Whether to show a progress bar. Overruled by navis.set_pbars.

    • omit_failures (bool) – If True will omit failures instead of raising an exception. Ignored if input is single neuron.

    Returns:

    Has the voxel grid as .grid and (optionally) .vectors and .alphas properties. .grid data type depends on settings:

    • default = bool (i.e. True/False)

    • if counts=True = integer

    • if smooth=True = float

    Empty voxels will have vector (0, 0, 0) and alpha 0. Also note that data tables (e.g. connectors) are not carried over from the input neuron.

    Return type:

    VoxelNeuron

    Examples

    >>> import navis
    >>> # Get a skeleton
    >>> n = navis.example_neurons(1)
    >>> # Convert to voxel neuron
    >>> vx = navis.voxelize(n, pitch='5 microns')
    

    Back to top

    Source

    © Copyright 2018, Philipp Schlegel.
    Created using Sphinx 5.3.0.