How do I get a list of the available SPATIAL CALIBRATIONS?
All --
I would like to create a DROP DOWN MENU within a PREMIER APPLICATION so the user can select the SPATIAL CALIBRATION that will be applied to each image as it is analyzed.
I have the following code which applies a SPATIAL CALIBRATION based on its name.
-------------------------------------------
-------------------------------------------
I do not see a way to get a list of the SPATIAL CALIBRATIONS though.
I do see
Image-Pro Premier Automation Help
GetFilteredList Method (IncludeFlags, ExcludeFlags)
Can a PREMIER GURU please provide a mechanism to get a list of the available SPATIAL CALIBRATIONS appropriate for this challenge?
Thanks.
-- Matt
I would like to create a DROP DOWN MENU within a PREMIER APPLICATION so the user can select the SPATIAL CALIBRATION that will be applied to each image as it is analyzed.
I have the following code which applies a SPATIAL CALIBRATION based on its name.
-------------------------------------------
Public Sub ApplySelectedCalibration Dim var1 = "10x/0.30 DRY + 1.0 X", spcal1 With Measure.Calibration.SpatialCommands.Define(Nothing) .Run(var1, spcal1) End With With Measure.Calibration.SpatialCommands.SetActive(Nothing) .FilterInput = True .Run(spcal1) End With End Sub
-------------------------------------------
I do not see a way to get a list of the SPATIAL CALIBRATIONS though.
I do see
Image-Pro Premier Automation Help
GetFilteredList Method (IncludeFlags, ExcludeFlags)
Automation
Reference ► MediaCy.IQL.Calibrations ► IMcSpatialCalibs ►
GetFilteredList(mccfCalibFlags, mccfCalibFlags)
which contains the example code
but I cannot resolve the syntax errors that appear when I paste this into a PREMIER MODULE.which contains the example code
' Get a collection of all reference calibrations Set newList = SpatialCalibs.GetFilteredList(mccfIsReference, 0) ' Get a collection of all calibrations that are NOT derived calibrations Set newList = SpatialCalibs.GetFilteredList(0, mccfWasDerived)
Can a PREMIER GURU please provide a mechanism to get a list of the available SPATIAL CALIBRATIONS appropriate for this challenge?
Thanks.
-- Matt
0
Best Answer
-
Hi Matt,Some code in the examples is old designed for VB6 and IQBase. We are working on converting them to new syntax, but you can also convert them manually using some simple rules: if you see "Set" in the examples, then you just should remove it. If some object variables are not defined, add ThisApplication in front of it. The new syntax is more strict, so all variables must be defined and full enum syntax is used. The code should look like:
' Get a collection of all reference calibrations Dim newList newList = ThisApplication.SpatialCalibs.GetFilteredList(MediaCy.IQL.Calibrations.mccfCalibFlags.mccfIsReference, 0)
Here is the macro that will print all spatial calibrations:Public Sub PrintAllSpatialCalibrations Dim calibs As MediaCy.IQL.Calibrations.McSpatialCalibs=ThisApplication.Engine.SpatialCalibs For Each cal As MediaCy.IQL.Calibrations.McSpatialCalib In calibs Debug.Print cal.Name & " PixelSize = " & cal.PixelSizeX.ToString Next End Sub
Regards,Yuri0
Answers
Thank you for your prompt response.
The information about the HELP FILE EXAMPLE CODE is helpful and the example macro you provided shows the technology perfectly.
I've integrated your code into my code and produced the following two macros.
The first macro is a modification of the LOAD routine within a PREMIER APP. Your code has been integrated in to populate the COMBOBOX1 control
The second macro is a routine that will be called when it is appropriate to calibrate the active image according to the user's setting of the COMBOBOX1 control.
Thanks again.
-- Matt
--------------------------------
--------------------------------
--------------------------------