Home Image-Pro General Discussions

Issue with turning ANNOTATION RECTANGLES into MEASUREMENT RECTANGLES . . .

2019-11-14-181623

All --

I have an image.

Its dimensions are  

    20110 x 15390

This image was generated by the

    TILE TOOL

This image is shown open within IMAGE-PRO (V10) below.




This TILED IMAGE was generated by TILING 16 x 16 = 256 IMAGES with dimensions of 1280 x 960 with a little BORDER and a little space between tiles.  The TILED IMAGE has 256 ANNOTATION RECTANGLES in the image.  I can save those ANNOTATION RECTANGLES into the FEATURE MANAGER.  I can clear the ANNOTATIONS from the IMAGE and then recall them into the image via the FEATURE MANAGER.

I would expect that I could then CLEAR ANNOTATIONS from the TILED IMAGE, change the RECTANGLES in the FEATURE MANAGER from ANNOTATION to MEASUREMENTS and then recall them into the image as MEASUREMENT RECTANGLES.  Unfortunately this does not seem to work.  No error is being displayed.

This image has been saved to the disk and then re-opened with IMAGE-PRO to clean up any issues.

Is this an OPERATOR ISSUE or a PROGRAM ISSUE or a combination of the two?

I can provide this image to you but it is 308 MB.

Thanks.

-- Matt

Best Answers

  • Answer ✓
    Hi Matt,

    We were able to reproduce the problem and found that it's a bug  related to the way overlays are created on Tiled images.
    The problem will be fixed in the next patch. In the current 10.0.4 version the issue can be fixed by a macro (which will fix the overlay objects on the tiled image). Let us know if want to have that macro.

    Regards,

    Yuri
  • Answer ✓
    Hi Matt,

    Here is the macro, which will fix tile rectangles. You should run this macro after creation of the tiled image, before adding annotation objects to the Features manager. 
        Public Sub FixTileRectangles
            Dim im As McImage=ThisApplication.ActiveImage
            If im Is Nothing Then Exit Sub
            Dim ovl As MediaCy.IQL.Display.Overlays.IMcGraphOverlay=im.AnnotationOverlay
            Dim n As Integer=ovl.Count
            For j As Integer=0 To n+1
                Dim o As MediaCy.IQL.Display.Overlays.McGraphObj =ovl.Item(j)
                If o IsNot Nothing AndAlso o.TemplateID=0 AndAlso o.ClassName="McGraphObjRect" Then
                    'create duplicate rectangle with TemplateID=1
                    Dim o2 As MediaCy.IQL.Display.Overlays.McGraphObj=ovl.Add(o.ClassName,1)
                    Dim x As Single, y As Single
                    For i As Integer=0 To 6
                        o.GetHandle(i,x,y)
                        o2.SetHandle(i,x,y)
                    Next
                    o2.NotifyCreationComplete
                    ovl.Remove(o)'remove old
                End If
            Next
        End Sub
    
    Yuri

Answers

  • Hi Matt,

    Can you please provide more specific details?
    You mentioned 3 steps in one sentence: 1. CLEAR ANNOTATIONS from the TILED IMAGE, 2. change the RECTANGLES in the FEATURE MANAGER from ANNOTATION to MEASUREMENTS and then 3. recall them into the image as MEASUREMENT RECTANGLES.

    Which step didn't work?

    Thanks,

    Yuri
  • 2019-11-15-083852

    Yuri --

    Thank you for your response and your questions for clarification.

    Step 0 worked in that 256 ANNOTATION RECTANGLES were copied from the TILED IMAGE to the FEATURE MANAGER.

    Step 1 worked in that 256 ANNOTATION RECTANGLES were cleared from the image.

    Step 2 worked in that the RECTANGLES in the FEATURE MANAGER were changed from ANNOTATIONS to MEASUREMENTS.

    Step 3 did not work in that no MEASUREMENT OBJECTS were transferred to the image from the FEATURE MANAGER.  No error message was displayed.  I believe that I tried to transfer the 256 RECTANGLES into the image as ROIs also and that this did not work either.  I am not certain of this though.

    Thanks.

    -- Matt
  • 2019-11-18-170552

    All --

    This is came up during the development of a PROOF OF CONCEPT so it is not critical but understanding why it did not work would be super.

    Thanks.

    -- Matt


  • 2019-11-19-092948

    Yuri --

    Thank you for the message.

    I'm glad you were able to reproduce the issue and find a cause and a resolution.

    Please send the MACRO.

    Having the MACRO may be helpful to move this project for an IMAGE-PRO and a APP through the SALES CYCLE.

    Thanks again.

    -- Matt

  • 2019-11-20-083424

    Yuri --

    Thank you for the MACRO CODE to address the issue identified with the TILE IMAGE.

    I did the following:

    1. Took the TILED IMAGE generated previously with the ANNOTATION overlays
    2. Ran the FixTileRectangles Code
    3. Copied the ANNOTATION RECTANGLES from the IMAGE to the FEATURE MANAGER
    4. Deleted the ANNOTATION RECTANGLES from the IMAGE
    5. Converted the ANNOTATION RECTANGLES to MEASUREMENT RECTANGLES in the FEATURE MANAGER
    6. Copied the MEASUREMENT RECTANGLES from the FEATURE MANAGER to the IMAGE
    7. Measured INTENSITY MEAN for each MEASUREMENT RECTANGLE
    8. Sorted INTENSITY MEAN MEASUREMENTS from MIN to MAX
    The image below shows the TILED IMAGE with the MIN INTENSITY MEAN.  This an illustration of the ability of IMAGE-PRO to work with two images captured from the same sample at different resolutions.  The two images are not aligned exactly so the IMAGE CENTERS need alignment.  The TILED IMAGE is an illustration of the ability of IMAGE-PRO to shift IMAGE A and IMAGE B in X and Y and determine the offset which best matches the centers of the two images.

    This is the result that I was shooting for during the PROOF OF CONCEPT work.

    Thanks again.

    -- Matt




Sign In or Register to comment.