Home Image-Pro Plus General Discussions

Batch processing - Limitations

2»

Answers

  • Hi Matt,

    When you open invisible image you get a pointer to the IMcDocument, 

    With Measure.Measurements.OptionsCommands.Open(LoopOnHidden)
                .FileName = ThisApplication.Path(mcPathType.mcptConfigurationFiles) & "FD_Oprindelig.iqo"
                .FilterIndex = 1
                .Visible = False
                .Run(doc1)
            End With

    doc1 in this case. The Data property of IMcDocument returns McImage, so if you use

    doc1.Data.Visible = True

    it will make that invisible image visible.

    Yuri

  • 2017-08-02-160453

    Yuri --

    Thank you for the information.

    I have poked at INVISIBLE IMAGES a bit and it seems like the COST / BENEFIT on this feature is heavy on the COST side.

    If time allows, I'll return to this aspect of the program (eliminating images flashing on and off the screen) after all other aspects of the program are working properly.

    Perhaps this topic is one that could be covered in a PREMIER PROGRAMMERS WEBINAR.

    Thanks.

    -- Matt


  • 2019-04-16-183310

    All --

    I just attempted to use the CODE below to make an IMAGE INVISIBLE to speed up some work.  My intention was to set the value to TRUE after the SLOW CODE was finished.  Unfortunately it seems that this command is still closing the image rather than hiding it.

    Any thoughts on a resolution to this?

    Thanks.

    -- Matt

            ThisApplication.ActiveImage.Visible = False


  • edited April 2019
    Matt,

    If the image is already opened in the workspace and assigned to a document, you cannot hide it, only delete. You can set Visible=False to images that are going to be created. 
    So, what you can do is to create a duplicate, invisible version of the active image, do all the processing on it and only in the end show it.

        Public Function CountInvisible() As SimpleScript
            CountInvisible = New SimpleScript
            Dim image1
    
            With Adjust.ImageCommands.Crop(CountInvisible)
                'create invisible duplicate of the active image
                .Visible = False
                .Run(ThisApplication.ActiveImage, image1)
            End With
    
            'do some processing on invisible image
            'count
            With Measure.MeasurementsCommands.ExecuteCount(CountInvisible)
                .Run(image1)
            End With
    
            '... do more processing
    
            'show the image in the end
            image1.Visible=True
        End Function
    
    and lower level equivalent of that macro:

        Public Function CountInvisible2
            Dim image1 As McImage=ThisApplication.ActiveImage.Duplicate(mcImageCreateFlags.mcicfNotVisible)
            With New Mediacy.Addins.Measurements.CountCommand
                .Run(image1)
            End With
            image1.Visible=True
        End Function
    

    Yuri
  • 2019-04-17-075415

    Yuri --

    Thank you for the response.

    I think a variation on this would be something like
    • Do processing and counting on IMAGE AA
    • Save a copy of AA as TIF IMAGE BB so that BB contains the thousands of features found in AA
    • Open BB as INVISIBLE and perform the graphic intensive operation on the features
    • Close IMAGE AA
    • Make BB VISIBLE so that the processed features from AA are now on the screen
    I will try this and see if this is faster than just working on AA in the visible mode.

    Thanks again.

    -- Matt

Sign In or Register to comment.