Home Image-Pro General Discussions

Direct Point to Point length measurement from single origin

Hi, 

Is it possible to measure multiple points on an image all from the same origin point using the Direct Point to Point measuring tool, so that all measurements start in the same exact spot? If so, how can I do this?

Thanks!
Collin

Best Answers

  • Answer ✓
    2017-03-08-110212

    Colin --

    If I was tackling the challenge that I believe you are describing, I would not try to tackle it with the LINE TOOL.  I would use the POINT TOOL.

    If you designate the ORIGIN POINT as the FIRST POINT that you define and then designate all of the other POINTS, you can use the power of PREMIER or EXCEL to determine the DISTANCES from the ORIGIN to all of the OTHER POINTS.

    Below is a SCREEN CAPTURE that illustrates this concept.

    I hope this information is helpful.

    -- Matt

    *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-


  • edited March 2017 Answer ✓
    Hi Collin,

    This macro adjusts origin of the lines by the origin position of the first line:
        Public Sub SetOrigin
            If ThisApplication.ActiveImage IsNot Nothing Then
                Dim md As MediaCy.Addins.Measurements.McMMData, l As MediaCy.IQL.Features.McLines
                Dim p(1) As MediaCy.IQL.ObjectManager.SINGLEPOINT, p2 As MediaCy.IQL.ObjectManager.SINGLEPOINT
    
                md = ThisApplication.ActiveImage.MeasurementsData
                For Each f As MediaCy.IQL.Features.McFeatures In md.GetMcFeatures
                    l = TryCast(f, MediaCy.IQL.Features.McLines)
                    If l IsNot Nothing AndAlso l.Count > 1 Then
                        md.BeginUpdateBlock(True)
                        l.GetFeaturePoints(0, p) : p2 = p(0)
                        For i As Integer = 1 To l.Count - 1
                            l.GetFeaturePoints(i, p)
                            p(0) = p2 : l.SetFeaturePoints(i, p)
                        Next
                        md.BeginUpdateBlock(False)
                    End If
                Next
            End If
        End Sub
    



    Thanks,
    Nikita.


  • edited March 2017 Answer ✓
    Collin,

    This tool already exists in the UI of Premier, so no macros necessary.

    You just need select all the objects you want to measure distance from and then select the origin object and click the Minimum Distance button:

    As the result the multiple minimum distance (Direct) lines will be created from objects to the last object, so you can get all the Length measurements and stats in the data table.


    Yuri

  • edited March 2017 Answer ✓
    Collin,

    Another option, if you just want to specify measurements origin to get relative position coordinates, is to specify Origin X/Y of the spatial calibration applied to the image.
    In that case all position measurements (Centroids, Locations,...) will be reported relatively to this point:


    Yuri
Sign In or Register to comment.