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

Controlling tabs during semi-batch processing

I've put together a semi-automated macro to do particle size and shape analysis. It loads all the configuration files as needed, does an initial Manual Threshold, then uses Interaction to prompt the user to adjust/confirm the threshold settings. The macro then collects the data in data collector.


My problem has to do with the ease of use; when the Interaction window pops up, the Project Explorer tab comes to the front. I'd like for the program to prompt for interaction, but pull the Measure:Threshold Tool to the front so the user doesn't have to click around to Segmentation to open up the Tool. Is there a way in the macro designer to prompt the Threshold Tool to the front and/or prevent the Project Explorer tab from coming to the front when it is running a macro?


I'd like to do this through the macro so that the overlay that the user is familiar with doesn't need to be changed e.g. not just making the threshold tool a floating window or docked elsewhere.

Best Answer

  • edited June 2018 Accepted Answer
    Ok, I can see that you are using Interaction command. In my example above I showed how to use interaction in the Thresholds command, here is how the code should look in Interaction command:

            With Automate.ScriptingCommands.Interaction(AdjustThreshold)
                .Interactive = True
                .Prompt = "Select Particle Threshold"
                .InteractionPanel="ThresholdTool"
                .InteractionLocation = MediaCy.IQL.Application.McCommand.InteractionPosition.OutsideLeft
                .Run(doc1, Nothing)
            End With
    
    

    Yuri

Answers

  • edited June 2018
    The project explorer comes up when the input of the interactive command is Nothing. You can set the input to doc1(your active image) or even a panel.

    Here is an example how to show prompt on the left side of the Threshold Tool panel:
            With Measure.ThresholdToolCommands.Thresholds(AdjustThreshold)
                .AllowOverlap = False
                .Interpretation = eInterpretation.Mono
                .Classes = New System.Collections.Generic.List(Of SegmentationClass)
                .Classes.Add(New SegmentationClass("Class 1",System.Drawing.Color.Blue,New Double(){0R,68R}))
                .Prompt = "Adjust threshold and click Ok"
                .Interactive = True
                .InteractionPanel="ThresholdTool"
                .InteractionLocation=McCommand.InteractionPosition.OutsideLeft
                .Run(doc1)
            End With 
     
    You just need to assign 2 properties: InteractionPanel and InteractionLocation.

    Yuri



  • I run the Find Manual tool before the interaction, which usually brings up the Measurement: Threshold Tools tab indicated by the red arrow. When the Interaction command runs, it jumps back to the Project Explorer tab.

  • YuriG said:
    Ok, I can see that you are using Interaction command. In my example above I showed how to use interaction in the Thresholds command, here is how the code should look in Interaction command:

            With Automate.ScriptingCommands.Interaction(AdjustThreshold)
                .Interactive = True
                .Prompt = "Select Particle Threshold"
                .InteractionPanel="ThresholdTool"
                .InteractionLocation = MediaCy.IQL.Application.McCommand.InteractionPosition.OutsideLeft
                .Run(doc1, Nothing)
            End With
    
    

    Yuri


    This worked perfectly. Thank you for the simple explanation and fix, Yuri!
Sign In or Register to comment.