.. _local_data_dp_tut:
Dotprops
--------
``navis`` lets you import neurons from a variety of local and remote sources. In this tutorial you will learn how to work with Dotprops.
:class:`navis.Dotprops` are point clouds with associated principal vectors which are mostly used for NBLASTing. They are typically derivatives of skeletons or meshes but you can load them straight from confocal data using :func:`navis.read_nrrd`:
.. code:: ipython3
import navis
For this example I downloaded one of Janelia's Fly Light confocal stacks (`link `_) and converted it to nrrd using ImageJ.
.. code:: ipython3
# Load NRRD file into Dotprops instead of VoxelNeuron
# Note the threshold parameter that determines which voxels
# (by brightness) are used and which are ignored!
dp = navis.read_nrrd('~/Downloads/JRC_SS86025_JRC_SS86025-20211112_49_B6.nrrd', output='dotprops', threshold=3000)
dp
.. raw:: html
|
|
type |
navis.Dotprops |
name |
JRC_SS86025_JRC_SS86025-20211112_49_B6 |
k |
20 |
units |
1 micrometer |
n_points |
92416 |
If not loaded from file, you would typically create ``Dotprops`` via :func:`navis.make_dotprops` but just like all other neuron types, :class:`~navis.Dotprops` can be constructed manually:
.. code:: ipython3
import numpy as np
# Create some x/y/z coordinates
points = np.array([[0,0,0],
[1,1,1],
[2,2,2]])
# Create vectors for each point
# You can skip this point and just provide the `k` parameter
vect = np.array([[1,0,0],
[0,1,0],
[0,1,0]])
dp = navis.Dotprops(points, k=None, vect=vect)
dp
.. raw:: html
|
|
type |
navis.Dotprops |
name |
None |
k |
None |
units |
1 dimensionless |
n_points |
3 |
There is no established format to store dotprops. But like all other neuron types in navis, you can pickle data for later (re)use - see the :ref:`pickling tutorial `. See also the :ref:`I/O API reference api_io>`.