- navis.make_dotprops(x, k=20, resample=False, threshold=None)¶
Produce dotprops from neurons or x/y/z points.
This is following the implementation in R’s nat library.
k (int (> 1), optional) –
Number of nearest neighbours to use for tangent vector calculation:
k=Noneis possible but only for
TreeNeuronswhere we then use the midpoints between child -> parent nodes and their vectors
kis only guaranteed if the input has at least
kincludes self-hits and while
k=1is 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:
VoxelNeuronsand point clouds, we are using
trimesh.points.remove_closeto remove surface vertices closer than the given resolution. Note that this is only approximate and also means that
Mesh/VoxelNeuronscan not be up-sampled!
if the neuron has
.unitsset 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
omit_failures (bool) – If True will omit failures instead of raising an exception. Ignored if input is single neuron.
- Return type:
>>> 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