Converting Auto-Pro Macros |
![]() |
In contrast to the new scripting libraries, Image-Pro Plus used the Auto-Pro library to handle its automation. Unlike the object-oriented libraries used by Image-Pro 10, Auto-Pro is function based, gathering the hundreds of subroutines required to control Image-Pro Plus. This section introduces the approach used in order to convert Image-Pro Plus macros to their newer equivalent.
The Automation Library introduces an object-oriented architecture which differs substantially from the procedural layout that Auto-Pro was using. Instead of chaining function calls with many parameters, macros now interact with higher level commands which combine all the characteristics of a given feature into one logical and self-contained entity. Consequently, the main task involved in converting Auto-Pro macros is to find the commands exposing the equivalent properties to those function parameters used in Auto-Pro.
Auto-Pro functions are organized by groups of related commands. The group is typically defined by an abbreviation found in the function prefix, after the leading Ip prefix. The table below shows these groups, their prefix and the new equivalent namespace or module when it exists. Namespaces are used in modern programing languages to group related features.
Auto-Pro Group | Abbreviation | New Namespace |
---|---|---|
3D Filters | Flt3D | |
3D Viewer | View3D | |
Acquire | Acq | |
Align Images | Align | |
Area Density | Dens | |
Background Correction | OpBkgnd | |
Batch Conversion | Ws | |
Bayer Interpolation | Bayer | |
BCG and Color Map | Lut | |
Bitmap Analysis | Bit | |
Calibration | Cal | |
Caliper | Clpr | |
Chart | Chrt2D | |
Clipboard Operations | Ws | |
Co-Localization | CoLoc | |
Color Composite | Cmp | |
Color Correction | Col,ColCal | |
Color Management | Cmm | |
Color Segmentation | Seg | |
Color Transform | Cm,CmChannel | |
Convert To | Ws | |
Count/Size | Blb | |
Demo Macro | Demo | |
Data Collector | Dc | |
Display Range | Dr | |
Duplicate | Ws | |
Dye Information | Dye | |
Dynamic Data Exchange | Dde | |
Extended Depth of Field | EDF | |
FFT | Fft | |
File Name Operations | St | Path |
Fill | Ws | |
File Signature | Fs | |
Filtering | Flt | |
Grid Mask | Grid | |
Histogram | Hst | |
Image Database | Db,Gal | N/A |
Image Overlay | Ovr | |
Image Signature | Is | |
Image Window | An,Draw,Doc,Plot,Text | |
Info | Ws | |
Internet Access | FTP | System.Net |
Large Spectral Filters | LSFlt | |
Lens Information | Lens | |
Line Profile | Prof | |
Live EDF and Tiling | Live | |
Local Zoom | LocZoom | |
Macro Operations | Macro | |
Manual Tagging | Tag | |
Mass Calibration | ACal | |
Measurements | Meas | |
Measure Distances | Dist | |
Memory Management | Mmon | |
Mosaic | Mosaic | N/A |
New | Ws | |
Open | Ws | |
Operations | Op | |
Output Window | Output | |
Palette Window | Pal | |
Port Configuration | PortIO | N/A |
Prt | ||
Pseudo-Color | Pc | |
Registration | Reg | |
Rendering | Rend | |
Report Generator | Rpt | |
Resize | Ws | |
Reload | Ws | |
Rotate | Ws | |
Save/Save As | Ws | |
Scanning | Scan | N/A |
Scope-Pro | Stage | N/A |
Screen Capture | Cap | |
Scrolling/Panning | Ws | |
Sequence Gallery | SeqG | |
Sequencer | Seq | |
Set Manager | Sm | |
Sort Objects | Sort | |
Surface Plot | Surf | |
Template Mode | Template | Interactive property |
Test Strips | Wstest | |
Third-Party Plug-in | PI | N/A |
Tile Images | Tile | |
Trace Objects | Trace | |
Tracking | Track | |
Undo | Ws | |
User Input | St | InputBox |
Zoom | Ws | |
Workflow Toolbar | Toolbar |
Whereas most Auto-Pro functions implicitly apply their operations to the active image or ROI, the new scripting language uses variables to designate the data objects affected by commands. These objects can be generic documents, images or image sets for instance and are either the command's input or output. In this model, the variables effectively drive the data flow in the macro and allow more complex constructs which are not necessarily depending on image visibility and activation to accomplish their task. In the example below docList1 and doc1 are used to control how the image data "flows" from one command to the next. Each command specifies its parameters first and then the input and output data in the Run() call.
Public Function PremierDataFlow() As SimpleScript PremierDataFlow = New SimpleScript Dim docList1 = New List(1), doc1 With Application.DocumentCommands.Open(PremierDataFlow) .Filenames = New String() {ThisApplication.Path(mcPathType.mcptSampleImages) & "Filter\Sharpening\FPRINT2.TIF"} .Run(docList1) End With With Application.DocumentCommands.Activate(PremierDataFlow) .Run(docList1(0), doc1) End With With Process.Filter.EnhancementCommands.Sharpen(PremierDataFlow) .Passes = 1 .KernelSize = Filters.mcKernelSize.mcks3x3 .Strength = 100 .Run(doc1, doc1) End With End Function