Functions (sorted by type)
Top  Previous  Next

The function is a fundamental modular unit of ImageWarp scripting language. A function is usually designed to perform a specific task, and its name often reflects that task.

Math

sqr
Returns the square root of a number
hypot
Calculates the hypotenuse
abs
Returns the absolute value of a number
sin
Returns the sine of an angle
cos
Returns the cosine of an angle
tan
Returns the tangent of an angle
aTan
Returns the arctangent of a number
aSin
Returns the arcsine of a number
aCos
Returns the arccosine of a number
aTan2
Returns the arctangent of x/y
degToRad
Converts degrees to radians
radToDeg
Converts radians to degrees
exp
Returns e (the base of natural logarithms) raised to a power
log
Returns the natural logarithm of a number
log10
Returns the logarithm to the base 10
   

Strings

len
Returns the number of characters in a string
inStr
Returns the position of the first occurrence of one string within another
left
Returns a specified number of characters from the left side of a string
right
Returns a specified number of characters from the right side of a string
mid
Returns a specified number of characters from a string
lTrim
Returns a copy of a string without leading spaces
rTrim
Returns a copy of a string without trailing spaces
uCase
Returns a string that has been converted to uppercase
lCase
Returns a string that has been converted to lowercase.
chr
Converts integers to corresponding ASCII characters
asc
Returns the ASCII character code corresponding to the first letter in a string


Type control

isInteger
Returns a TRUE if argument is integer or FALSE if it is not
isFloating
Returns a TRUE if argument is floating or FALSE if it is not.
isString
Returns TRUE if argument is string or FALSE if it is not
asInteger
Converts argument to integer
asFloating
Converts argument to floating
asString
Converts argument to string


Video

showVideo
Shows or hides the Video window
setVideoPal
Applies pseudo-coloring to the Video window
setVideoPos
Sets the Video window's position and size
getVideoPos
Retrieves the Video window's position and size
setVideoScroll
Sets the position of the viewable area in the Video window
getVideoScroll
Retrieves the position of the viewable area in the Video window
setVideoZoom
Sets the zoom factor of the Video window
getVideoZoom
Returns the zoom factor of the Video window
getVideoType
Returns the type of the incoming video
getVideoWidth
Retrieves the horizontal size of the video in pixels
getVideoHeight
Retrieves the vertical size of the video in pixels
setVideoDevice
Selects the current video device or camera by index
setVideoCamera
Selects the current video device or camera by name
setVideoMode
Selects the current video mode or format by index


Images

createIm
Creates a new image
isImage
Determines the existance of an image frame
loadIm
Loads an existing image from a file
loadRaw
Imports the image from a non-standard image file
loadAVI
Loads a sequence from an existing AVI file
saveIm
Saves an image to a file
closeIm
Closes an existing image
closeAll
Closes all open documents
copyIm
Copies an image to the Clipboard
pasteIm
Pastes an image from the Clipboard
setImFocus
Sets the focus to an image
setImPos
Sets the position and size of an image frame in the workspace
setImScroll
Sets the position of the viewable area in an image frame
setImZoom
Sets the zoom factor of an image
getImPos
Retrieves the position and size of an image frame in the workspace
getImScroll
Retrieves the position of the viewable area in an image frame
getImZoom
Retrieves the zoom factor of an image
getImType
Retrieves the type of an image
getImWidth
Retrieves the horizontal size of an image in pixels
getImHeight
Retrieves the vertical size of an image in pixels
setDisplayRange
Sets the minimum and maximum value of the display range of an image
getDisplayRange
Retrieves the minimum and maximum value of the display range of an image
setComplexMode
Changes the active component of a complex image
getComplexMode
Retrieves the mode of the active component of a complex image
getMaxPixel
Retrieves the maximum permitted pixel value for an image
updateIm
Turns the automatic update of an image on screen on and off


Selections

setSelect
Creates a selection (region of interest) on an image
resetSelect
Removes a selection from an image
getSelect
Retrieves the coordinates of the bounding rectangle of the selection
copySelect
Copies a selection from one image to another
maskSelect
Converts a selection into a binary mask


Drawing

