Livny reconstruction method#
- openalea.plantscan3d.livnymethod.livny_contraction(pointList, root, connectall=True, adjacencies=None)[source]#
Perform a single Livny contraction step on a point cloud skeleton.
- Parameters:
- Returns:
(newPointList, parents, weights) after contraction.
- Return type:
- openalea.plantscan3d.livnymethod.livny_method(pointList, root, connectall=True, nbcontractionsteps=3, maxfiltering=10, minedgeratio=0.15)[source]#
Reconstruct a tree skeleton using the Livny method.
- Parameters:
pointList (list of Vector3) – Input point cloud.
root (int) – Index of the root point.
connectall (bool) – If True, ensure all components are connected.
nbcontractionsteps (int) – Number of contraction iterations.
maxfiltering (int) – Maximum number of node merging passes.
minedgeratio (float) – Minimum edge length ratio for filtering short edges.
- Returns:
(pointList, parents, radii) of the reconstructed skeleton.
- Return type:
- openalea.plantscan3d.livnymethod.livny_method_mtg(mtg, startfrom, pointList, nbcontractionsteps=3, maxfiltering=10, filter_short_branch=False, angle_between_trunk_and_lateral=60)[source]#
Reconstruct a tree skeleton using Livny’s method and add it to an MTG.
- Parameters:
mtg (openalea.mtg.MTG) – MTG object to add the reconstructed tree to.
startfrom (int) – Starting node id in the MTG.
pointList (list of Vector3) – Input point cloud.
nbcontractionsteps (int) – Number of contraction iterations.
maxfiltering (int) – Maximum number of node merging passes.
filter_short_branch (bool) – If True, remove branches with no children.
angle_between_trunk_and_lateral (float) – Angle threshold in degrees for edge type determination.
- Returns:
MTG of the reconstructed tree.
- Return type:
openalea.mtg.MTG