Skip to content

pruningPruningPruningpruningpruning🔗

Short description🔗

pruningPruningPruningpruningpruning — Prune the branches of a region.

Signature🔗

pruning( region Region, out region RegionPrune, integer Length )void Pruning( const HObject& Region, HObject* RegionPrune, const HTuple& Length )static void HOperatorSet.Pruning( HObject region, out HObject regionPrune, HTuple length )def pruning( region: HObject, length: int ) -> HObject

Herror pruning( const Hobject Region, Hobject* RegionPrune, const Hlong Length )

Herror T_pruning( const Hobject Region, Hobject* RegionPrune, const Htuple Length )

HRegion HRegion::Pruning( Hlong Length ) const

HRegion HRegion.Pruning( int length )

Description🔗

pruningPruning removes branches from a skeleton (Regionregionregion) having a length less than Lengthlengthlength. All other branches are preserved.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

Regionregionregion (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Regions to be processed.

RegionPruneregionPruneregion_prune (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Result of the pruning operation.

Lengthlengthlength (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Length of the branches to be removed.

Default: 22
Suggested values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 17, 20, 30, 40, 501, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 17, 20, 30, 40, 50
Value range: 1 ≤ Length ≤ 511 (lin)
Minimum increment: 1
Recommended increment: 1

Complexity🔗

Let \(F\) be the area of the input region. Then the runtime complexity for one region is

\[\begin{eqnarray*} O(\textrm{Length} \cdot 3 \cdot \sqrt{F}) \enspace . \end{eqnarray*}\]

Result🔗

pruningPruning returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty or no input region can be set via:

  • no region: set_system('no_object_result',<RegionResult>)

  • empty region: set_system('empty_region_result',<RegionResult>)

Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

skeletonSkeleton

Possible successors

reduce_domainReduceDomain, select_shapeSelectShape, area_centerAreaCenter, connectionConnection

See also

junctions_skeletonJunctionsSkeleton

Module🔗

Foundation