Skip to content

runlength_distributionRunlengthDistributionRunlengthDistributionrunlength_distributionT_runlength_distribution🔗

Short description🔗

runlength_distributionRunlengthDistributionRunlengthDistributionrunlength_distributionT_runlength_distribution — Distribution of runs needed for runlength encoding of a region.

Signature🔗

runlength_distribution( region Region, out integer Foreground, out integer Background )void RunlengthDistribution( const HObject& Region, HTuple* Foreground, HTuple* Background )static void HOperatorSet.RunlengthDistribution( HObject region, out HTuple foreground, out HTuple background )def runlength_distribution( region: HObject ) -> Tuple[Sequence[int], Sequence[int]]

Herror T_runlength_distribution( const Hobject Region, Htuple* Foreground, Htuple* Background )

HTuple HRegion::RunlengthDistribution( HTuple* Background ) const

HTuple HRegion.RunlengthDistribution( out HTuple background )

Description🔗

The operator runlength_distributionRunlengthDistribution calculates the distribution of the runs of a region of the fore- and background. The frequency of the occurrence of a certain length is calculated. Runs of infinite length are not counted. Therefore the background are the holes of the region. As many values are passed as set by the maximum length of fore- or background, respectively. The length of both tuples usually differs. The first entry of the tuples is always 0 (no runs of the length 0). If there are no blanks the empty tuple is passed at Backgroundbackgroundbackground. Analogously the empty tuple is passed in case of an empty region at Foregroundforegroundforeground.

Execution information🔗

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

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

  • Processed without parallelization.

Parameters🔗

Regionregionregion (input_object) region → objectHObjectHRegionHObjectHobject

Region to be examined.

Foregroundforegroundforeground (output_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Length distribution of the region (foreground).

Backgroundbackgroundbackground (output_control) integer-array → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Length distribution of the background.

Complexity🔗

If \(n\) is the number of runs of the region the runtime complexity is \(O(n)\).

Result🔗

The operator runlength_distributionRunlengthDistribution returns the value 2 (H_MSG_TRUE) if the input is not empty. The behavior in case of empty input (no input regions available) is set via the operator set_system('no_object_result',<Result>). If more than one region is passed an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, select_objSelectObj

Alternatives

runlength_featuresRunlengthFeatures

See also

runlength_featuresRunlengthFeatures

Module🔗

Foundation