Threshold Classes
Hello
I've wrote an automation that applies 5 threshold classes to an image however when I try to delete the classes I find I can't. I recorded the code below
Dim image1 With Application.DocumentCommands.ActiveImage(NewMacro) .Run(image1) End With With Measure.ThresholdToolCommands.Thresholds(NewMacro) .AllowOverlap = False .Interpretation = eInterpretation.Mono .Classes = New System.Collections.Generic.List(Of SegmentationClass) .Classes.Add(New SegmentationClass("Class ",System.Drawing.Color.Blue,New Double(){205R,255R})) .Run(image1) End With
This code doesn't remove the other classes it just adds another. When I recorded I deleted each class in sequence but it doesn't seem to have recorded this. Also when I produce the classes I label them Class 1, Class2 etc but when they appear in the measurements table I find I'm upto Class 35 and this doesn't reset on restarting Premier. Are there any low level commands to reset the threshold classes .
Regards
David
0
Best Answer
-
Hello David,That Beta version is quite old, it could explain the differences in macro behaviour. I will send you a link to the latest Beta directly.Yuri0
Answers
Hello Yuri
It doesn't work, I run it and there are still 5 divided classes on the threshold tool
Regards
David
Hello Yuri
Just tried the reset classes button which works when you manually press it. However when I record the code to use in my automation the recorded code doesn't work it just adds another class and sends the classes already present all over the place. This is the recorded code I got.
Regards
David
Hello Yuri
Still doesn't work it just adds another class called MyClass and counts all the classes together. I can't attach my code in a file or put it in this window as its too big. I can put it on my server for download if that's OK
Regards
David
Hello Yuri
I have Reset existing data selected and I'm using Premier 3D 64bit Version 9.1.27 Build 5340
Regards
David
Hello Yuri
Updating to the latest version worked.
Regards
David