elpigraph.CollapseBranches

elpigraph.CollapseBranches(X, PG, Mode='PointNumber', ControlPar=5, TrimmingRadius=inf)[source]

Filter “small” branches

X numeric matrix, the data matrix TargetPG list, the ElPiGraph structure to extend TrimmingRadius positive numeric, the trimming radius used to control distance ControlPar positive numeric, the paramter used to control the contribution of the different data points Mode string, the mode used to extend the graph. “PointNumber”, “PointNumber_Extrema”, “PointNumber_Leaves”, “EdgesNumber”, and “EdgesLength” are currently implemented PlotSelected boolean, should a diagnostic plot be visualized (currently not implemented)

Returns:
  • a list with 2 values (Nodes (a matrix containing the new nodes positions) and Edges (a matrix describing the new edge structure))
  • The value of ControlPar has a different interpretation depending on the valus of Mode.
  • If Mode = “PointNumber”, branches with less that ControlPar points projected on the branch
  • (points projected on the extreme points are not considered) are removed
  • If Mode = “PointNumber_Extrema”, branches with less that ControlPar points projected on the branch or the extreme
  • points are removed
  • If Mode = “PointNumber_Leaves”, branches with less that ControlPar points projected on the branch and any leaf points
  • (points projected on non-leaf extreme points are not considered) are removed
  • If Mode = “EdgesNumber”, branches with less that ControlPar edges are removed
  • If Mode = “EdgesLength”, branches with with a length smaller than ControlPar are removed