Click or drag to resize

IMcLineProfilesCalibratedLength Property

A read-write property specifying whether the length properties and sample spacing are spatially calibrated or not.

Namespace:  MediaCy.IQL.Features
Assembly:  MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
Syntax
VB
Property CalibratedLength As Boolean
	Get
	Set

Property Value

Type: Boolean
Remarks
By default, CalibratedLength is False. In this case the LengthPerSampleDesired and LengthPerSample are supplied and exposed in units of one pixel. Furthermore, the coordinates used for sampling are based on an assumed pixel aspect ratio of 1. Wnen CalibratedLength is True, then the LengthPerSampleDesired and LengthPerSample are both supplied and reported in spatially calibrated coordinates. The McSpatialCalib used for the calibration will be taken from the ancestor McImage.SpatialCalibration propert. If this property is Nothing, then pixel units are used. When calibrated lengths are being used and the McSpatialCalib.AspectRatio is other than 1, then the sample spacing along image pixels will depend on the angle of the line or boundary segment being sampled. The effect is subtle for the usual case where the aspect ratio is close to 1. Note that no matter the state of CalibratedLength, the VirtualWidth property is always supplied and exposed in pixel units. Changes to the CalibratedLength property or the current active McImage.SpatialCalibration are automatically reflected in the exposed values of the LengthPerSampleDesired property and any stored LengthPerSample values. The rescaling will be exactly correct only if the active SpatialCalibration has an McSpatialCalib.AspectRatio of 1; when the aspect ratio is other than 1, then the mean of McSpatialCalib.PixelSizeX and McSpatialCalib.PixelSizeY is used for the rescaling. As shown in the example, the automatic rescaling allows you to temporarily set the CalibratedLength property so that you can assign to LengthPerSampleDesired in pixel or calibrated units, independent of whether you will want results calibrated or not. A round-trip rescaling (e.g., assigning CalibratedLength False and then True) will restore the original value for the LengthPerSampleDesired property even for aspect ratios other than 1. If the CalibratedLength is changed or if the McImage.SpatialCalibration is changed or its scaling changes, then an McObjMgr McObjStandardNotify.SpecialNotify is fired on the McObject backing this McLineProfile. The notify code will be SNC_NOTIFY_HO_PROPERTYCHANGED and the notify data will be ID_IMcLineProfiles_CalibratedLength. You can use an instance of McNotifySink WithEvents in VBA to track these notifies.
Examples
VB
'Set up to make samples one pixel long, but get calibrated length results
With ThisApplication.ActiveImage.LineFeatures.Profiles
.SampleMode = mclpsmFixedSampleLength 'fixed length per sample
.CalibratedLength = False 'we want pixel units for now
.LengthPerSampleDesired = 1 'one pixel length per sample
.CalibratedLength = True 'but we want calibrated results
Debug.Print "Calibrated sample lengths will be " & .LengthPerSampleDesired
End With
See Also