Initially, the purpose of this PR is to improve NAVis' handling of image data. However, over time it has morphed into a collection of more-or-less related improvements:
setting navis.config.add_units=True (default is False) will add units to certain neuron properties; this is a test balloon and could be extended/switched on by default
refactor read_nrrd, read_mesh and read_tiff to use BaseReader (allows reading from URLs and archives, parallel processing, etc)
related to above: BaseReader now understands patterns for searching directories (mostly for read_mesh)
all read_* function that use the reader now have an error parameter to determine what happens if file content can't be parsed
more options to process Dotprops:
navis.drop_fluff can now be used to remove dust or get the N largest connected components in Dotprops
read_nrrd and read_tiff now accept a thin parameter
navis.neuron2nx now works with Dotprops
TreeNeurons can now be initialised from a (vertices, edges) tuple (see also new navis.edge2neuron function)
new function: navis.thin_voxels uses scikit-image (optional dependency) to thin images to single-voxel width
new property: TreeNeuron.vertices gives quick, read-only access to node positions
new properties: VoxelNeuron.nnz and VoxelNeuron.density
TODOs
[ ] ~add tutorial on image transforms/registration~
[x] make navis.downsample_neuron use Poisson disk sampling for dotprops (implemented but not exposed yet - it's expensive)
[ ] ~look into whether we can make navis.skeletonize smarter for dotprops~
[ ] ~add voxel2skeleton function for VoxelNeurons (using kimimaro) and wrap in navis.skeletonize~
Important
This PR switches a number of ImportErrors to ModuleNotFoundErrors. For pykdtree on OSX that may mean that it fails to import if the wheel was compiled with OMP support but libomp is not installed. We for now pinned the pykdtree version.
Initially, the purpose of this PR is to improve NAVis' handling of image data. However, over time it has morphed into a collection of more-or-less related improvements:
navis.config.add_units=True
(default isFalse
) will add units to certain neuron properties; this is a test balloon and could be extended/switched on by defaultread_nrrd
,read_mesh
andread_tiff
to useBaseReader
(allows reading from URLs and archives, parallel processing, etc)BaseReader
now understands patterns for searching directories (mostly forread_mesh
)read_*
function that use the reader now have anerror
parameter to determine what happens if file content can't be parsedDotprops
:navis.drop_fluff
can now be used to remove dust or get the N largest connected components inDotprops
read_nrrd
andread_tiff
now accept athin
parameternavis.neuron2nx
now works withDotprops
TreeNeurons
can now be initialised from a(vertices, edges)
tuple (see also newnavis.edge2neuron
function)navis.thin_voxels
uses scikit-image (optional dependency) to thin images to single-voxel widthTreeNeuron.vertices
gives quick, read-only access to node positionsVoxelNeuron.nnz
andVoxelNeuron.density
TODOs
navis.downsample_neuron
use Poisson disk sampling for dotprops (implemented but not exposed yet - it's expensive)navis.skeletonize
smarter for dotprops~voxel2skeleton
function for VoxelNeurons (using kimimaro) and wrap innavis.skeletonize
~Important
This PR switches a number of
ImportErrors
toModuleNotFoundErrors
. Forpykdtree
on OSX that may mean that it fails to import if the wheel was compiled with OMP support butlibomp
is not installed. We for now pinned thepykdtree
version.