Home Image-Pro Automation (Macros, Apps, Reports)

What is IMAGE-PRO PREMIER mechanism for learning POSITION X Y Z from IMAGE-PRO PLUS AFA IMAGES?

All --

We have a IPP6 USER who is considering IPP9.

They want to work with images that have been captured with IPP6 AFA.

What is the mechanism to MANUALLY and PROGRAMATICALLY show / learn the POSITION X Y Z shown on the SET / PROPERTY TAB of the INFORMATION DIALOG BOX from PLUS?

Please see attached illustration.

Thanks.

-- Matt

Best Answer

  • Answer ✓

    Hi Matt,

     

    Take a look on the macros:

     

        Public Sub GetImageActiveFrameXYZ
            Dim x As Double, y As Double, z As Double
    
            If ThisApplication.SelectedData.Image IsNot Nothing Then
                With ThisApplication.SelectedData.Image.Frame
                    If .IsXYPositionValid Then
                        x = .XPosition
                        y = .YPosition
    
                        MsgBox("X = " & x & " Y = " & y)
                    Else
                        MsgBox("XY unknown")
    
                    End If
    
                    If .IsZPositionValid Then
                        z = .ZPosition
    
                        MsgBox("Z = " & z)
                    Else
                        MsgBox("Z unknown")
    
                    End If
                End With
            End If
        End Sub
    
        Public Sub SetImageActiveFrameXYZ
            If ThisApplication.SelectedData.Image IsNot Nothing Then
                With ThisApplication.SelectedData.Image.Frame
                    .XPosition = 123.0
                    .YPosition = 456.0
                    .ZPosition = 789.0
                End With
            End If
        End Sub
    
     

Answers

  • Hi Matt,

    XY position reported in the Document Properties panel in the Normal template (Active / Frames Count, Active Frame, XY Position), but it is read only and could be set in the macro only. Z position reported in the Normal template as well and could be adjusted in the Metadata template (select Z Spacing cell in the table and see the right side panel).

  • Nikita --

    Thank you for your response.

    Per your suggestion, I have opened

        DOCUMENT PROPERTIES +
        NORMAL TEMPLATE +
        ACTIVE / FRAMES COUNT +
        ACTIVE FRAME

    and now I can see the X, Y, and Z information as shown in

        2014-08-25-143055.jpg

    I do not have the SITE information though and I would like to know how to read these values into a MACRO.

    I've looked at properties of

        ThisApplication.ActiveDocument
        ThisApplication.ActiveImage
        of
        ThisApplication.ActiveWindow

    and nothing there looks promising.

    I see

        Automation ReferenceMediaCy.IQL.SetsIMcImageSetXPosition
        Automation ReferenceMediaCy.IQL.SetsIMcImageSetYPosition
        Automation ReferenceMediaCy.IQL.SetsIMcImageSetZPosition

    in the AUTOMATION HELP file but I do not have enough information on

        MediaCy.IQL.Sets
        and

        IMcImageSet


    to access XPOSITION, YPOSITION, and ZPOSITION.

    Can you please provide guidance on how to do this?

    Thanks.

    -- Matt
  • Matt, what exactly do you want to know about the site? Sites are properties of the image set. The X/Y/Z position information that Nikita mentioned in the post from today, 8/26, are properties of the image frame if they are known from any frame of any image that has X/Y and/or Z information from any possible source.

     

    However, AFA captures image sets, and an image set has much more information about the context of the acquisition and its contents. From the McImageSet, you can get the current location (which will be the location displayed in the workspace) by using the GetCurrentLocation method. From the Site location, you can get an index into the McImageSet.Sites collection and get more information about the specific site.

    We could probably give a better example macro if we understood more completely what you're trying to accomplish.

     

    BR,

    John

  • Nikita --

    Thank you very much for the EXAMPLE CODE.

    It works perfectly and gives me (us) the information necessary to access this IMAGE INFORMATION via a MACRO.

    Thanks again.

    John --

    A sales rep for NUHSBAUM and I are working with a customer who has an IPP6 based AFA system.  We are looking into working with images generated with that system in IPP7 or IPP9.

    The challenge is to search for a feature that may or may not be in an image.  When the feature is found, its location needs to be recorded and reported relative to the STAGE POSITION.

    -- Matt
Sign In or Register to comment.