getPixel
Retrieves a pixel's value
setPixel
Sets the value of a pixel in an image
setDrawColor
Sets a current draw color for an image
setFillColor
Sets a current fill color for an image
setPencil
Sets the width of the Pencil tool
setBrush
Changes the settings for the Brush tool
setFlood
Sets the tolerance of the Flood tool
setFont
Sets the font for the text tool
drawPencil
Draws on an image using the Pencil tool
drawBrush
Draws on an image using the Brush tool
drawFlood
Fills an area in an image using the Flood tool
warp
Applies a linear warp to an image
drawLine
Draws a straight-line segment on an image
drawArrow
Draws a straight-line segment with an arrow at the end
drawRect
Draws a rectangle on an image
drawEllipse
Draws an ellipse on an image
drawText
Draws a string of text on an image


Conversion

to48bit
Converts an image into an RGB 48-bit high-depth color image
to32bit
Converts an image into an RGB 32-bit high-depth color image
to24bit
Converts an image or selection into a 24-bit true color bitmap
to16bit
Converts an image or selection into a high-color bitmap (5 bits per channel)
To8bit
Converts an image or selection into a 256-color bitmap
To4bit
Converts an image or selection into a 16-color bitmap
toGray
Converts an image or selection into an 8-bit standard grayscale format
toGray16
Converts an image or selection into a 16-bit high-depth grayscale format
toGray32
Converts an image or selection into a 32-bit high-depth grayscale format
toFloat
Converts an image or selection into a floating point grayscale format
toComplex
Converts an image or selection into a 64-bit complex grayscale format
toMulti
Converts an image or selection into a multiphase 256-band image
to1bit
Converts an image into a two color binary bitmap
toSequence
Converts an image into a one-frame sequence
bayer
Converts an 8-bit color filter array image into a 24-bit RGB image
splitRGB
Split a color image into the Red, Green and Blue component images
splitHLS
Split a color image into the H, L, S component images
splitYIQ
Splits a color image into the Y, I, Q component images
splitIHS
Splits a color image into the I, H, S component images
splitLCH
Splits a color image into the L, C, H component images
splitLab
Splits a color image into the L, a*, b* component images
mergeRGB
Merges the R, G, B components of a color image into an RGB image
mergeHLS
Merges the H, L, S components of a color image into an RGB image
mergeYIQ
Merges the Y, I, Q components of a color image into an RGB image
mergeIHS
Merges the I, H, S components of a color image into an RGB image
mergeLCH
Merges the L, C, H components of a color image into an RGB image
mergeLab
Merges the L, a*, b* components of a color image into an RGB image
splitComplex
Splits a complex image into two floating point component images
mergeComplex
Merges two floating point component images into a complex image


Sequences

loadAVI
Loads a sequence from an existing AVI file
getFrameCount
Returns the number of frames in a sequence
getFrameDelay
Retrieves the interval between frames in a sequence
setFrameNumber
Sets the current frame in a sequence
setFrameDelay
Sets the interval between frames in a sequence
seqPlay
Controls playback of a sequence
seqSplit
Splits a sequence into a series of single images
seqMerge
Merges two sequences into a new sequence
seqAdd
Adds a frame to the end of a sequence
seqInsert
Inserts a frame or sequence in a sequence
seqExtract
Extracts a frame from a sequence
seqAvrg
Averages frames in a sequence
seqDiff
Differentiates frames in a sequence
   

Acquisition

grabIm
Captures a single image from the video device
grabAvrg
Captures a single image by averaging several video frames
grabInt
Captures a single image by integrating several video frames
grabSeq
Captures several video frames as an image sequence
grabSeqAvrg
Captures a sequence by continuously averaging most recent frames
grabFile
Captures images from the video device and stores them in files
grabAVI
Captures an AVI file from the video device
grabTrig
Issues the software trigger signal
grabAbort
Aborts acquisition of the current frame
twainSelect
Opens Select Source dialog box for selecting a TWAIN device
twainAcquire
Opens a manufacturer's user interface for TWAIN acquisition
twainGrab
Captures an image from the TWAIN device without displaying user interface
twainSeq
Captures a sequence from the TWAIN device


