CStats:Rank and CStats:RankSdev


The Rank method computes the percentile ranked value for a data object.

Syntax

nValue = CStats:Rank( CImage, nPercentile, CRect )

nValue = CStats:Rank( CImage, nPercentile )

nValue = CStats:Rank( table, nPercentile )

nValue, Sdev = CStats:RankSdev( CImage, nPercentile, CRect )

nValue, Sdev = CStats:RankSdev( CImage, nPercentile )

nValue, Sdev = CStats:RankSdev( table, nPercentile )

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

bullet.gif    nPercentile is a number in the range 0 through 100.

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

bullet.gif    On success, returns the percentile value and standard deviation.

bullet.gif    On failure, returns 0, 0.

Example

Suppose a CImage named I and a CRect named R exist. The following script returns the value for rank percentile 32.5 inside a rectangle on the image:

S = new_stats()

-- create a CStats object

-- specify CImage and CRect to measure

 

nVal = S:Rank( I, 32.5, R )

-- returns the value at the 32.5 percentile

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

-- list the results

S:delete()

-- when done with S, remove it from memory

Related Topics

CStats class, CImage class, CRect class, Median

 


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