Click or drag to resize

IMcRegions2SourceData Property

Per feature source data

Namespace:  MediaCy.IQL.Features
Assembly:  MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
Syntax
VB
Property SourceData ( 
	Optional FeatureIndex As Integer = 0
) As Object
	Get
	Set

Parameters

FeatureIndex (Optional)
Type: SystemInt32
An index value indicating for which feature the data is being accessed or set. If not given, then feature index zero is assumed.

Property Value

Type: Object

Implements

IMcRegionsSourceDataInt32
Remarks
The SourceData property is used by some measurements that expose a McFeatures to provide extended information about the source of each computed feature. If the stored Variant is of no interest to the user, this property may be used for storage of an arbitrary per-feature Variant value. Note that the McDisplayedObjects.SetLabelText method is capable of displaying the SourceData property as a feature label (see Example 2).
Examples
VB
'Example 1, store some data associated with each point
With ThisApplication.ActiveImage.PointFeatures
'Create two points
.SetFeaturePoints -1, Array(10, 10, 20, 20)
'Set SourceData for both
.SourceData(0) = Array(1, 2, 3)
.SourceData(1) = 5
Debug.Print "SourceData(0) = " & McToText(.SourceData(0))
Debug.Print "SourceData(1) = " & McToText(.SourceData(1))
End With
'Example 2: Label regions with their area
With ThisApplication.ActiveImage.RegionFeatures
.Threshold.Execute  'Get some regions
Dim varAreas As Variant
varAreas = .mRgnArea
Dim lF As Long
For lF = 0 to .Count-1
.SourceData(lF) = CDbl(varAreas(lF))
Next lF
.DisplayedObjects.SetLabelText "%.1f", _
mcsltDisplaySourceData Or mcsltCopyBorderColor Or mcsltLabelCenter
End With
See Also