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
-
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
0
Answers
-
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
0 -
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.
0 -
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!0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions