IMcLineProfilesLengthPerSample Property
|
|
A read-only property giving the length of the last sample section for
each line profile.
Namespace:
MediaCy.IQL.Features
Assembly:
MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
SyntaxReadOnly Property LengthPerSample (
<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 sample lengths for the indicated profile is
exposed as a scalar Double value.
If the Selector argument is Empty, Error or Null, or any negative scalar
value, then the sample lengths for all CountOfProfiles profiles available in
the last access to ProfileValues, exposed as an array of Double values, one
for each profile. 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 sample lengths for the indicated features will be exposed
as an array of Double 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
RemarksThis property is exposed in calibrated units if the CalibratedLength
property is True and the ancestor McLines or McRegions' McFeatures.SpatialCalibration
property is set or the ancestor McImage.SpatialCalibration property is set.
Depending on the SampleMode property, each ancestor line feature may be
broken into an equal number of samples (mclpsmFixedNumberOfSamples) in which
case each sample, including the last one on each line, will be the same length
for a given ancestor line feature.
Or with a SampleMode of mclpsmFixedLenghtPerSample the line feature will be
broken into samples of a given length (given by the SampleNumbersOrLengths
property). In this latter case, all samples from each ancestor line feature
will be the same (SampleNumbersOrLengths), except possibly the last sample on
each line feature. This property gives access to those lengths, one "Double"
value for each for each CountOfProfiles profile available in the last access to
ProfileValues. (See Example)
When accessing the LengthPerSample property, the Selector argument determines
whether all line feature sample lengths are returned as an array (this is the
default case), or if a single length is to be returned or a sub-selection of all
profile sample lengths is exposed as an array.
If IsStale goes True, this property is recomputed when accessed.
Examples
With ThisApplication.ActiveImage.LineFeatures.Profiles
If .CountOfProfiles = 0 Then Exit Sub
Dim dLength As Double
If .SampleMode = mclpsmFixedNumberOfSamples Then
dLength = .NumberOfSamples(0) * .LengthPerSample(0)
Else
dLength = .NumberOfSamples(0) - 1 * .LengthPerSampleDesired _
+ .LengthPerSample(0)
End If
Debug.Print "The total length of profile 0 is " & dLength & " pixels."
Debug.Print "Note that this should match the line length (" & _
ThisApplication.ActiveImage.LineFeatures.mLnLength(0) & _
") unless McImage.SpatialCalibration is set."
End With
See Also