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.
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 navis.read_nrrd()
:
import navis
For this example I downloaded one of Janelia’s Fly Light confocal stacks (link) and converted it to nrrd using ImageJ.
# 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
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 navis.make_dotprops()
but just like all other neuron types, Dotprops
can be constructed manually:
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
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 pickling tutorial. See also the I/O API reference api_io>.