clbarnes / nblast-rs

GNU General Public License v3.0
4 stars 1 forks source link

Add resampling utility #5

Closed clbarnes closed 4 years ago

clbarnes commented 4 years ago

Take a list of slabs.

Either resample every slab at a given length (see pynblast), linear/gaussian/spline, or distribute n sampling points proportional to length of each slab (randomly with seed?). Do not bind sampling points to ends, e.g. numpy.linspace(0, 1, n_samples + 2)[1:-1]

Interpolation will have to be implemented.

clbarnes commented 4 years ago

Possible algorithms

Resample with length

Arguments: criterion length

Slab-length weighted

Argument: number of points

Descend from root, laying down treenode every X distance. At branch point, distribute remaining treenodes proportional to cable distance below branch. Probably over-weights terminal dendrites.

Shape simplification

Ramer-Douglas-Peucker

Visvalingham-Whyatt

clbarnes commented 4 years ago

Take proximal branches

Arguments: number of branches to keep

N.B.

This is probably a better fit for arbor-rs.