Click or drag to resize

IMcLineProfilesNumberOfSamples Property

A read-only property giving the number of sample sections each line profile is to be broken into.

Namespace:  MediaCy.IQL.Features
Assembly:  MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
Syntax
VB
ReadOnly Property NumberOfSamples ( 
	<OptionalAttribute> Selector As Object
) As Object
	Get

Parameters

Selector (Optional)
Type: SystemObject
An empty variant, a single negative value, a single index value, or an array of zero or more index values (negative index values are legal but will be ignored). If the Selector argument is a non-negative scalar value, then the number of samples for the indicated profile is exposed as a scalar Long value. If the Selector argument is Empty, Error or Null, or any negative scalar value, then the number of samples for all CountOfProfiles profiles available in the last access to ProfileValues, exposed as an array of Long values, one for each feature. The number of elements in the array will be equal to the CountOfProfiles property. If Selector is an array, then zero or positive values are treated as indices into the features collection, negative values are legal but ignored. In this case, the number of samples for the indicated features will be exposed as an array of Long values equal to the length of the number of non-negative elements in the Selector array. Index values greater or equal to the CountOfProfiles property are illegal.

Property Value

Type: Object
Remarks
Depending on the SampleMode property, each ancestor line feature may be broken into an equal number of samples (mclpsmFixedNumberOfSamples) or it may be broken into samples of a given length (mclpsmFixedLenghtPerSample). As a result, the number of samples for each line profile may vary, and this property gives access to those numbers, one number value for each CountOfProfiles profile available in the last access to ProfileValues. When accessing the NumberOfSamples property, the Selector argument determines whether all line profile sample numbers are returned as an array (this is the default case), or if a single number is to be returned or a sub-selection of all line feature sample numbers is exposed as an array. If IsStale goes True, this property is recomputed when accessed.
Examples
VB
'Show which profile has the most samples
With ThisApplication.ActiveImage.LineFeatures.Profiles
If .CountOfProfiles < 1 Then Exit Sub 'nothing to work with
If .CountOfProfiles = 1 Then
Debug.Print "The only profile has " & .NumberOfSamples(0) & " samples."
Exit Sub
End If
'ELSE we have more than 1 profile
Dim lMaxN As Long, lMinN As Long
lMaxN = McMax(.NumberOfSamples)
lMinN = McMin(.NumberOfSamples)
If lMaxN = lMinN Then
Debug.Print "All profiles have the same number of samples (" & lMaxN & ")."
Else 'find 1st profile with NumberOfSamples equal to lMaxN
Dim lProfileWithMaxN As Long
lProfileWithMaxN = McSqueezeSelector(McOpEQ(.NumberOfSamples, lMaxN))(0)
Debug.Print "Profile " & lProfileWithMaxN & _
" is the 1st with the largest number of samples (" & lMaxN & ")."
End If
End With
See Also