natverse / nat

NeuroAnatomy Toolbox: An R package for the (3D) visualisation and analysis of biological image data, especially tracings of single neurons.
https://natverse.org/nat/
64 stars 28 forks source link

add function to smooth neurons #300

Closed jefferis closed 8 years ago

jefferis commented 8 years ago

could use catmaid's algorithm (or at least provide this method) although R will have many smoother options. The main issues are how to decide

  1. the neighbourhood of any point
  2. whether there is any special treatment for nodes

re point 1, using a geodesic distance on the neuron graph seems a possibility. Another option which handles 1 and 2 is to restrict smoothing to within unbranched segments (I think I have done this previously).

jefferis commented 8 years ago

OK, checking CATMAID's method, it is defined here:

https://github.com/catmaid/CATMAID/blob/7e3eeb1bddab1c1c9057bd5c34c1ee7403137d27/django/applications/catmaid/static/libs/catmaid/Arbor.js#L973-L1076

jefferis commented 8 years ago

@alexanderbates feel free to add any suggestions here – I will probably implement something basic later today.

jefferis commented 8 years ago

This was my previous effort on this: https://github.com/jefferis/AnalysisSuite/blob/master/R/Code/Geometry/InterpolateAlongNeuron.R

jefferis commented 8 years ago

Try out the a first version of neuron smoothing with

devtools::install_github("jefferis/nat@feature/smooth-neuron")