CStats:Rank CStats:Sdev

CStats:RankClipMean and CStats:RankClipMeanSdev


The RankClipMean method computes the rank-clipped mean value for a data sample, clipping the values above and below the specified rank percentiles.

Syntax

nMean = CStats:RankClipMean( CImage, nHigh, nLow, CRect )

nMean = CStats:RankClipMean( CImage, nHigh, nLow )

nMean = CStats:RankClipMean( table, nHigh, nLow )

nMean, nSdev = CStats:RankClipMeanSdev( CImage, nHigh, nLow, CRect )

nMean, nSdev = CStats:RankClipMeanSdev( CImage, nHigh, nLow )

nMean, nSdev = CStats:RankClipMeanSdev( table, nHigh, nLow )

bullet.gif    CRect is a bounding rectangle for the CImage object.

bullet.gif    nHigh and nLow are percentile values in the range 0 to 100. See Remarks, below.

bullet.gif    table is a 1-dimensional array containing numbers.

bullet.gif    On success, returns the rank-clipped mean value and standard deviation.

bullet.gif    On failure, returns 0, 0.

Remarks

The calculated statistic computes the mean value using data above a low percentile and below a high percentile rank. These rank percentiles are absolute on the scale 0 to 100 percent. For example, passing the argumentsnLow=5 and nHigh=5 calculates the region mean value after rejecting data in both the lower 5 percentile and the upper 5 percentile of the sample.

This method uses the same algorithm as the RankClip method of the CImCombine class.

Example

Suppose a CImage I and a CRect R exist. The following script returns the rank clipped mean value inside a rectangle on the image:

S = new_stats()

-- create a CStats object

-- specify CImage and CRect to measure

 

nVal = S:RankClipMean(I, 5, 5, R)

-- mean value between upper 5th and lower 5th percentile

Printf("mean=%lg\n", nVal)

-- list the results

Related Topics

CStats class, CImage class, CRect class, MinMaxClipMean, SigmaClipMean, AlphaClipMean


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.