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

    navis.make_dotprops¶

    navis.make_dotprops(x, k=20, resample=False, threshold=None)[source]¶

    Produce dotprops from neurons or x/y/z points.

    This is following the implementation in R’s nat library.

    Parameters:
    • x (TreeNeuron | MeshNeuron | VoxelNeuron | NeuronList | pandas.DataFrame | numpy.ndarray) – Data/object to generate dotprops from. DataFrame must have ‘x’, ‘y’ and ‘z’ columns.

    • k (int (> 1), optional) –

      Number of nearest neighbours to use for tangent vector calculation:

      • k=0 or k=None is possible but only for TreeNeurons where we then use the midpoints between child -> parent nodes and their vectors

      • k is only guaranteed if the input has at least k points

      • k includes self-hits and while k=1 is not strictly forbidden, it makes little sense and will likely produce nonsense dotprops

    • resample (float | int | str, optional) –

      If provided will resample neurons to the given resolution:

      • for MeshNeurons, VoxelNeurons and point clouds, we are using trimesh.points.remove_close to remove surface vertices closer than the given resolution. Note that this is only approximate and also means that Mesh/VoxelNeurons can not be up-sampled!

      • if the neuron has .units set you can also provide this as string, e.g. “1 micron”.

    • threshold (float, optional) – Only for VoxelNeurons: determines which voxels will be converted to dotprops points.

    • 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:

    If input is multiple neurons, will return a NeuronList of Dotprops.

    Return type:

    navis.Dotprops

    Examples

    >>> import navis
    >>> n = navis.example_neurons(1)
    >>> dp = navis.make_dotprops(n)
    >>> dp
    type        navis.Dotprops
    name             DA1_lPN_R
    id              1734350788
    k                       20
    units          8 nanometer
    n_points              4465
    dtype: object
    

    Back to top

    Source

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