setColorSpace
Assigns a color space for image processing


Adjustment

adjContrast
Adjusts the contrast, brightness and gamma of an image
adjLevels
Performs the linear scaling of an image
adjHueSat
Adjusts the hue and/or saturation values of an image
adjColors
Adjusts the color balance of an image


Geometry

resize
Resizes an image
rotate
Rotates an image at a desired angle
flip
Reverses an image horizontally or vertically
translate
Translates an image horizontally or vertically
affine
Applies an arbitrary affine transformation to an image
align
Aligns one image with another by defining a set of fiducial points
duplicate
Copies an image or selection to another image
extract
Extracts a rectangular part from an image
embed
Inserts an image into another image
split
Splits an image into several images
stitch
Stiches two overlapping images


Background

bkTrack
Removes or extracts background from an image by erasing objects of interest
bkBlow
Removes or extracts background by dilating it inside objects of interests
bkCorrect
Corrects an image background using images of dark and white field
bkAssign
Assigns background for optical density measurements


Segmentation

threshold
Performs binary thresholding of an image
threshMulti
Performs multiphase thresholding of an image
threshRGB
Performs RGB thresholding on a color image
threshHLS
Performs HLS thresholding on a color image
threshTrim
Performs automatic thresholding by trimming the histogram of an image
threshUnimod
Performs automatic thresholding based on the unimodal distribution
threshMin
Performs automatic thresholding based on the histogram minimum search
threshWater
Performs automatic thresholding by finding the valleys in the histogram
threshDistr
Performs automatic thresholding by minimizing the distribution error
threshVar
Performs automatic thresholding based on the minimum of variance
threshGauss
Performs automatic threshodling by fitting the Gaussian to the histogram
threshVarLocal
Perform adaptive segmentation based on the local minimum of variance
threshGaussLocal
Perform adaptive segmentation by fitting the Gaussian to the local histogram
threshDistrLocal
Perform adaptive segmentation by minimizing the local distribution error


Palette

loadPal
Loads an existing palette from a palette file to an image
setPal
Applies one of the predefined palettes to an image
savePal
Saves the palette from a palettized or pseudo-colored image to a file
copyPal
Copies the palette from a palettized or grayscale image to another one
rotatePal
Modifies an image palette by shifting its entries
resetPal
Loads a standard 256-level gray palette to a grayscale image
loadMap
Loads a display map to a grayscale image
applyMap
Applies a display map to an image by changing its pixels


Arithmetic

invertIm
Inverts pixel values in an image
offsetIm
Adds a constant value to each pixel in an image
factorIm
Multiplies each pixel in an image to a constant value
avrgIm
Finds an average value of two images on a pixel-by-pixel basis
addIm
Adds two images on a pixel-by-pixel basis
subIm
Subtracts one image from another on a pixel-by-pixel basis
mulIm
Multiplies two images on a pixel-by-pixel basis
divIm
Divides one image by another on a pixel-by-pixel basis
diffIm
Finds absolute differences of two images on a pixel-by-pixel basis
combIm
Finds the linear combination of two images on a pixel-by-pixel basis
minIm
Finds the minimum of two images on a pixel-by-pixel basis
maxIm
Finds the maximum of two images on a pixel-by-pixel basis
odRatio
Creates an optical density image
   

Logic

notIm
Performs a bitwise logical "NOT" on pixel values of an image
andIm
Performs a bitwise logical "AND" between pixels in two images
orIm
Performs a bitwise logical "OR" between pixels in two images
xorIm
Performs a bitwise logical "XOR" between pixels in two images
nandIm
Performs a bitwise logical "NAND" between pixels in two images
norIm
Performs a bitwise logical "NOR" between pixels in two images
xnorIm
Performs a bitwise logical "XNOR" between pixels in two images
lshiftIm
Performs a bitwise left shift on all pixels of an image
rshiftIm
Performs a bitwise right shift on all pixels of an image
maskIm
Masks a source image with an image of the multiphase type
   

Generating

