Click or drag to resize

IMcProfileEdgesEdgeCounts Property

The number of edges currently found on one or selected profiles.

Namespace:  MediaCy.IQL.Features
Assembly:  MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
Syntax
VB
ReadOnly Property EdgeCounts ( 
	<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 edge counts 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 edge counts for all ProfilesAncestor.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 ProfilesAncestor.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 edge counts 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 ProfilesAncestor.CountOfProfiles property are illegal.

Property Value

Type: Object
Remarks
When accessing the EdgeCounts property, the Selector argument determines whether all line profile edge counts are returned as an array (this is the default case), or if a single edge count is to be returned or a sub-selection of all profile edge counts is exposed as an array.
Examples
VB
'Show which profile has the most edges
With ThisApplication.ActiveImage.LineFeatures.Profiles.ProfileEdges
If ProfilesAncestor.CountOfProfiles < 1 Then Exit Sub 'nothing to work with
If ProfilesAncestor.CountOfProfiles = 1 Then
Debug.Print "The only profile has " & .EdgeCounts(0) & " samples."
Exit Sub
End If
'ELSE we have more than 1 profile
Dim lMaxN As Long, lMinN As Long
lMaxN = McMax(.EdgeCounts)
lMinN = McMin(.EdgeCounts)
If lMaxN = lMinN Then
Debug.Print "All profiles have the same edge counts (" & lMaxN & ")."
Else 'find 1st profile with EdgeCounts equal to lMaxN
Dim lProfileWithMaxN As Long
lProfileWithMaxN = McSqueezeSelector(McOpEQ(.EdgeCounts, lMaxN))(0)
Debug.Print "Profile " & lProfileWithMaxN & _
" is the 1st with the largest edge counts (" & lMaxN & ")."
End If
End With
See Also