Click or drag to resize

McProfileEdges Interface

Finds and manages "edges" detected or placed on its ancestor McLineProfiles sampled line profiles or on a supplied profile.

Namespace:  MediaCy.IQL.Features
Assembly:  MediaCy.IQL.Features (in MediaCy.IQL.Features.dll) Version: 10.0.6912.0
Syntax
VB
Public Interface McProfileEdges
	Inherits IMcProfileEdges
Remarks
The McProfileEdges object exposes a large set of properties and methods that allow automatic and manual placement of points-of-interest (i.e., "edges") along a luminance profile derived from its ancestor McLineProfiles or supplied by the caller. These points-of-interest may be rising or falling edges, peaks or valley's, a match to an arbitray luminance pattern or just some specified position on the profile. Once "edges" are found or placed, McProfileEdges exposes a McLines object that has tic-marks and labels to show where they are. The McProfileEdges operator is exposed as McLines.Profiles.ProfileEdges and as McRegions.Profiles.ProfileEdges. It can also (and often will) be created independently using McProfileEdges.Duplicate or McEngine.CreateOperator. The McProfileEdges.Duplicate method automatically creates a new object with the same parent, while you must supply the parent operator, if any, when using McEngine.CreateOperator. In any case, each instance must have a McProfileEdges object as an ancestor. Muliple instances of the McProfileEdges operator can be created with the same parent McLineProfiles to find different points-of-interest along the same lines. For example, one instance might find rising edges and another instance falling edges, so that taking the differences between the placement of these edges would give the thickness of bright sections traversed by the ancestor McLines. As described above, McProfileEdges operators are usually descendents of a McLineProfiles operator, which is a descendent of a McLines or a McRegions operator, which in turn are descendents of a McImage. McProfileEdges is used in this way to detect luminance patterns along lines or region boundaries (as captured by the McLineProfiles operator). However, it is also legal to create global instances of McProfileEdges operators (i.e., ones where the CreateOperator call has Nothing for the Parent parameter). When used this way, you must supply the raw "luminance" profiles upon which the edges will be detected. That is the role of the RawProfiles property. For global McProfileEdges only, after assigning one or more arrays of values to RawProfiles, you may use FindEdges to detect patterns of value variation (e.g., peaks or valleys) using all of the tools supplied by McProfileEdges.
Examples
VB
Option Explicit
'the example demonstrates using of McLineProfiles class
'main part of the code is in frmLineProfiles.frm file
'more examples for McLineProfiles are included into the Caliper VBA sample project
Sub LineProfileTest()
    'load demo image
    Images.Open (Path & "Images\ColorDot.tif")

    frmLineProfile.Show False

    'add a line to LineFeatures
    ActiveImage.LineFeatures.SetFeaturePoints 0, Array(50, 50, 250, 150)

    'draw profile of first line
    frmLineProfile.DrawProfile ActiveImage.LineFeatures.Profiles, 0
End Sub
Examples
VB
VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} frmLineProfile 
   Caption         =   "Line Profile"
   ClientHeight    =   4470
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   7800
   OleObjectBlob   =   "frmLineProfile.frx":0000
   StartUpPosition =   1  'CenterOwner
End






'
'line profile viewer
'
'see Caliper sample VBA project for more examples on McLineProfiles
'

'line profile overlay, which will receive OnCreate event
Private WithEvents LineProfileOverlay As McGraphOverlay
Attribute LineProfileOverlay.VB_VarHelpID = -1

'draws line profile in the graph
Public Function DrawProfile(LineProfile As McLineProfiles, ByVal Index As Long)
    If LineProfile Is Nothing Then
       Chart1.Visible = False
       Exit Function
    End If
    If Index < 0 Or Index >= LineProfile.CountOfProfiles Then
       Chart1.Visible = False   'index is out of range
       Exit Function
    End If

    'change series grouping depending on number of channels
    Chart1.Plot.DataSeriesInRow = (LineProfile.NumberOfChannels = 1)
    'set values
    Chart1.ChartData = McObjectTemp(LineProfile.ProfileValues(Index)).value

    'set pen width
    Dim vCol As Variant
    For Each vCol In Chart1.Plot.SeriesCollection
        vCol.Pen.Width = 1
    Next

    'make visible
    Chart1.Visible = True
End Function

'create new line profile button
Private Sub CommandButton1_Click()
    If ActiveImage Is Nothing Then Exit Sub

    ActiveImage.LineFeatures.Reset 'clear any existing lines

    'sync master overlay of LineFeatures
    Set LineProfileOverlay = ActiveImage.LineFeatures.AutoDisplayOverlay

    'start line creating tool
    LineProfileOverlay.SelectTool "", "McGraphObjLine", mcgtStandardAutoDisplay
    'and monitor LineProfileOverlay_ObjectCreated event
End Sub

Private Sub LineProfileOverlay_ObjectCreated(ByVal Overlay As McGraphOverlay, ByVal Object As McGraphObj)
    'draw last created line
    DrawProfile ActiveImage.LineFeatures.Profiles, 0

    Overlay.SelectTool 'turn off the tool
End Sub
See Also