morph_tool.resampling

Resampling functionality for morphio morphologies.

It allows for the generation of new points on the morphology skeleton with different density.

Functions

resample_linear_density(obj, linear_density)

Returns a new morphology with new points and point properties.

morph_tool.resampling.resample_linear_density(obj, linear_density)

Returns a new morphology with new points and point properties.

The number of points depends on the linear_density. The new values are linearly interpolated from the old ones. This function is useful for use cases where morphologies have too many points and a resampling with fewer points/properties is required.

Parameters
  • obj – Morphology object, mutable or immutable

  • linear_density (float) – Number of points per micron

Returns

Resampled morphology copy

Return type

morphio.mut.Morphology

Notes

Resampling maintains cell topology, i.e. it does not modify branching and termination points

A linear density of 1 corresponds to 1 point per um, 0.5 (1/2) to 1 point per 2 um, 2.0 (2/1) to two points per 1 um, etc.