Loading Smart Segementation in macros
Is it possible to load a smart segmentation option before an image is opened? I'm trying to have a macro that sets everything up so the user only has to load an image and analyse it without having to load each setting individually.
0
Best Answer
-
Hi David,The recorded from UI command loads recipe only to existing image, but it's possible to load file directly to "Global Recipe". Here is the macro, which you can use in "Run before" batch processing:
Public Function LoadRecipeToGlobal() As SimpleScript LoadRecipeToGlobal = New SimpleScript With Automate.ScriptingCommands.CodeCommand(LoadRecipeToGlobal) If .Run() Then ' load recipe to Global Dim globalRecipe As MediaCy.Addins.LearningSegmentation.SegmRecipe=MediaCy.Addins.LearningSegmentation.Globals.m_SegmRecipe Dim FileName As String=ThisApplication.Path(mcPathType.mcptConfigurationFiles) & "Dark.isg" globalRecipe.Load(FileName,MediaCy.Addins.LearningSegmentation.McLearningSegmentation.ThisAddin.LS.Options) End If End With End Function
Note, that you have to ally global recipe processing every image (in "Loop on" batch macro).The following macro applies global recipe to active image:Public Function ApplyGlobalRecipe() As SimpleScript ApplyGlobalRecipe = New SimpleScript Dim doc1 With Application.DocumentCommands.Active(ApplyGlobalRecipe) .Run(doc1) End With With Measure.SmartSegmentation.RecipeCommands.ApplyGlobal(ApplyGlobalRecipe) .FilterInput = True .Run(doc1) End With End Function
Regards,Yuri0
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