genImpulse
Generates an impulse noise with a user-defined amplitude and density
genNoise
Generates a random noise with a user-defined distribution
genWedge
Generates a gray or color wedge
genShading
Applies non-uniform light distribution to an image
genGrid
Superimposes a rectangular grid on an image
genSine
Generates a flat sine wave
   

Enhancement

emphasize
Emphasizes fine detail in an image by applying the unsharp mask
sharpen
Sharpens an image by applying the sharpening filter
clarify
Enhances an image by applying the nonlinear lowpass filter
maxmin
Emphasizes edges of objects while suppressing the noise
normalize
Enhances the contrast of an image by normalizing its histogram
equalize
Enhances the contrast of an image by equalizing its histogram
   

Smoothing

lowpass
Applies the lowpass filter to an image
median
Applies the median filter to an image
sigma
Applies a non-linear smoothing to an image
gauss
Applies the discrete Gaussian filter to an image
saltPepper
Removes the salt-and-pepper type of noise from an image
deinterlace
Removes motion artifacts from an interlaced image


Edges

sobel
Detects princiPaledges on an image by applying the Sobel operator
prewitt
Detects edges on an image by applying the Prewitt operator
laplace
Detects points, lines and edges by applying the Laplacian operator
roberts
Detects fine edges on an image by applying the Roberts cross operator
highpass
Extracts high frequency components from an image
gradient
Extracts gradient information from an image
range
Detects textures in an image by applying the range operator
variance
Detects edges and textures in an image by applying the variance operator
   

Miscelaneous filters

emboss
Creates a 3D-effect appearance of an image
floyd
Applies the Floyd-Steinberg dithering to an image
pixelate
Creates a mosaic effect on an image
fourier
Applies the direct or inverse Fourier transform to an image
convolve
Applies a linear convolution to an image
convolveFFT
Applies an FFT-based linear convolution to an image
   

Basic Morphology

Erode
Erodes bright objects on an image and dilates dark ones
dilate
Dilates bright objects on the image and erodes dark ones
open
Separates narrowly connected bright objects and removes small ones
close
Fills gaps in bright objects and connects objects that are close together
contour
Extracts contours of objects
thin
Reduces bright objects to their skeletons
thicken
Grows bright objects from their skeletons
prune
Removes branches from skeletons
topHat
Detects small bright regions
bottomHat
Detects small dark regions
convex
Builds convex halls of objects in a multiphase image


Geodesy

distance
Performs the distance transform of a binary image
direction
Performs the direction transform of an image
localMin
Finds local minima of intensity in an image
localMax
Finds local maxima of intensity in an image
ends
Finds end points of skeletons or ridges of intensity
nodes
Finds node points of skeletons or ridges of intensity
saddles
Finds saddle points of ridges of intensity
separate
Separates touching convex objects in a binary image
ultErode
Reduces objects in a binary image to single pixels or small groups of pixels
medialAxis
Performs the medial axis transform of a binary image
watershed
Finds the ridges of intensity in an image
waterfall
Creates basins of intensity in an image
   

Connvectivity

identify
Identifies connected components in a binary image
label
Labels or erases an object in a multiphase image
fill
Fills holes in objects in a multiphase image
border
Removes objects that touch the borders of a multiphase image or selection
featureAnd
Extracts the features (blobs) that match foreground pixels in another image
scrap
Removes small objects in a multiphase image
skip
Removes or extract objects based on a selected parameter's range
classify
Classifies objects based on a selected geometrical parameter
link
Connects the ends of linear structures in a binary image
   

Kernel Morphology

erodeKernel
Performs erosion with a user-defined kernel
DilateKernel
Performs dilation with a user-defined kernel
OpenKernel
Performs opening with a user-defined kernel
CloseKernel
Performs closing with a user-defined kernel
topHatKernel
Applies the tophat operator with a user-defined kernel
bottomHatKernel
Applies the bottomhat operator with a user-defined kernel
hitOrMiss
Applies "hit-or-miss" operator with two user-defined kernels
template
Performs a binary template matching on a multiphase image


Calibration

