Click or drag to resize

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.

Objects vs. Functions

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 Groups & Image-Pro 10 Namespaces

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 Groups and their Namespace Equivalent

Auto-Pro Group

Abbreviation

New Namespace

3D Filters

Flt3D

MediaCy.Automation.Process.Filter

3D Viewer

View3D

NDViewCommands

Acquire

Acq

CaptureCommands

Align Images

Align

MediaCy.Automation.Process.Align

Area Density

Dens

MeasurementsCommands

Background Correction

OpBkgnd

BackgroundCommands

Batch Conversion

Ws

AutomateCommands

Bayer Interpolation

Bayer

CaptureCommands

BCG and Color Map

Lut

LookupTableCommands

Bitmap Analysis

Bit

BitmapViewCommands

Calibration

Cal

MediaCy.Automation.Measure.Calibration

Caliper

Clpr

MediaCy.Automation.Measure.LineProfile

Chart

Chrt2D

HistogramCommands

Clipboard Operations

Ws

RoiCommands

Co-Localization

CoLoc

ColocalizationCommands

Color Composite

Cmp

ColorCompositeCommands

Color Correction

Col,ColCal

ImageCommands

Color Management

Cmm

ImageCommands

Color Segmentation

Seg

MediaCy.Automation.Measure.SmartSegmentation

Color Transform

Cm,CmChannel

ImageCommands

Convert To

Ws

ImageCommands

Count/Size

Blb

MeasurementsCommands

Demo Macro

Demo

ScriptingCommands

Data Collector

Dc

MediaCy.Automation.Measure.Data.Collector

Display Range

Dr

LookupTableCommands

Duplicate

Ws

RoiCommands

Dye Information

Dye

DyeCommands

Dynamic Data Exchange

Dde

ExportCommands

Extended Depth of Field

EDF

EDFCommands

FFT

Fft

FFTCommands

File Name Operations

St

Path

Fill

Ws

ImageCommands

File Signature

Fs

AuditTrailCommands

Filtering

Flt

MediaCy.Automation.Process.Filter

Grid Mask

Grid

GridOverlayCommands

Histogram

Hst

HistogramCommands

Image Database

Db,Gal

N/A

Image Overlay

Ovr

AnnotationsCommands

Image Signature

Is

AuditTrailCommands

Image Window

An,Draw,Doc,Plot,Text

WindowCommands

Info

Ws

DocumentCommands

Internet Access

FTP

System.Net

Large Spectral Filters

LSFlt

LargeCommands

Lens Information

Lens

LensCommands

Line Profile

Prof

MediaCy.Automation.Measure.LineProfile

Live EDF and Tiling

Live

LiveEDFCommands

Local Zoom

LocZoom

LocalZoomMcCommand

Macro Operations

Macro

ScriptingCommands

Manual Tagging

Tag

MeasurementsCommands

Mass Calibration

ACal

IntensityCommands

Measurements

Meas

MeasurementsCommands

Measure Distances

Dist

DerivedCommands

Memory Management

Mmon

ResourceCommands

Mosaic

Mosaic

N/A

New

Ws

ImageCommands

Open

Ws

DocumentCommands

Operations

Op

ProcessCommands

Output Window

Output

AutomateCommands

Palette Window

Pal

PseudoColorCommands

Port Configuration

PortIO

N/A

Print

Prt

DocumentCommands

Pseudo-Color

Pc

PseudoColorCommands

Registration

Reg

CompareCommands

Rendering

Rend

NDViewCommands

Report Generator

Rpt

ReportCommands

Resize

Ws

ImageCommands

Reload

Ws

DocumentCommands

Rotate

Ws

ImageCommands

Save/Save As

Ws

DocumentCommands

Scanning

Scan

N/A

Scope-Pro

Stage

N/A

Screen Capture

Cap

WindowCommands

Scrolling/Panning

Ws

ZoomPanScrollMcCommand

Sequence Gallery

SeqG

FramesCommands

Sequencer

Seq

ImageViewCommands

Set Manager

Sm

ImageSetCommands

Sort Objects

Sort

SortedObjectsImageMcCommand

Surface Plot

Surf

MediaCy.Automation.View.Surfaceplot

Template Mode

Template

Interactive property

Test Strips

Wstest

MediaCy.Automation.Process

Third-Party Plug-in

PI

N/A

Tile Images

Tile

TilingCommands

Trace Objects

Trace

ToolsCommands

Tracking

Track

MediaCy.Automation.Measure.Tracking

Undo

Ws

WindowCommands

User Input

St

InputBox

Zoom

Ws

ZoomPanScrollMcCommand

Workflow Toolbar

Toolbar

ScriptingCommands

Understanding Image-Pro 10 Macro Variables

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.

VB
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