spaceCal
Opens the Spatial Calibration dialog box
loadSpaceCal
Applies an existing spatial calibration scale to an image
defSpaceCal
Assigns a default spatial calibration scale
setSpaceCal
Defines a spatial calibration scale and applies it to an image
getSpaceCal
Retrieves parameters of a current spatial calibration scale of an image
intCal
Opens the Intensity Calibration dialog box
loadIntCal
Applies an existing intensity calibration scale to an image
defIntCal
Assigns a default intensity calibration scale


Parameters

selectParam
Selects parameters for automatic measurements
resetParam
Clears the list of measurement parameters previously selected
renameParam
Renames a measurement parameter
setParamScope
Sets the scope of parameters for interactive measurements
getParamValue
Retrieves the value of a specified measurement parameter
setParamValue
Sets the value of a specified measurement
getParamSize
Retrieves the size of a specified measurement parameter of the vector type
setParamSize
Sets the size of a specified measurement parameter


Measurements

setMeasAttr
Sets the attributes for blob measurement functions
measObjects
Performs automatic blob measurements
measFields
Performs automatic field measurements
measBlobs
Activates interactive blob measurements
measPoints
Activates interactive point measurements
measCount
Activates interactive count of objects
measLines
Activates interactive line measurements
measAngles
Activates interactive angle measurements
measContours
Activates interactive contour measurements
measCurves
Activates interactive curve measurements


Histogram

setHistAttr
Sets environmental parameters for the histogram
showHistogram
Shows or hides the Histogram window
setHistPos
Sets the position and size of the Histogram window
measHistogram
Measures the histogram of a current image or selection
   

Line profile

setProfile
Sets the shape and position of the profile line
showProfile
Shows or hides the Line profile tool
setProfilePos
Sets the position and size of the Line profile tool
measProfile
Measure the line profile


Data

loadData
Loads data from an existing data file to a table
refreshData
Reloads data from a file into to an opened table
setDataPos
Changes the position and size of a data table
showGrid
Shows or hides the Global Grid
setShowGrid
Enables or disables automatic display of the Global Grid
setGridPos
Changes the position and size of the Global Grid
setChartAttr
Sets the default attributes for the charts
createChart
Opens a new chart linked to a specified data table
setChart
Changes a chart's type and appearance
setChartPos
Changes the position and size of a chart
closeChart
Closes an existing chart
closeAllCharts
Closes all open charts
setTermPos
Changes the postion and size of the Terminal window
showTerm
Show or hides the Terminal window


Service

getWorkWidth
Retrieves the width of ImageWarp's workspace
getWorkHeight
Retrieves the height of ImageWarp's workspace
delFile
Deletes an existing file
renFile
Renames a file or folder
setCurDir
Changes the current directory
getCurDir
Returns the current directory
getFileCount
Returns the number of files matching specified conditions
getFileName
Returns the name of a file matching specified conditions
terminate
Terminates the script and closes ImageWarp
pause
Pauses the script execution
wait
Delays execution of the script for the specified number of milliseconds
getTicks
Retrieves the number of milliseconds elapsed since the system was started
randomize
Initializes the random number generator
rand
Generates a pseudorandom integer
msgBox
Displays a message box
strFormat
Writes formatted data to a string
call
Executes a specified series of statements
thread
Creates a new processing thread in the script
endThread
Terminates one or several processing threads
waitThread
Pauses execution of the script until one or several threads terminate


Communication

serialOpen
Opens a serial port and set up its attributes
serialClose
Closes the currently open serial port
serialClear
Clears the input and output buffers of a serial port
serialWait
Waits for a communication event on a serial port
serialRead
Reads a string of characters from a serial port
serialWrite
Writes a string of characters to a serial port
serialCount
Counts characters waiting in a serial port
clSerialOpen
Opens a camera-link serial device
clSerialConnect
Changes the connection of camera-link serial ports
clSerialClose
Closes a camera-link serial device
clSerialRead
Reads a string from a camera-link serial device
clSerialWrite
Writes a string to a camera-link serial device
getInputBit
Reads the state of a general purpose input bit of the framegrabber
setOuputBit
Sets the state of a general purpose output bit of the framegrabber


Error handling

getError
Returns the last error code
getErrorText
Returns the description of an error