Gatan Digital Micrograph Scripts
- Practical Electron Microscopy and Database -
- An Online Book -

http://www.globalsino.com/EM/  



 

 

=================================================================================

Scripts in Gatan Digital Micrograph (DM) are simple text files which can be written in any text-editor (e.g. the one in DM by clicking "File" then "New Script...") and are normally saved with the *.s file extension. All DM scripts are written based on C++ language with many simplifications. The codes are case-insensitive. White-spaces and tabulator-jumps are usually omitted.

As shown in Table 2597a, scripts compatible with Gatan DM package have many different simple or complicated applications, for instance:

        i) Multiple EEL spectrum acquisition, relative horizontal shift in each line of streak image, and analysis may be performed using Digital Micrograph (Gatan) scripts. [1,2]

        ii) In EELS measurements, the correction of CCD channel-to-channel gain variation is important in order to obtain high detective quantum efficiency (DQE) (Ishizuka, 1993), to eliminate artifacts, and to measure an EEL spectrum without loss of signal-to-noise ratio, because each EEL spectrum can be shifted horizontally due to the energy instabilities. The correction of some energy instabilities (e.g. low frequency instabilities) can be performed with scripts in Digital Micrograph. [3]

        iii) In order to improve the energy resolution of EEL spectrum, before spectrum deconvolution, scripts can be used to automatically acquire and store each spectrum separately, and then to evaluate and correct the energy drift in each acquisition. [4, 5] After the drift correction, the EEL spectrum can be deconvoluted using software.

Table 2597a. DM Script Functions

\n Add a line break Example
IF (condition) action A statement to make decisions in a program to run the commands (if some condition is fulfilled) or not. E.g. Example1, Example2, Example3, Example4.  

IF (condition)
{
action1
action2
}

Make decisions in a program to run the commands or not Example1
Example2

IF (condition)
{
action1
action2
}
ELSE
{
alternative-action1
alternative-action2
}

Make decisions in a program to run the commands or not. {} brackets are used to create blocks of commands.  
else if   Example

IF (condition) action
ELSE alternative-action

Make decisions in a program to run the commands or not Example1
Example2
! (exclamation mark) A relational operator for a real number. Logical "not": Is placed immediately before an expression so that the user can click on Cancel to exit. E.g. Example1, Example2, Example3, Example4.  
IF (!GetNumber()) Exit(0), or IF (!GetNumber()) Break If not Get Number, then Exit. "IF (!...()) Exit(0)" have similar functions. Example1
Example2
Example3
if (0) or if (1) E.g. Example.  
H = H * (-1) or H *= -1 Inverse the contrast of image H Example
W = H * (-1) Inverse the contrast of image H and then give image-letter "W" to the new image Example
abs(a) Calculates absolute value of (a) a real number, (b) a complex
number
acos(a) Calculates the arccosine of a real number
AiryAi Calculates the Airy Ai function
AiryBi Calculates the Airy Bi function
cis Calculates a unit vector in the complex plane

 
asin(a) Calculates the arcsine of a real number
atan(a) Arc-tangent
atan2(a,b) Calculates the arctangent of y/x for real numbers
atanh(a) Calculates the hyperbolic arctangent of a real number
Remove annotations Remove all, remove a specific type Example1
Example2
void Example1, Example2, Example3, Example4. .  
Display   Example
void LinePlotImageDisplaySetContrastLimits( LinePlotImageDisplay lpid, Number lowLimit, Number highLimit ) Sets the lowest and highest intensities displayed. E.g. Example.  
ROI CreateROI( ) Creates an empty region of interest. Example.  
void ImageDisplayDeleteROI( ImageDisplay imgDisp, ROI roi ) Deletes the roi from this image display. E.g. remove all ROIs (link), and remove all line ROIs from a image (link). Example1
Example2
Tag   Example

RGB

Creates an RGB number from the real number arguments: Example.
       return Expression
or
       return
The result of a function is returned by using the return statement. This statement halts execution at the point at which it occurs in a function and resumes execution where the function was called: Example1, Example2, Example3.  
blue Returns the blue portion of an RGB number as a real number
green Returns the green portion of an RGB number as a real number
red Returns the red portion of an RGB number as a real number
rgba Creates an RGB number from the real number arguments
TagGroup Can either contain name - value pairs, where the value can be virtually anything, including other TagGroups, or can contain indexed tags. In the latter case, the TagGroup is referred to as a TagList.
Example1
Example2
Example3
Example4

Example5
"object" DM supports pre-defined objects such as image windows, image documents, images, image displays, tag groups, and regions of interest (ROI). Example
Objects In DM scripting, you can create your own objects and you can use objects already defined within DM. The pre-defined objects include items such as image windows, image documents, images, image displays, tag groups, and regions of interest.
Example
void Init( object self, TagGroup descriptor ) This function needs to be called in order to initialize the object. E.g. Example1, Example2, Example3, Example4, Example5, Example6.
 
FOR (initialize; condition; action) loop-action Loop statement: Create counting loops in a program. The counting process is repeated until a variable reaches a specific limit. (Comparison between with and without FOR command: Example1 and Example2), Example3, Example4, Example5, Example7.  

FOR (initialize; condition; action)
{
loop-action1
loop-action2
...
}

Loop statement: Create counting loops in a program. The counting process is repeated until a variable reaches a specific limit. Note the FOR statement should not be used for looping over image pixels in order to obtain optimal speeds of PCs, instead, an image expression should be used. E.g. Example1 (comparison with a script with ExprSize command), Example2,
 
string   Example1
Example2
"string" A basic types of variable. Some comments  
String +( String, RGBNumber ) Concatenates the RGB value to the string and returns the resulting string.  
String +( String, Number ) Concatenates the number to the string and returns the resulting string.  
String +( Number, String ) Concatenates the string to the number and returns the resulting string.  
String +( String, ComplexNumber ) Concatenates the complex number to the string and returns the resulting string.  

String +( ComplexNumber, String )

Concatenates the string to the complex number and returns the resulting string.
 
String +( RGBNumber, String ) Concatenates the string to the RGB value and returns the resulting string.  
String +( String, String ) Concatenates the string to the other string and returns the resulting string.  
Number asc( String, Number index ) Returns numeric value of he 'index'th character in of the string.
Number asc( String ) Returns the numeric value in ascii of the first character of the string.
Number asin( Number v1 )  
Number atan( Number v1 )  
Number atan2( Number x, Number y )  
BesselI Calculates the general Bessel I function
BesselJ Calculates the general Bessel J function
BesselK Calculates the general Bessel K function
BesselY Calculates the general Bessel Y function
Beta Calculates the beta function
BinomialCoefficient Calculates the binomial coefficient
Script Functions By Category
Annotations   Details
Persistent Notes   Details
Radio Button Functions   Details
List Functions   Details
Get Property Values   Details
Popup Menu Functions   Details
     
     
     
     
     
[] Run a script on the selected ROIs by adding a "rectangular ROI" Example
random Computes a random value in the range [0,1). Example
BinomialRandom Calculates a random number with binomial distribution
BinaryImage( "My Image", xsize, ysize )   Example
clip Clip real number to be in a range
distance Calculates the pythagorean theorem
erf Calculates the error function
erfc Calculates the complement of the error function
Boolean GetOneImage( String title, ImageVariable image1 ) Puts up a dialog and allows the user to choose an image. Returns 1 for Ok and 0 for Cancel. E.g. Example1, Example2.  
Boolean GetOneImageWithPrompt( String prompt, String title, ImageVariable image1 ) Puts up a dialog and allows the user to choose an image. Returns 1 for Ok and 0 for Cancel.  
Boolean GetOneLabeledImageWithPrompt( String prompt, String title, String label1, ImageVariable image1 ) Puts up a dialog and allows the user to choose an image. Returns 1 for Ok and 0 for Cancel.  
ExponentialRandom Calculates a random number with exponential distribution
Factorial Calculates the factorial of a real number
Gamma Calculates the gamma of a real number
GammaP Calculates the incomplete gamma function
GammaQ Calculates the complement of the incomplete gamma function
GammaRandom Calculates a random number with gamma distribution
GaussianRandom Calculates a random number with gaussian distribution
LegendrePolynomial Calculates the Legendre polynomial function
PoissonRandom Calculates a random number with poisson distribution
imaginary Returns the imaginary portion of a complex number as a real number
GetTwoImages Two image dialog Example
GetTwoImagesWithPrompt Two image dialog with prompt
DotProduct Calculates the dot product of (a) two real image expressions, (b) two complex image expressions.
conjugate Calculates the conjugate of a complex number
complex Creates a complex number from two real numbers
ExprSize Sets the physical size of (a) a real image expression, (b) a complex image expression, (c) an RGB image expression. E.g. Example1 (comparison with a script with FOR command), Example2, Example3.

ComplexImageExpression ExprSize( Number x, Number y, ComplexImageExpression value )

The ExprSize function is used to declare the size of a complex image expression that would otherwise be of an undefined size. The size is set to [x,y] and this function will return the value parameter.  

ComplexImageExpression ExprSize( Number x, Number y, Number z, ComplexImageExpression value )

The ExprSize function is used to declare the size of a complex image expression that would otherwise be of an undefined size. The size is set to [x,y,z] and this function will return the value parameter.  

ComplexImageExpression ExprSize( ImageReference image, ComplexImageExpression value )

The ExprSize function is used to declare the size of an image expression that would otherwise be of an undefined size. The size is set to the size of image expression and this function will return the value parameter.  

ComplexImageExpression ExprSize( Image image, ComplexImageExpression value )

The ExprSize function is used to declare the size of an image expression that would otherwise be of an undefined size. The size is set to the size of image expression and this function will return the value parameter.  
ImageExpression ExprSize( Number x, Number y, Number z, ImageExpression value ) The ExprSize function is used to declare the size of an image expression that would otherwise be of an undefined size. The size is set to [x,y,z] and this function will return the value parameter.  

RealImageExpression ExprSize( Number x, Number y, Number z, RealImageExpression value )

The ExprSize function is used to declare the size of a real image expression that would otherwise be of an undefined size. The size is set to [x,y,z] and this function will return the value parameter.  

RealImageExpression ExprSize( ImageReference image, RealImageExpression value )

The ExprSize function is used to declare the size of a real image expression that would otherwise be of an undefined size. The size is set to the size of image expression and this function will return the value parameter.  

RGBImageExpression ExprSize( Image image, RGBImageExpression value )

The ExprSize function is used to declare the size of an image expression that would otherwise be of an undefined size. The size is set to the size of image expression and this function will return the value parameter.  

RGBImageExpression ExprSize( Number x, Number y, RGBImageExpression value )

The ExprSize function is used to declare the size of an RGB image expression that would otherwise be of an undefined size. The size is set to [x,y] and this function will return the value parameter.  

RGBImageExpression ExprSize( Number x, Number y, Number z, RGBImageExpression value )

The ExprSize function is used to declare the size of a RGB image expression that would otherwise be of an undefined size. The size is set to [x,y,z] and this function will return the value parameter.  
Polynomial Calculates a polynomial expansion using (a) a real image expression, (b) a complex image expression.
compleximage A basic types of variable: Creates a complex image. Some comments
IsComplexDataType Checks if an image is a complex data type
IsIntegerDataType Checks if an image is an integer data type
IsRealDataType Checks if an image is a real data type
IsRGBDataType Checks if an image is an RGB data type
RealImage Creates a real image. E.g. refer to image crystal := RealImage("HRTEM image", 8, width, height) HRTEM
Example2
image crystal := RealImage("HRTEM image", 8, width, height) Create a two-dimensional (2-D) HRTEM image (8 byte) HRTEM
RGBImage Creates an RGB image. "RGBImage" is a basic type of variables (see some comments): Example.
     
ClearImage Clear an image
CloseImage Close an image
CreateImageFromDisplay Creates a display representation of an image
DeleteImage Delete the image with variable IMG Example
DoesImageExist Checks if an image exists
FindParticles Script-access to the Particle Analys is functionality of DigitalMicrograph was added in GMS 3.x with the FindParticles command. Example
Get2DSize Get the size of an image
GetFrontImage Gets the front image: It is the "parent" component of all things displayed on the image in a script Example1
Example2
Example3
GetImageDocument E.g. bring the second-last image to be the frontmost image (link), and assign names to the two earliest opened images and bring them to front (link) Example1
Example2
Example3
GetImageDataSeed Gets an image's data seed
GetImageFromID Gets image from an ID, returns false if none
GetImageID Gets an image's ID
GetLabel Gets the image letter of an image
GetName(IMG1) Read the name of the image IMG1 Example1
Example2
GetNamedImage Get an image from a name, returns false if none
getsize() Get the dimensions (size) of an image Example1
Example2
Example3
KeepImage() Retains an image
OpenImage Opens an image file
PrintImage Prints an image
SaveImage Saves an image
void FUNCTIONS

A function does not need to return a value (NonValue-Returning). In other programming languages, such a function is called a procedure or a subroutine. In C++-based DM scripts, such a function is identified simply by placing the keyword void where the function’s return type would be.

Example
SetName(IMG1, "The image that I want") Set the name of an image (IMG1 here) to a new name ("The image that I want" here) Example1
Example2
Example3
Example4
Example5
AnalyzeDiffractogram Analyzes a diffractogram
AutoCorrelation Calculates the cross correlation of a real image
CrossCorrelation Calculates the cross correlation of two real images
CrossProduct Calculates the cross product
FFT Calculates the complex FFT of a complex image
FlipHorizontal(Image) Flips an image horizontally
FlipVertical(Image) Flips an image vertically
GetPixel Gets a pixel in a real image. E.g. Example1, Example2.
IFFT Calculates the complex IFFT of a complex image
MatrixDeterminant Calculates the matrix determinant of a real image
MatrixInverse Calculates the matrix inverse of a real image
MatrixMultiply Multiplies two matrices: Calculates the matrix multiplication of a real image Example
MatrixPrint (xyz) Prints an image as a matrix Example
void Pose( object self ) Displays the dialog as a modal Dialog. E.g. Example1, Example2, Example3, Example4, Example5.
 
MatrixTranspose Calculates the matrix transpose of a real image
MedianFilter Applies a median filter to an image
RealFFT Calculates the complex FFT of a real image
RealIFFT Calculates the real IFFT of a hermitian complex image
Reduce Reduces an image by a factor of two
ReducedFFT Calculates reduced FFT
Rotate(Image, Rotation angle) Arbitrarily rotates an image: Rotates an image to the clock-wise with the rotation angle

String left( String, Number count )

Returns leftmost count characters of a string.  
asc Returns numeric value in ascii
chr Returns ascii equivalent of a number as a string
left Returns the leftmost portion of a string
len Returns the length of a string
mid Returns the middle portion of a string
right Returns the rightmost portion of a string
val Converts a string to a real number
RotateLeft Rotates an image to the left
RotateRight Rotates an image to the right
SetPixel Sets a pixel in a real image. E.g. Example1, Example2.
ShiftCenter Shifts each dimension of an image by half
SwapByteOrder Performs a byte swap on each pixel in an image
SwapWordOrder Performs a word swap on each pixel in an image
variance Calculates the variance of an image
DisplayAt Display image at position
GetCLUT Gets the CLUT of an image
GetOrigin(IMG1, Ox, Oy) Gets the origin of an image: Get the coordinates of the origin of the image IMG1 Example
void ApplyDataBar( ImageDisplay imgDisp ) Applies a data bar/scale bar to the image. Example
GetScale(IMG1, SCx, SCy) Get the scales for X and Y dimensions on the image IMG1. E.g. output length per pixel (pixel size) of the image (link). Example1
Example2
Example3
GetScale Gets the scale of an image
GetWindowPosition(IMG1, WX, WY) Get the position of the image window of the image IMG1 within the DM interface Example
SetWindowPosition(IMG1, 300, 100) Set the position of the image window of the image IMG1 in the DM interface Example
SetImagePositionWithinWindow(IMG1, 0, 0) Set the position of the top-left corner of the image IMG1 with respect to the image window
GetWindowSize(IMG1, SX, SY) Get the size (pixels) of the image window of the image IMG1 Example
HideImage Hides an image
SetColorMode Sets the color mode of an image
SetComplexMode Sets the complex mode of an image
SetContrastMode Sets the contrast mode of an image
SetCustomCLUT Sets the CLUT of an image
SetDisplayType Sets the display type of an image
SetInversionMode(IMG1, 1) Turn on "inverted contrast" of the image IMG1 (0 to turn it off) Example
SetLimits(IMG1, 0, 100) Set the low and high limits of contrast for the image display of the image IMG1 if "auto-survey" is off
SetScale(IMG1, 0.1, 0.1) Set the scales for X and Y dimensions on the image IMG1 Example
     
ROI =( ROI, ! ) Assign a region of interest to a new variable.  
ROI ROINullify( ! )    
ROI ReinterpretLongAsRegionOfInterest( Number l )    
ROI ReinterpretLongAsROI( Number l )    
ROI ReinterpretLongAsROIPtr( Number l )    
ROI ROIClone( ROI roi ) Returns a clone of the ROI. The ROI on each image can be moved separately, different from Mirror ROI. Example
ROI Test_ReinterpretLongAsROIPtr( ROI r )    
ROI NewROI( ) Creates an empty region of interest.  
ROI =( ROI, ROI ) Assign a region of interest to a new variable.  
ROI CreateROI( void ) Creates an empty region of interest.  
ROI NewROI( void ) Creates an empty region of interest. Example
ROI GetROIFromID( Number id ) Returns the region of interest associated with the ID or NULL if it does not exist.  
imageDisplay E.g. Example1, Example2.
ROI ImageDisplayGetROI( ImageDisplay imgDisp, Number index ) Returns the given ROI on this image display. Example1
Example2
Example3
Example4
Number ImageDisplayGetROISelectionStyle( ImageDisplay imgDisp, ROI r ) Gets the selection style of the roi in the imag display.  
Number ImageDisplayCountROIs( ImageDisplay imgDisp ) Returns the number of ROIs on this image display. E.g. Rectangle ROI: 1. Example1, Example2, Example3, Example4.  
Boolean ImageDisplayDoesROIExist( ImageDisplay imgDisp, String name ) Determines whether the given ROI exists on this image display.  
ROI ImageDisplayLookupROI( ImageDisplay imgDisp, String name ) Returns the given ROI on this image display.  
ROI ImageDisplayLookupROIByID( ImageDisplay imgDisp, Number id ) Returns the ROI with the given id on this image display.  
SetSelection(IMG1, 5, 10, 100, 100) Sets the selection rectangle of an image: Set a new ROI (region of interest) in the image IMG1 which is defined by the coordinates of two points: top-left and bottom-right Example
SetSurvey(IMG1,0) Turn off the "auto-survey" of the image display limits of the image IMG1 Example
SetSurvey(IMG1,1) Turn on the "auto-survey" of the image display limits of the image IMG1 Example
SetSurvey(IMG1, 2) Set the "auto-survey" technique: 0 = cross wire, 1 = whole image, 2 = sparse, 3 = reduction. Example
SetWindowSize(IMG1, 240, 240) Set the size (pixels) of the image window of the image IMG1
main () E.g. Example.  
% Modulus division, e.g. 5 % 6 = 5 (the remainder is 5) and 6 % 5 = 1 (the remainder is 1) Example
SetZoom(IMG1, 2) Zoom the image IMG1 to 200% (but the pixels of the image are not changed) Example
Shape class of objects   Example
SetMinContrast Sets the minimum contrast of an image
SetOrigin(IMG1, 0, 0) Set the origin of the image IMG1 to the coordinates (0, 0) that is at the top-left corner Example
SetSurveyTechnique Sets the survey technique of an image
ShowImage(GlobalSinoImage) or GlobalSinoImage.ShowImage() Pixel-by-pixel operation to display an image, i.e. makes the image visible (and bring it to front if there are many images opened on DM). Example1
Example2
ShowImage(SQRT(T)) Calculate the square-root of image T with pixel-by-pixel
ShowImage(SGN(T)) Calculate the sign (+/-) of image T with pixel-by-pixel
ShowImage(Factorial(T)) Calculate the factorial of image T with pixel-by-pixel
ShowImage(exp2(T)) Calculate 2 raised to x of image T with pixel-by-pixel
ShowImage(exp10(T)) Calculate 10 raised to x of image T with pixel-by-pixel
ShowImage(exp(T)) Calculate the exponential of image T with pixel-by-pixel
ShowImage(cosh(T)) Calculate the hyperbolic cosine of image T with pixel-by-pixel
ShowImage(cos(T)) Calculate the cosine of image T with pixel-by-pixel
ShowImage(atanh(T)) Calculate the hyperbolic arctangent of image T with pixel-by-pixel
ShowImage(atan(T)) Calculate the arctangent of image T with pixel-by-pixel
ShowImage(asin(T)) Calculate the arcsine of image T with pixel-by-pixel
ShowImage(acos(T)) Calculate  the arccosine of image T with pixel-by-pixel
ShowImage(abs(T)) Calculate absolute value of image T with pixel-by-pixel
ShowImage (H * G) Multiply image A and B with each other (pixel-by-pixel) and then display the obtained new image Example
while (condition) action Loop statement: to create loops in a program so that the actions are repeated as long as the condition is completed, i.e., the expression evaluates to 0. Example1
Example2

while (condition)
{
action1
action2
...
}

Loop statement: to create loops in a program so that the actions are repeated as long as the condition is completed Example1
Example2
Example3
Example4
& If an argument is passed by reference, then an "&" character is placed before the variable name in the parameter list in the function definition. Example
&= "a &= b" is equal to "a = a & b"
ShowImage (tert ((A>100)&&(B>200), 1, 0)) Create an image where the pixel value is 1 if the pixel value of image A is greater than 100 and which for image B is greater than 200; otherwise it is 0. Example
ShowImage (tert (T>200, 0, 20)) Create a binary mask from image T. The pixel value in the new image becomes 20 if the pixel in image T is greater than 200, otherwise, it becomes 0 Example
ShowImage (tert (A==200, B, C)) Create a new image which has the pixel values of image B where the image A is 200, while this pixel has the values of image C elsewhere. In this operation, all the three images must be of the same size Example
!SpaceDown() Stop the process if space-bar on the keyboard is pressed. Example
!SpaceDown() Pause and then restart the process if space-bar on the keyboard is pressed. Example
"spreadsheet" display on DM interface   Example1
Example2
UpdateImage Forces an update of an image
ClearSelection(IMG1) Delete a selection in the image IMG1 (Compare the results with another script. Example
ExpandSelection Expands the selection of an image
GetSelection Gets the selection rectangle of an image
ScrapClear Removes the pasted image from an image
ScrapCopy Copies an image selection to the scrap
ScrapGetLocation Returns the top-left location of the pasted image's rectangle
ScrapGetSize Returns the size of the pasted image's rectangle
ScrapMerge Merges the pasted image
ScrapPaste Pastes the scrap into an image
ScrapPasteNew Pastes the scrap into a new image
ScrapSetLocation Sets the location of the pasted image of an image
TagGroup DLGCreateBox() A BOX FUNCTION: Creates a box container: Example1, Example2.  

TagGroup DLGCreateBox( String title)

A BOX FUNCTION: Creates a box with the given title  
TagGroup DLGCreateBox( TagGroup &items ) A BOX FUNCTION: Creates a box container; passes back an empty items list, and returns the container.  
TagGroup DLGCreateBox( String title, TagGroup &items ) A BOX FUNCTION: Creates a box with the given title; passes back an empty items list, and returns the container: Example  
offset (Image, x shift, y shift) Shift an image by x pixels in x-direction and y pixels in y-direction. E.g. Example1, Example2.  
round(a) Rounds a real number to the nearest integer. E.g. Example.
     
     
Annotations: 1111
AnnotationType Returns the type of an annotation: Type 2 - line annotation with and without length; type 3 - arrow annotation; type 4 - double arrow annotation; type 5 - box (Rect) annotation; type 6 - oval annotation; type 8 - spot mask annotation; type 9 - array mask annotation; type 12 - Profile; type 13 - text annotation; type 15 - bandpass mask annotation; type 17 - group annotation; type 19 - wedge mask annotation; type 23 - Rectangle ROI; type 25 - Line ROI; type 27 - Point ROI; type 28 - Oval ROI; and type 29 - Loop ROI and Curve ROI
CountAnnotations Returns the number of annotations in an image
CreateArrowAnnotation Creates an arrow annotation
CreateBoxAnnotation Creates a box annotation
CreateDoubleArrowAnnotation Creates a double ended arrow annotation
CreateLineAnnotation Creates a line annotation
CreateOvalAnnotation Creates an oval annotation
CreateTextAnnotation Creates a text annotation
DeleteAnnotation Deletes an annotation
DeselectAnnotation Deselects an annotation
GetAnnotationRect Gets the rectangle of the annotation
GetNthAnnotationID Get the ID of an annotation
IsAnnotationSelected Checks if an annotation is selected
MoveAnnotation Moves an annotation
OffsetAnnotation Offsets an annotation
SelectAnnotation Selects an annotation
SetAnnotationBackground Sets the background of an annotation
SetAnnotationFace Sets the text face of an annotation
SetAnnotationFont Sets the text font of an annotation
SetAnnotationJustification Sets the text justification of an annotation
SetAnnotationRect Sets the rect of an annotation
SetAnnotationSize Sets the text size of an annotation
ValidAnnotation Checks if specified annotation exists
Other application of annotations:
Number AnnotationType( ImageReference, Number annotationID ) Return the annotation type indicated by the annotation ID within the image.  
Number CountAnnotations( ImageReference ) Return the number of annotations within the image.  
Number CreateArrowAnnotation( Image, Number top, Number left, Number bottom, Number right )

Create an arrow annotation in the image with the endpoints [top,left] and [bottom,right]. Return the new annotation's ID.

 
Number CreateBoxAnnotation( Image, Number top, Number left, Number bottom, Number right )

Create a box annotation in the image with the coordinates [top, left, bottom, right]. Return the new annotation's ID.

 
Number CreateDoubleArrowAnnotation( ImageReference, Number top, Number left, Number bottom, Number right )

Create an double ended arrow annotation in the image with the endpoints [top,left] and [bottom,right]. Return the new annotation's ID.

 
Number CreateLineAnnotation( ImageReference, Number top, Number left, Number bottom, Number right )

Create an line annotation in the image with the endpoints [top,left] and [bottom,right]. Return the new annotation's ID.

 
Number CreateOvalAnnotation( ImageReference, Number top, Number left, Number bottom, Number right ) Create an oval annotation in the image with the coordinates [top, left, bottom, right]. Return the new annotation's ID.  
Number CreateTextAnnotation( ImageReference, Number top, Number left, String text ) Create a text annotation in the image at the position [top,left] with text. Return the new annotation's ID.  
void DeleteAnnotationNote( ImageReference, Number annotationID, String noteLabel ) Removes the annotation note with the label noteLabel.  
void DeleteAnnotation( Image, Number annotationID ) Delete the annotation indicated by the annotationID within the image.  
DeleteAnnotationNote Deletes annotation note  
void DeselectAnnotation( Image, Number annotationID ) Deselect the annotation indicated by the annotationID within the image.  
void GetAnnotationRect( ImageReference, Number annotationID, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Store the bounds of the annotation indicated by the annotationID within the image into the top, left, bottom, and right variables.  
GetAnnotationRectNote Gets the value of an annotation rect note  
GetAnnotationRGBNumberNote Gets the value of an annotation RGB number note  
GetAnnotationStringNote

Gets the value of an annoation string note

 
Boolean GetAnnotationRectNote( Image, Number annotationID, String noteLabel, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the value of the annotation note with label noteLabel into the top, left, bottom, and right variables. Returns 1 if the note exists returns 0 otherwise.  
Boolean GetAnnotationRectNote( ImageReference, Number annotationID, String noteLabel, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the value of the annotation note with label noteLabel into the top, left, bottom, and right variables. Returns 1 if the note exists returns 0 otherwise.  
Number GetNthAnnotationID( ImageReference, Number index ) Return the ID of the index'th annotation in the image.  
Boolean IsAnnotationSelected( Image, Number annotationID ) Return 1 if the annotation indicated by the annotationID within the image is selected; returns 0 otherwise.  
void MoveAnnotation( Image, Number annotationID, Number top, Number left, Number bottom, Number right ) Set the bounds of the annotation indicated by the annotationID within the image to [top, left, bottom, right].  
void OffsetAnnotation( ImageReference, Number annotationID, Number deltax, Number deltay ) Offset the annotation indicated by the annotationID within the image by [deltax, deltay].  
void SelectAnnotation( Image, Number annotationID ) Select the annotation indicated by the annotationID within the image.  
void SetAnnotationBackground( Image, Number annotationID, Number background ) Set the background mode of the annotation indicated by the annotationID within the image. Possible values for background are 1=black-on-white, 2=black, 3=white-on-black, 4=white.  
void SetAnnotationFace( Image, Number annotationID, Number face ) Set the type face of the annotation indicated by the annotationID within the image. Values for the face can be found in InsideMacintosh Vol I.  
void SetAnnotationFont( Image, Number annotationID, String fontName ) Set the font of the annotation indicated by the annotationID within the image to fontname.  
void SetAnnotationJustification( ImageReference, Number annotationID, Number justification ) Set the justification of the text annotation indicated by the annotationID within the image. Possible values for justification are -1=left, 0=center, 1=right.  
void SetAnnotationRectNote( Image, Number annotationID, String noteLabel, Number top, Number left, Number bottom, Number right ) Sets the value of the annotation note with label noteLabel to the rectangle formed from the top, left, bottom, and right parameters. If the note does not exist, it is created.  
void SetAnnotationRect( Image, Number annotationID, Number top, Number left, Number bottom, Number right ) Set the bounds of the annotation indicated by the annotationID within the image to [top, left, bottom, right].  
void SetAnnotationSize( Image, Number annotationID, Number size ) Set the size of text of the annotation indicated by the annotationID within the image.  
Boolean ValidAnnotation( ImageReference, Number annotationID ) Return 1 if the annotationID is valid; returns 0 otherwise.  
GetAnnotationComplexNumberNote Gets the value of an annotation complex number note
GetAnnotationNoteState Gets annotation note state
GetAnnotationNumberNote Gets the value of an annotation number note
SetAnnotationComplexNumberNote Sets the value of an annotation complex number note
SetAnnotationKeywordNote Adds a keyword to an annotation
SetAnnotationNoteState Sets annotation note state
SetAnnotationNumberNote Sets the value of an annotation number note
SetAnnotationRectNote Sets the value of an annotation rect note
SetAnnotationRGBNumberNote Sets the value of an annotation RGB number note
SetAnnotationStringNote Sets the value of an annotation string note
Remove annotations Remove all, remove a specific type Example1
Example2
     
Graphic Functions    
TagGroup DLGCreateGraphic( number width, number height ) Creates a graphic element with the given width and height: Example  
TagGroup DLGAddBitmap(TagGroup graphic, TagGroup bitmap_item ) Adds a bitmap to a graphic element: Example.  
TagGroup DLGAddBitmap( TagGroup graphic, Image img ) Creates a bitmap from the given image and adds it to the graphic element  
TagGroup DLGCreateStandardBevelButton( Image img ) Creates a standard bevel button item.  
TagGroup DLGCreateStandardBevelButton( Image img, number onOff ) Creates a standard bevel button with the given image and sets it value to onOff.  
     
Popup Menu Functions
"Popup Window"   Examples
TagGroup DLGCreatePopup( ) Creates a popup menu. Different from choice menu (e.g. example), popup menu can have an undefined state. Example
TagGroup DLGCreatePopup( number value ) Creates a popup menu with the given initial value  
TagGroup DLGCreatePopup( number value, string changedmethod ) Creates a popup menu with the given initial value and changed method  
TagGroup DLGCreatePopup( TagGroup &items ) Creates a popup menu; passes back an empty items list, and returns the container.  
TagGroup DLGCreatePopup( TagGroup &items, number value ) Creates a popup menu with the given initial valuepasses back an empty items list, and returns the container.  
TagGroup DLGCreatePopup( TagGroup &items, number value, string changedmethod ) Creates a popup menu with the given initial value and changed method; passes back an empty items list, and returns the container.  
TagGroup DLGCreatePopup( string title, TagGroup &label_item, TagGroup &popup_item, TagGroup &choice_items, number value ) Creates a named popup menu group with the given title and initial value; passes back the label for the popup title, the popup menu, and an empty popup items list; returns the named popup group.  
TagGroup DLGCreateBoxedPopup( string boxTitle, TagGroup &popup_item, TagGroup &choice_items, number value ) Creates a named box containing a popup menu with the given title and initial value; passes back the popup menu and an empty popup items list; returns the box element.  
TagGroup DLGCreatePopupItemEntry( string label ) Creates a popup entry with the given label.  
TagGroup DLGAddPopupItemEntry( TagGroup container, string label ) Adds a popup entry with the given label to a list of popup items; returns the popup entry. Example
TagGroup DLGAddPopupItemEntry( TagGroup items, string label, number enabled ) Adds a popup entry with the given label to a list of popup items; returns the popup entry.  
void DLGSetNthChoice( TagGroup tags, number index, string title, number enabled ) Sets the nth choice in a choice list. Also invalidates the choice item.  
     
Choice Item Functions    
TagGroup DLGCreateChoice( ) Creates a choice item. Different from popup menu (e.g. example), choice menu cannot have an undefined state. E.g. index 1 has to correspond to the 1st item of the popup, while index 2 is for the second item: Example1, Example2.  
TagGroup DLGCreateChoice( number value ) Creates a choice item with the given initial value  
TagGroup DLGCreateChoice( number value, string changedmethod ) Creates a choice item with the given initial value and changed method  
TagGroup DLGCreateChoice( TagGroup &items ) Creates a choice item; passes back an empty items list, and returns the container.  
TagGroup DLGCreateChoice( TagGroup &items, number value ) Creates a choice item with the given initial value; passes back an empty items list, and returns the container.  
TagGroup DLGCreateChoice( TagGroup &items, number value, string changedmethod ) Creates a choice item with the given initial value and changed method; passes back an empty items list, and returns the container.  
TagGroup DLGCreateChoice( string title, TagGroup &label_item, TagGroup &choice_item, TagGroup &choice_items, number value ) Creates a named choice item group with the given title and initial value; passes back the label for the choice title, the choice item, and an empty choice items list; returns the named choice group.  
TagGroup DLGCreateBoxedChoice( string boxTitle, TagGroup &choice_item, TagGroup &choice_items, number value ) Creates a named box containing a choice item with the given title and initial value; passes back the choice item and an empty choice items list; returns the box element.  
TagGroup DLGCreateChoiceItemEntry( string label ) Creates a choice entry with the given label  
TagGroup DLGAddChoiceItemEntry( TagGroup container, string label ) Adds a choice entry with the given label to a list of choice items; returns the choice entry: (Comparison between with and without FOR command: Example5 and Example6).  
     
Persistent Notes    
DeletePersistentNote Deletes persistent note  
GetPersistentComplexNumberNote Gets the value of a persistent complex number note  
GetPersistentNoteState Gets persistent note state  
GetPersistentNumberNote Gets the value of a persistent number note: Example.  
GetPersistentRectNote Gets the value of a persistent rect note  
GetPersistentRGBNumberNote Gets the value of a persistent RGB number note  
GetPersistentStringNote Gets the value of a persistent string note  
GetPersistentStringNote Gets the value of a persistent string note  
SetPersistentComplexNumberNote Sets the value of a persistent complex number note  
SetPersistentKeywordNote Adds a persistent keyword note  
SetPersistentNoteState Sets persistent note state  
SetPersistentNumberNote Sets the value of a persistent number note: Example.  
SetPersistentRectNote Sets the value of a persistent rect note  
SetPersistentRGBNumberNote Sets the value of a persistent RGB number note  
SetPersistentStringNote Sets the value of a persistent string note  
Radio Button Functions    
TagGroup DLGCreateRadioList( ) A radio button function: Creates a radio button list container
TagGroup DLGCreateRadioList( number value ) A radio button function: Creates a radio button list container with the given initial value. E.g. input dialogs for selecting a default value by checking box (link). E.g. Example1, Example2.
TagGroup DLGCreateRadioList( number value, string changedmethod ) A radio button function: Creates a radio button list container with the given initial value and changed method
TagGroup DLGCreateRadioList( TagGroup &items ) A radio button function: Creates a radio button list container; passes back an empty items list, and returns the container
TagGroup DLGCreateRadioList( TagGroup &items, number value ) A radio button function: Creates a radio button list container with the given initial value; passes back an empty items list, and returns the container.
TagGroup DLGCreateRadioList( TagGroup &items, number value, string changedmethod ) A radio button function: Creates a radio button list container with the given initial value and changed method; passes back an empty items list, and returns the container.
TagGroup DLGCreateRadioItem( string label, number value ) A radio button function: Createsa radio button item with the given title and value
TagGroup DLGAddRadioItem( TagGroup rad_container, string label, number value ) A radio button function: Creates and adds a radio button item with the given title and value to a radio button list; returns the radio button item Example
List Functions    
TagGroup DLGCreateList( number width, number height ) Creates a list container with the given width and height Example
TagGroup DLGCreateList( string changedmethod, number width, number height ) Creates a list container with the given width, height, and changed method
TagGroup DLGCreateList( string changedmethod, string actionmethod, number width, number height ) Creates a list container with the given width, height, changed method and action method  
TagGroup DLGCreateList( TagGroup &items, number width, number height ) Creates a list container with the given width and height; passes back an empty items list, and returns the container  
TagGroup DLGCreateList( TagGroup &items, string changedmethod, number width, number height ) Creates a list container with the given width, height, and changed method; passes back an empty items list, and returns the container  
TagGroup DLGCreateList( TagGroup &items, string changedmethod, string actionmethod, number width, number height ) Creates a list container with the given width, height, changed method and action method; passes back an empty items list, and returns the container  
TagGroup DLGCreateListItem( string label, number selected ) Creates a list item with the given label  
TagGroup DLGAddListItem( TagGroup item_container, string label, number selected ) Adds a list item with the given label to a list Example
   
Get Property Values  
number DLGGetValue( TagGroup tags, number &value ) Gets the numeric 'Value' attribute setting; returns 1 if succeeded, 0 otherwise: Example1, Example2, Example3, Examle4.  
number DLGGetValue( TagGroup tags, string &value ) Gets the string 'Value' attribute setting; returns 1 if succeeded, 0 otherwise.
UIframe class Use the UIframe class to display the dialog to the user (used together with "Alloc()"): Example1, Example2, Example3, Example4, Example5, Example6, Example7, Example8  
number DLGGetValue( object frame, string identifier, number &val )
Gets the numeric 'Value' attribute setting for a labeled element in a uiframe object; returns 1 if succeeded, 0 otherwise.
number DLGGetValue( object frame, string identifier, string &val ) Gets the string 'Value' attribute setting for a labeled element identifier in a uiframe object; returns 1 if succeeded, 0 otherwise.
number DLGGetValue( TagGroup tags ) Returns the numeric 'Value' attribute setting.
string DLGGetStringValue( TagGroup tags ) Returns the string 'Value' attribute setting. Example
TagGroup DLGGetItems( TagGroup tags ) Returns the TagGroup in the 'Items' attribute of an element.
number DLGGetIdentifier( TagGroup tags, string &identifier ) Returns the string in the 'Identifier' attribute of an element.
number DLGGetNthLabel( TagGroup tags, number index, string &label_str ) Gets the label of the nth item in the 'Items' TagGroup of an element; returns 1 if succeeded, 0 otherwise. Example1
Example2
number DLGGetLabelIndex( TagGroup tags, string title, number &index ) Gets the index of the item of a given title in the 'Items' TagGroup of an element; returns 1 if succeeded, 0 otherwise.
string DLGGetType( TagGroup tags ) Gets the type attribute of an element.
number DLGGetWidth( TagGroup tags ) Gets the width of an element
number DLGGetHeight( TagGroup tags ) Gets the height of an element
Image DLGGetBitmapData( TagGroup bitmap ) Gets the RGB image stored in a bitmap
String DLGGetLabel( TagGroup element ) Gets the label of an element
String DLGGetTitle( TagGroup element ) Gets the label of an element (dialog or label)
   
DeleteNote Deletes image note
GetComplexNumberNote Gets the value of an image complex number note
GetNoteState Gets image note state
GetNumberNote Gets the value of an image number note: Stores the value of the image note with label noteLabel into noteValue variable. Returns 1 if the note exists, returns 0 otherwise. Example
GetRectNote Gets the value of an image rect note
GetRGBNumberNote Gets the value of an image RGB number note
GetStringNote Gets the value of an image string note
SetComplexNumberNote Sets the value of an image complex number note
SetKeywordNote Adds a keyword note to an image
SetNoteState Sets image note state
SetNumberNote Sets the value of an image number note Example
SetRectNote Sets the value of an image rect note Example
SetRGBNumberNote Sets the value of an image RGB number note
SetStringNote Sets the value of an image string note Example
Boolean GetComplexNumberNote( Image, String noteLabel, ComplexNumberVariable noteValue ) Stores the value of the image note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.  
BaseN (a) Convert a number to an arbitrary base string, and (b) Convert a number to an arbitrary base string with a fixed length.
Binary (a) Convert a number to a binary string with a fixed length, (b) Convert a number to a binary string.
Decimal (a) Convert a number to a decimal string, (b) Convert a number to a decimal string with a fixed length.
Hex (a) Convert a number to a hex string with a fixed length, (b) Convert a number to a hex string.
Octal (a) Convert a number to an octal string with a fixed length, (b) Convert a number to an octal string.
ContinueCancelDialog Continue cancel dialog: Popup a window (e.g. with a warning/suggestion message) and then press Continue to continue, or Spacebar or Cancel to stop Example
GetLimits (IMG1, LOW, HIGH) Get the current low and high limits of the image display of the image IMG1 Example
GetNumber("Enter a number:", 20, NUM3) Get number dialog: Ask to enter a value for a variable (a number here) Example
GetString("Enter a string:", "suggestion", STR3) Get string dialog: Ask to enter a value for a variable (a string here) Example
OkCancelDialog Ok cancel dialog. E.g. Example1, Example2.
OkDialog Ok dialog Example

void OkDialog( String prompt )

Puts up a dialog with the given prompt.  
OpenDialog Open dialog

Boolean OpenDialog( String pathname )

Puts up an Open dialog, allows the user to select a file, and stores the pathname into the pathname variable. Returns 1 for OK and 0 for Cancel. Example1
Example2
SaveAsDialog SaveAs dialog
TwoButtonDialog Two button dialog Example1
Example2
CommandDown Returns command key state
format Formats a number printf style
GetKey Returns key
OptionDown Returns option key state
Result Outputs (a) formatted number to result window, (b) a complex number to the results window, (c) a real number to the results window, (d) a string to the results window, and (e) an RGB number to the results window. Example
result ("Hello, my name is ...\n \n") Prints to the results window "Hello, my name is ..." Example
result ("\n Name: " + GetName(T)) Output the image name of image T in the "Output Window" Example
result ("\n Letter: " + GetLabel(T)) Output the image-letter of image T in the “Output Window” Example
result ("\n Sum: " + sum(T)) Output the sum of image T in the “Output Window” Example1
Example2
result ("\n Mean: " + mean(T)) Output the mean value of image T in the “Output Window” Example1
Example2
result ("\n Variance: " + variance(T)) Output the variance value of image T in the “Output Window” Example
result ("\n Minimum: " + min(T)) Output the minimum value of image T in the “Output Window” Example
max(a) Calculates the maximum of two real numbers: Maximum value of a
max Finds the maximum of a real image expression
max (image, x, y) Finds the position (x, y) with the maximum value for a real image expression. E.g. Example.
result ("\n Maximum: " + max(T)) Output the maximum value of image T in the “Output Window” Example
Maximum () Calculates the maximum of a given list of real numbers. E.g. Example.
ShiftDown Returns shift key state

String ImageGetIntensityUnitString( ImageReference )

Returns the units of the image's intensity. Example

String GetUnitString( Image )

Returns the units string of the image. Example1
Example2
void SI_AddBandToExtractedSpectrum(Image *img, float left, float right, bool calibratedUnits) Adds an energy band to the display of a spectrum extracted from a spectrum image.
void SI_GetSpectrum(Image *src, Image *dst, long x, long y) Reads a spectrum from the spectrum image src into image dst, (x ignored if 2-D spectrum image)
void SI_GetPlane(Image *src, Image *dst, long perpAxis, long index) Reads plane index from spectrum image src into the image dst, perpAxis is 0, 1 or 2 for X, Y or Z
void SI_SetPlane(Image *src, Image *dst, long perpAxis, long index) Writes image src to plane index of spectrum image dst, perpAxis is 0, 1 or 2 for X, Y or Z
void SI_SetSpectrum(Image *src, Image *dst, long x, long y) Writes a spectrum from image src into the spectrum image dst, (x ignored if 2-spectrum image)
RealImagePtr SI_BuildComplexSpatialDriftImage( Image *spectrumImage) Generates a complex image containing the x and y components of the spatial drift corrections applied during acquisition of this spectrum image
RealImagePtr SI_BuildVectorSpatialDriftImage( Image *spectrumImage, long imageSize) Generates an image containing vectors of the spatial drift corrections applied during acquisition of this spectrum image
RealImagePtr SI_BuildEnergyDriftImage(Image *spectrumImage ) Generates an image containing the energy drift offsets (in eV) applied during acquisition of this spectrum image
RealImagePtr SI_BuildChromaticCorrectionImage( Image *spectrumImage) Generates an image containing the chromatic figure energy shifts applied at each pixel during acquisition of this spectrum image
   
slice1( src_img, x, y, 0, 2, z_len, 1 ) Directly access a 1-dimensional subvolume: To extract a slice at location (x,y) that extends along the z axis, if we have a 3-dimensional (3D) image src_img with dimensions x_len, y_len, and z_len Example
slice2( src_img, 0, 0, z, 0, x_len, 1, 1, y_len, 1 ) To extract the plane at depth z, one would use, if we have a 3 dimensional image src_img with dimensions x_len, y_len, and z_len.
slice2(src_img, x, y_len-1, 0, 1, y_len, -1, 2, z_len, 1) To extract a plane whose first dimension is in the y direction but in the opposite direction as in src_img, and whose second is in the z direction, if we have a 3 dimensional image src_img with dimensions x_len, y_len, and z_len.
SpaceDown Returns space key state
SpaceDown() Returns 1 if the space-bar is pressed on the keyboard. 0 (meaning "not" or "cancel") is obtained if "!" is added in front.
SSCBinnedRead Read SSC
SSCClear Clear the SSC
SSCCloseShutter Close SSC shutter
SSCDarkSubtractedBinnedAcquire Acquire a dark subtracted SSC frame
SSCDarkSubtractedBinnedAcquireInPlace Acquire a dark subtracted SSC frame in place
SSCExpose Expose the SSC
SSCGainNormalizedBinnedAcquire (Image , Exposure, Binning, top, left, bottom, right) Acquire a gain normalized SSC frame: Acquire gain-normalized SSC frames, & diffraction patterns
STEPSIZE Counts from a number to another with a specific STEPSIZE. "COUNT -=STEPSIZE" is equal to "COUNT = COUNT - STEPSIZE". Example
SSCGainNormalizedBinnedAcquireInPlace Acquire a gain normalized SSC frame in place
SSCGetDarkReference Get SSC dark reference
SSCGetGainReference Get SSC gain reference
SSCGetPixelSize Get pixel size of SSC
SSCGetSize Get SSC size
SSCGetSizeBinned Get binned SSC size
SSCOpenShutter Open SSC shutter
SSCUnprocessedBinnedAcquire Acquire an SSC frame
SSCUnprocessedBinnedAcquireInPlace Acquire an SSC frame in place
DSArbitraryView Start DigiScan standard view
DSFastView Start DigiScan fast view
DSMenuSetCardSelect Set DigiScan menu card select
DSRawLowLevelRead Read a frame from the DigiScan by specifying scan
DSRead Read a frame from the DigiScan
DSSetExternalPixelClock Set the DigiScan external pixel clock state
DSSetRelayDelay Set the DigiScan relay delay
DSSetRelays Set the DigiScan relay control
DSStandardView Start DigiScan standard view
TVAcquireUnprocessed Acquire TV image
TVDisplay Output image on video processor
TVGetSize Get TV size
EMBeamShift Shift the beam
EMChangeFocus Change the focus
EMChangeStigmation Change the stigmation
EMChangeTilt Change the tilt
EMCloseCommunication Close communication to the microscope
EMImageShift Shift the image
EMSetupCommunication Setup communication with the microscope
AddCustomFunctionFileToMenu Adds a custom function to the menu
AddScriptFileToMenu Adds a script file to the menu
AddScriptToMenu Adds a script string to the menu
Beep Sounds beep
CloseProgressWindow Closes the progress window
DateStamp Returns date and time
Delay Delays
ExecuteScriptFile Executes a script file
ExecuteScriptString Executes a script string
GetDate Gets date
GetExceptionString Get exception string
GetScreenSize Get the screen size
GetTime Gets time. E.g. Example.
   
OpenAndSetProgressWindow Opens and sets the progress window
OpenResultsWindow Opens the results window
SetUnitString Sets the units description of an image
tert (condition, true-value, false-value) Evaluate an image pixel-by-pixel Example1
Example2
Example3
Throw() Throws exceptions: (a) a string exception, (b) a number exception. The place of the Throw() command in the program is important: Example1, Example2, Example3.  
   
   
   
icol An intrinsic variable depending on the image or image expression: An intrinsic variable for the column of the image. Some comments HRTEM
Example2
Example3
Example4
Example5
icolumn An intrinsic variable. Some comments
cos(a) Calculates the cosine of (a) a real number, (b) a complex number Example
cosh(a) Calculates the hyperbolic cosine of (a) a real number, (b) a complex number
exp(a) Calculates the exponential of (a) a real number, (b) a complex number
exp1(a) Calculates the exponential - 1 of a real number
exp2(a) Calculates 2 raised to a real number: 2 raised to the power of a
exp10(a) Calculates 10 raised to a real number: 10 raised to the power of a
log(a) Calculates the logarithm of (a) a real number, (b) a complex number
log1(a) Calculates the logarithm of a real number + 1: Logarithm of a + 1
log2(a) Calculates the logarithm base 2 of a real number: Log base 2
log10(a) Calculates the logarithm base 10 of a real number: Log base 10
   
LogGamma Calculates the log gamma of a real number
Median Calculates the median of a given list of real numbers
modulus Calculates the modulus of a complex number
norm Calculates the norm of a complex number
Phase Calculates the phase of a complex number
Polar Calculates the polar representation of a rectangular complex number
real Returns the real portion of a complex number
Rect Calculates the rectangular representation of a polar complex number
alpha Returns the alpha portion of an RGB number as a real number
mean Calculates the mean of a real image expression
MeanSquare Calculates the mean square of a real image expression
product Calculates the product of (a) a real image expression, (b) a complex image expression.
RMS Calculates the RMS of a real image expression
sum Calculates the sum of (a) a real image expression, (b) a complex image expression.
TimeBar Displays a timebar (a) while evaluating real image expression, (b) while evaluating complex image expression, (c) while evaluating RGB image expression.
Warp Calculates bilinear interpolated value (a) within a real image, (b) within a complex image, (c) within a RGB image.
Break A command, for instance, can be used to exit the current loop, e.g. by clicking "cancel" button. In this case, it is often used in combination with IF, WHILE or FOR statements. "Break command" is different from “Exit(0) command” which needs the user to press the cancel button to exit. Example1
Example2
Example3
"character constant" Is one character between single quotes. E.g. '?', 'c', and '3'.
   
min Finds the minimum value and position for a real image expression
min Finds the minimum of a real image expression
min(a) Calculates the minimum of two real numbers: Minimum value of a
Minimum Calculates the minimum of a given list of real numbers
mod(a) Calculates the integer modulus for real numbers: Modulo
rem(a) Remainder
remainder Calculates the integer remainder for real numbers
sin(a) Calculates the sine of (a) a real number, (b) a complex number
sinh(a) Calculates the hyperbolic sine of (a) a real number, (b) a complex number
sqrt(a) Calculates the square root of (a) a real number, (b) a complex number
tan(a) Calculates the tangent of (a) a real number, (b) a complex number
tanh(a) Calculates the hyperbolic tangent of (a) a real number, (b) a complex number
trunc(a) Truncated
SphericalBesselJ Calculates the spherical Bessel J function
SphericalBesselY Calculates the spherical Bessel Y function
Trunc Truncates a real number to an integer
UniformRandom Calculates a random number with uniform distribution
   
sgn Calculates the sign of a real number
Pi Returns an approximation of π
() A sub-expression enclosed in parenthesis will be evaluated first, e.g. (2 + 3) * 4.
' ' (single quotes) A character constant is one character between single quotes. E.g. '?', 'c', and '3'.
Increment and decrement operators  
++ Increment operator for a real number, e.g. "i = i + 1" is equal to "i++". Example
-- Decrement operator for real numbers, e.g. "i = i - 1" is equal to "i--". Example
Arithmetic Operators  
- An arithmetic operator (a) for a real number, (b) for complex numbers, and (c) for RGB numbers: subtraction or negation.
   
+ Addition operator (e.g. sum images pixel-by-pixel): (a) for real numbers, (b) for complex numbers, and (c) for RGB numbers. Concatenate: (a) a string and a real number, (b) an RGB number and a string, (c) a string and a complex number, (d) a complex number and a string, (e) a string and an RGB number, (f) a real number and a string, and (g) a string and a string. Example
   
/ An arithmetic operator (a) for real numbers, (b) for complex numbers, and (c) for RGB numbers: division.
   
* An arithmetic operator (a) for real numbers, (b) for complex numbers: multiply two variables, and (c) for RGB numbers. Example
   
** An arithmetic operator (a) for real numbers, (b) for complex numbers: power or called exponentiation.
   
form "xyz1 ? xyz2 : xyz3" In this arithmetic form, xyz1 is always evaluated. If xyz1 evaluates to true (not 0) xyz2 is evaluated and its result used as the value of the whole expression. Otherwise, xyz3 is evaluated and its result used as the value of the whole expression. E.g. to define threshold (see Example2). Example1
Example2
Equality, relational, and logical operators Evaluate to 1 (true) or 0 (false) and have the return type of realnumber.
== Equality operator (result 1 or 0): (a) for real numbers, (b) for complex numbers, (c) for RGB numbers, and (d) for strings.
   
!= An inequality operator (result 1 or 0): (a) for real numbers, (b) for complex numbers, (c) for RGB numbers, and (d) for strings. Example
   
< Less than operator for real numbers: less than (result 1 or 0): Explanation
<= Less than or equal operator for real numbers: less than or equal (result 1 or 0)
> Greater than operator for real numbers: greater than (result 1 or 0)
>= Greater than or equal operator for real numbers: greater than or equal (result 1 or 0)
|| A relational operator for real numbers: logical "or". Example
&& A relational operator for real numbers: logical "and". E.g. Example.
Assignment operators  
= Assignment operator (a) for real numbers, (b) for complex numbers, and (c) for RGB numbers: assigned by a value. E.g. i) Change the internal value (Example1) and ii) Create an image by summing up two images (Example2). Some comments Example1
Example2
   
:= An assignment operator assigned by a reference. E.g. assign an image to a variable. Some comments Example1
Example2
+= Add and assign operator for real numbers and is shorthand for the combination of = and +, i.e., "a += b" is equal to "a = a + b"
*= Multiply and assign operator for real numbers and is shorthand for the combination of = and *, i.e.,"a *= b" is equal to "a = a * b", e.g. "COUNT1 *= -1" is equal to "COUNT1 = COUNT1 * (-1)" Example
/= Divide and assign operator for real numbers and is shorthand for the combination of = and /, i.e.,"a /= b" is equal to "a = a / b"
-= Subtract and assign operator for real numbers and is shorthand for the combination of = and -, i.e.,"a -= b" is equal to "a = a - b"
%= "a %= b" is equal to "a = a % b"
%0.0f Display the float using zero digit after the decimal point Example
%0.3f Display the float using three digits after the decimal point Example
%10.0f Display the float using ten characters with zero digit after the decimal point Example
%10.1f Display the float using ten characters with one digit after the decimal point Example
%10.2f Display the float using ten characters with two digits after the decimal point Example
%10.3f Display the float using ten characters with three digits after the decimal point Example
|= "a |= b" is equal to "a = a | b"
^= "a ^= b" is equal to "a = a ^ b"
<<= "a <<= b" is equal to "a = a << b"
>>= "a >>= b" is equal to "a = a >> b"
: In the form of "xyz1 ? xyz2 : xyz3", see details. Example
? Arithmetic if operator (a) for real numbers, (b) for complex numbers, and (c) for RGB numbers: in the form of "xyz1 ? xyz2 : xyz3", see details. Example
"\t" A break function so that we can copy and paste the data onto spread sheet (e.g. excel), and then all the numbers are put into different cells on the same row Example
[] Run a script on the selected ROIs by adding a "rectangular ROI" Example
{ } Block statement: can be used to group several statements and variable declarations into a compound statement or block. Example
\ (backslash sign) Split long lines into multiple lines: the expression is continued on the next lines Example
"/*" and "*/" Comment block markers
, E.g. separate variables Example
// (double-backslash) Add a comment text and will be omitted in the script processing. This is especially useful when: i) you want to outline what you have in the script and ii) You are not using the line currently but want to save for future. Example
; or newline Separators
A[Top, Left, bottom, right] Create an image with the coordinates of two points on image A
"// $BACKGROUND$" Is put in the first line of a cript in order to execute on a separate thread.
Alloc(MyThread) Create the object in memory (Exist together with "class : uiframe"): Example1, example2, Example3, Example4, Example5, Example6, Example7.
 
COPYING1 = IMG Create a copy of image IMG with a variable COPYING1
COPYING1 = COPYING1 + 100 Add a constant to each pixel in image COPYING1 Example1
Example2
DLGCreateGroup () Creates a dialog by creating groups and items together.
Example
FindParticles A command for particle analysis Example
iplane An intrinsic variable for a plane of a 3D image. Some comments
ipoints An intrinsic variable for the number of points in the image. Some comments
iradius An intrinsic variable for the distance from the center of the image. Some comments Example1
Example2
Example3
irow An intrinsic variable depending on the image or image expression: An intrinsic variable for the row of the image. Some comments HRTEM
Example2
Example3
Example4
itheta An intrinsic variable for the angle with respect to the center of the image. Some comments Example
iwidth An intrinsic variable for the width of the image. Some comments Example1
Example2
LIMIT Provide a limit for a variable Example
ImageDocumentShow E.g. Example1, Example2.
IMG1 = 200 Give a value (200 here) to all the pixels in image IMG1 Example
ImageDocument Create the ImageDocument. E.g. Example1, Example2.
   
Void Allows functions which return no value.
Pi() Returns the value Pi
"Overload" This function is two or more distinct functions with the same name but different argument lists. Such argument lists must differ either in number of arguments or in type. Example
Tag Tags and TagGroups are used throughout DM to store data. For example, you can view all the globally stored tags by opening the Global Info dialog and selecting General: Tags in the left survey pane. Example
   

Table 2597b. More complex command and command combinations.

Command combination Function Example
ImageDisplay ImageGetImageDisplay( ImageReference, Number index ) Returns the given image display in which this image is displayed. Example1
Example2
Example3
Example4
Example5
Example6
ImageDisplay ImageGetImageDisplayInImageDocument( ImageReference, ImageDocument imgDoc, Number index ) Returns the given image display in the image document in which this image is displayed.  

Number ComponentCountChildren( Component comp )

Returns the number of sub components.

Example
Number ComponentCountChildrenOfType( Component comp, Number type ) Returns the number of sub-components of type 'type'.  
Component ComponentGetChild( Component comp, Number index ) Returns the 'index'th sub-component of 'comp'.

Example
Component ComponentGetChildByID( Component comp, Number ID ) Returns the component child of 'comp' with id 'ID'.  
TagGroup DLGCreateLabel( String label_string )

A LABEL FUNCTION: Creates a label with the given text: Example1, Example2, Example3, Example4, (Comparison between with and without FOR command: Example5 and Example6), Example7.

 
TagGroup DLGCreateLabel( string label_string, number width ) A LABEL FUNCTION: Creates a label with the given text and maximum number of characters.  
TagGroup DLGExternalPadding( TagGroup element, Number x_pad, Number y_pad )

Sets the 'ExternalPadding' attribute; returns the element.

 
TagGroup DLGExternalPadding( TagGroup element, Number t_pad, Number l_pad, Number b_pad, Number r_pad )

Sets the 'ExternalPadding' attribute; returns the element.

 
     
 

 

 
     
     
     
     
     
Number CountImages( void ) Count the number of images. Example
Number ImageDocumentCountImages( ImageDocument imgDoc ) Returns the number of images contained in this image document.  
BasicImage slice2( BasicImage, Number x, Number y, Number z, Number d0, Number l0, Number s0, Number d1, Number l1, Number s1 ) Returns the subslice [(x,y,z),(d0,l0,s0),(d1,l1,s1)]. Example

Boolean ReadFileLine( Number file, StringVariable string )

Read a line of text from the file, storing it into the string variable. Return 1 if successful and 0 otherwise.  

Boolean ReadFileLine( Number file, Number encoding, String string )

Read a line of text from the file, storing it into the string variable, assuming the text has the specified encoding. Return 1 if successful and 0 otherwise.  
     

Boolean IsBinaryDataType( Image )

Returns 1 if the image is an binary data type; returns 0 otherwise.  
Boolean IsByteImage( Image ) Returns 1 if the image is unsigned 1-byte integer data; returns 0 otherwise.  
Boolean IsComplexDataType( ImageReference, Number bytes ) Returns 1 if the image is an complex data type of size bytes; returns 0 otherwise.  

Boolean IsComplexImage( ImageReference )

Returns 1 if the image is single precision complex data; returns 0 otherwise.  
Boolean IsDisplayValid( ImageReference ) Return 1 if the image's display is up-to-date and 0 otherwise.  
Boolean IsFloatImage( ImageReference ) Returns 1 if the image is single precision real data; returns 0 otherwise.  

Boolean IsImageComplex( Number id )

Return true or false to indicate whether given image with the given id is complex-valued or not.  
Boolean IsExceptionUserAbort( void ) Returns true if the exception currently in effect is a user abort.  
Boolean IsImageReal( Number id ) Return true or false to indicate whether given image with the given id is real-valued or not.  

Boolean IsImageRGB( Number id )

Return true or false to indicate whether given image with the given id is RGB-valued or not.  
Boolean IsInfinite( Number v ) Returns true if the value is infinite.  
Boolean IsIntegerDataType( ImageReference, Number bytes, Boolean isSigned ) Returns 1 if the image is an integer data type of size bytes with a matching sign charateristic as signed; returns 0 otherwise.  

Boolean IsLongImage( ImageReference )

Returns 1 if the image is signed 4-byte integer data; returns 0 otherwise.  
Boolean IsNan( Number v ) Returns true if the value is not a number.  
Boolean IsPackedComplexImage( ImageReference ) Returns 1 if the image is packed complex data; returns 0 otherwise.  
Boolean IsRealDataType(ImageReference, Number bytes) Returns 1 if the image is an real data type of size bytes; returns 0 otherwise.  

Boolean IsRGBDataType(ImageReference, Number bytes)

Returns 1 if the image is an RGB data type of size bytes; returns 0 otherwise.  
Boolean IsShortImage( ImageReference ) Returns 1 if the image is signed 2-byte integer data; returns 0 otherwise.  
Image FindImageByIndex( Number index ) Returns the 'index'th image. Example
ImageReference FindImageByIndex( Number index ) Returns the 'index'th image.  
     

ComplexImageExpression =( lvalue PredefinedComplexImage dst, ComplexImageExpression src )

Assign src to dst, pixel by pixel.  

ComplexImage ComplexImage( String title, Number bytes, Number d0, Number d1, Number d2 )

Creates a 3D complex image of size [d0,d1,d2] with the given title. The bytes parameter can be 8 or 16 for single and double precision floating point numbers.  

ComplexImage ComplexImage( String title, Number bytes, Number d0, Number d1 )

Creates a 2D complex image of size [d0,d1] with the given title. The bytes parameter can be 8 or 16 for single and double precision floating point numbers.  
ComplexImage ComplexImage( String title, Number bytes, Number d0 ) Creates a 1D complex image of size [d0] with the given title. The bytes parameter can be 8 or 16 for single and double precision floating point numbers.  
ComplexImage ComplexToPacked( ComplexImage source, Number style ) Creates a new packed complex image from the complex 8-byte source.  
ComplexImage ComplexToPacked( ComplexImage source ) Creates a new packed complex image from the complex 8-byte source.  

ComplexImage CreateComplexImage( String title, Number width, Number height )

Creates a 2D single precision complex image of size [width,height] with the given title.  

ComplexImage CreatePackedComplexImage( String title, Number width, Number height )

Creates a 2D packed complex image of size [width,height] with the given title.  

ComplexImage FFT( ComplexImage source )

Creates a new complex 8-byte image from the FFT of the complex image source.  

ComplexImageExpression FourPointAverage( ComplexImage source )

Returns an image expression that evaluates to half the size of the source expression. Each point in the return image expression is the average of the four corresponding points in the source expression.  

ComplexImage IFFT( ComplexImage source )

Creates a new complex 8-byte image from the inverse FFT of the complex image source.  

ComplexImageExpression Index( ComplexImage, RealImageExpression x, RealImageExpression y )

Returns a pixel in the given complex image at the position [x,y]. Performs bounds checking.  

ComplexImageExpression Index( ComplexImage, RealImageExpression x, RealImageExpression y, RealImageExpression z )

Returns a pixel in the given Complex image at the position [x,y,z]. Performs bounds checking.  

ComplexImage MatrixTranspose( ComplexImage a )

Return the matrix transpose image of matrix image a.  
MPExactDistanceMap Command of script-access to binary image processing  

ComplexImage MPExactDistanceMap( Image image )

Generate an exact distance map from the source image and return the resulting complex image. The source image must be binary.  

ComplexImageExpression NoClipIndex( ComplexImage, RealImageExpression x, RealImageExpression y )

Returns a pixel in the given complex image at the position [x,y]. Does not perform bounds checking. This is slightly faster than Index().  

ComplexImageExpression NoClipIndex( ComplexImage, RealImageExpression x, RealImageExpression y, RealImageExpression z )

Returns a pixel in the given Complex image at the position [x,y,z]. Does not perform bounds checking. This is slightly faster than Index().  

ComplexImageExpression Offset( ComplexImage, Number dh, Number dv )

Returns the pixel with the offset specified by [dh,dv] from the current evaluation position within the image.  
ComplexImageExpression Offset( ComplexSubArea, Number dh, Number dv ) Returns the pixel with the offset specified by [dh,dv] from the current evaluation position within the image sub area.  

ComplexImage PackedFFT( RealImage source )

Creates a new packed complex image from the FFT of the real image source.  
ComplexImage PackedToComplex( ComplexImage source ) Creates a new complex 8-byte image from the packed complex source.  

ComplexImage RealFFT( RealImage source )

Creates a new complex 8-byte image from the FFT of the real image source.  

ComplexImage ReducedFFT( Image source )

Creates a new packed complex image from the FFT of the real image source after reducing the source by a factor of 2.  
ComplexImageExpression EvaluateXneEtc_CneFnToXieEtc_CieFn( ComplexNumberExpression, ImageExpression... )  

ComplexImageExpression TimeBar( String title, ComplexImageExpression expression )

Displays a timebar with the given title during evaluation of the expression. Return the expression directly.  

ComplexImageExpression Warp( ComplexImage source, RealImageExpression sourceX, RealImageExpression sourceY )

Returns the bilinear interpolated value at the position [x,y] within the source image.  

ComplexImageExpression =( lvalue ComplexImageVariable, ComplexImageExpression )

   

ComplexImageExpression =( lvalue ComplexImageExpression, ComplexImageExpression )

   

ComplexImage [( ComplexImage, Number top, Number left, Number bottom, Number right )

Returns the complex sub-area image specified by the coordinates [top,left,bottom,right].  
ComplexImage [( ComplexImage, Number y1, Number x1, Number z1, Number y2, Number x2, Number z2 ) Returns the complex sub-area image specified by the coordinates [x,y] where x and y are 3-D positions.  
ComplexImage [( ComplexImage, Number x, Number y ) Returns a complex pixel in the given complex image at the position [x,y]. This operator is equivalent to Index(image,x,y).  
ComplexImageExpression [( ComplexImage, RealImageExpression x, RealImageExpression y )    
ComplexImageExpression [( ComplexImage image, RealImageExpression x, RealImageExpression y, RealImageExpression z )    
ComplexImage ConvertBiCi( BasicImage bi )    
ComplexImageExpression ConvertBiCie( BasicImage )    
ComplexImageExpression ConvertBiCieLValue( BasicImage )    
ComplexImageExpression ConvertCiCie( ComplexImage )    
ComplexImageExpression ConvertCiCieLValue( ComplexImage )    
ComplexImage ConvertCieCi( ComplexImageExpression )    
ComplexImageExpression ConvertCneCie( ComplexNumberExpression )    
ComplexImageExpression ConvertRieCie( RealImageExpression )    
ComplexImage CreateInlineArray( ComplexImage, ComplexNumber... )    

ComplexImage slice1( ComplexImage, Number x, Number y, Number z, Number d0, Number l0, Number s0 )

Returns the subslice [(x,y,z),(d0,l0,s0)].  

ComplexImage slice2( ComplexImage, Number x, Number y, Number z, Number d0, Number l0, Number s0, Number d1, Number l1, Number s1 )

Returns the subslice [(x,y,z),(d0,l0,s0),(d1,l1,s1)]. Example

ComplexImage slice3( ComplexImage, Number x, Number y, Number z, Number d0, Number l0, Number s0, Number d1, Number l1, Number s1, Number d2, Number l2, Number s2 )

Returns the subslice [(x,y,z),(d0,l0,s0),(d1,l1,s1),(d2,l2,s2)].  
"Complexnumber" A basic types of variable. Some comments Example

ComplexNumberExpression *( ComplexNumberExpression, ComplexNumberExpression )

Return the product of the two numbers.  
ComplexNumberExpression **( ComplexNumberExpression n, ComplexNumberExpression exp ) Return n raised to the exp power.  
ComplexNumberExpression *=( lvalue ComplexNumberExpression dst, ComplexNumberExpression src ) Assign dst*src to dst.  
ComplexNumberExpression +( ComplexNumberExpression, ComplexNumberExpression ) Return the sum of the two numbers.  

ComplexNumberExpression +=( lvalue ComplexNumberExpression dst, ComplexNumberExpression src )

Assign dst+src to dst.  

ComplexNumberExpression -( ComplexNumberExpression, ComplexNumberExpression )

Return the difference of the two numbers.  
ComplexNumberExpression -( ComplexNumberExpression ) Return the negation of the number.  
ComplexNumberExpression -=( lvalue ComplexNumberExpression dst, ComplexNumberExpression src ) Assign dst-src to dst.  

ComplexNumberExpression /( ComplexNumberExpression, ComplexNumberExpression )

Return the result of dividing the two numbers.  
ComplexNumberExpression /=( lvalue ComplexNumberExpression dst, ComplexNumberExpression src ) Assign dst/src to dst.  

ComplexNumberExpression =( lvalue ComplexNumberExpression dst, ComplexNumberExpression src )

Assign src to dst.  

ComplexNumberExpression ?( RealNumberExpression condition, ComplexNumberExpression truenumber, ComplexNumberExpression falsenumber )

Evaluates the condition expression and returns either the truenumber or falsenumber expression depending on condition.  

ComplexNumberExpression cis( RealNumberExpression )

Return complex(cos(n),sin(n)) as a complex number, where n is a real number. This is a unit vector in the complex plane.  

ComplexNumberExpression complex( RealNumberExpression real, RealNumberExpression imaginary )

Returns a complex number with the value of real + i * imaginary.  

ComplexNumberExpression conjugate( ComplexNumberExpression )

Return the conjugate of the complex number.  
ComplexNumberExpression ConvertCnCne( ComplexNumber )    
ComplexNumberExpression ConvertCnCneLValue( ComplexNumber )    
ComplexNumber ConvertCneCn( ComplexNumberExpression )    
ComplexNumberExpression ConvertRneCne( RealNumberExpression )    

ComplexNumberExpression cos( ComplexNumberExpression )

Return the cosine of the number  

ComplexNumberExpression cosh( ComplexNumberExpression )

Return the hyperbolic cosine of the number.  

ComplexNumber DotProduct( ComplexImageExpression, ComplexImageExpression )

Return the dot product of two image expressions (which are treated as vectors).  

ComplexNumberExpression exp( ComplexNumberExpression )

Return the exponential of the number.  

ComplexNumber GetPixel( ComplexImage, Number x, Number y )

Return the pixel in the image at [x,y]. Does not work on packed complex images.  

ComplexNumberExpression log( ComplexNumberExpression )

Return the logarithm of the number.  

ComplexNumberExpression Polar( ComplexNumberExpression )

Return the polar representation of the rectangular complex number.  

ComplexNumber Polynomial( ComplexImageExpression, ComplexNumber x )

Return the polynomial a0 + a1*x + a2*x*x ... where x is the free variable and a0 ... aN are the pixels of the image.  

ComplexNumber product( ComplexImageExpression )

Return the product of all pixel values of the image expression.  

ComplexNumberExpression Rect( ComplexNumberExpression )

Return the rectangular representation of the polar complex number.  

ComplexNumberExpression sin( ComplexNumberExpression )

Return the sine of the number.  

ComplexNumberExpression sinh( ComplexNumberExpression )

Return the hyperbolic sine of the number.  

ComplexNumberExpression sqrt( ComplexNumberExpression )

Return the square root of the number.  

ComplexNumber sum( ComplexImageExpression )

Return the sum of all pixel values of the image expression.  

ComplexNumberExpression tan( ComplexNumberExpression )

Return the tangent of the number.  

ComplexNumberExpression tanh( ComplexNumberExpression )

Return the hyperbolic tangent of the number.  

ComplexNumberExpression tert( RealNumberExpression condition, ComplexNumberExpression truenumber, ComplexNumberExpression falsenumber )

Evaluates the condition expression and returns either the truenumber or falsenumber expression depending on condition.  
"complexsubarea" A basic types of variable. Some comments  

ComplexSubArea [( ComplexImage, Number y1, Number x1, Number z1, Number y2, Number x2, Number z2 )

Returns the complex sub-area image specified by the coordinates [x,y] where x and y are 3-D positions.  
ComplexSubArea [( ComplexImage, Number x, Number y ) Returns a complex pixel in the given complex image at the position [x,y]. This operator is equivalent to Index(image,x,y).  

ComplexSubArea [( ComplexImage, Number top, Number left, Number bottom, Number right )

Returns the complex sub-area image specified by the coordinates [top,left,bottom,right].  
Object-oriented programming (OOP) coding style   Example
"Constant" A value that can't be changed such as number, character, and string.  
EMGetBeamShift (Number x, Number y)

Retrieve the value of beam shift coil and store the value into the assigned real number x and y (The x and y are the settings of electromagnetic lenses, which need to be converted into real 2-D units such as nm or µm).

 
"empty lines" in Output Window   Example
EMSetBeamShift (Number x, Number y) Shift the beam by the amounts of x and y (see 1a for the definitions of x and y)  
Command combination: "EMGetBeamShift (Number x, Number y)" + "EMSetBeamShift (Number x, Number y)" To position the electron beam for scanning electron diffraction  
continue A statement terminates the current iteration of a loop and continues with the next iteration. Example

Boolean ContinueCancelDialog( String prompt )

Puts up a dialog with both a Continue button and Cancel button. Returns 1 for Continue and 0 for Cancel.  
void continue( )    
Exit(0) To exit. "Exit(0) command" is different from “Break command” which does not need the user to press the cancel button to exit. Example1
Example2
"expression" May be a constant, variable, function call, or be composed of one or more operations.  
"frontmost image"   Example

FindNextImage( Image )

Find the next image, e.g. "Image FindNextImage( Image )". E.g. Example1, Example2.
foreach (Receiver; ObjectList)  
  Statement
Foreach statement is used with ObjectLists and is equivalent to:
for (index=0; index<ObjectList.SizeOfList(); ++index)
{
Receiver = ObjectList.ObjectAt(index)
{
Statement
}
}
 
Function Is a user defined operation and has a name, an argument list, a return type, and a body. Argument values are usually passed from the main-program to the functions. Changing the variable in the functions will change the value of the variable in the main-program (e.g. Example2). Example1
Example2
Example3

Boolean GetNumberNote( ImageReference, String noteLabel, NumberVariable noteValue )

Stores the value of the image note with label noteLabel into noteValue variable. Returns 1 if the note exists, returns 0 otherwise.  

number t, l, b, r
GetSelection (IMG1, t, l, b, r)

Read the coordinates of the current ROI in the image IMG1. If no ROI exists, it will read the coordinates of the entire image (0, 0, sizeY, sizeX) Example

GetTwoLabeledImagesWithPrompt(String prompt, String title, String label1, ImageVariable IMG1, String label2, ImageVariable IMG2 )

Pops up a dialog and allows the user to choose two images which will be assigned to the given image variables. The user dialog has two buttons: an OK and a Cancel button. Example
DocumentWindow GetDocumentWindow( Number index )

Gets the 'index'th document window.

Example1
Example2
DocumentWindow GetDocumentWindowByTitle( String name ) Gets the document window named 'name'.  
DocumentWindow GetFloatingWindow( Number index ) Gets the 'index'th floating window.  
DocumentWindow GetResultsWindow( Boolean open ) Gets the results window. If the window is not open, and 'open' is true, the results window is opened. In GMS 1.8 and earlier versions, the "Results window" was a scriptable object. In GMS 2 and later versions, the "Results window" is no longer accessible; therefore, this command was removed. Scripts which attempt to use this command in the new versions will generate errors. The "Results window" was changed to "Output window", which has three tabbed panels: Results, Notes and Debug.  
DocumentWindow GetApplicationWindow( ) Gets the application window. In GMS 1.8 and earlier versions, the "Results window" was a scriptable object. In GMS 2 and later versions, the "Results window" is no longer accessible; therefore, this command was removed. Scripts which attempt to use this command in the new versions will generate errors. The "Results window" was changed to "Output window", which has three tabbed panels: Results, Notes and Debug.  
TagGroup DLGCreateDialog( String title, TagGroup dialog_items ) Creates the dialogs_items TagGroup. So you need to call DLGCreateDialog() before you can add the dialog items. Example1
Example2
Example3
Example4
Example5
TagGroup DLGCreateCheckBox( string title ) A CHECKBOX FUNCTION. Creates a checkbox with the given text: example1, Example2.
TagGroup DLGCreateCheckBox(string title, number state) A CHECKBOX FUNCTION. Creates a checkbox with the given text and initial checked/unchecked state
 
TagGroup DLGCreateCheckBox( string title, number state, string changedmethod ) A CHECKBOX FUNCTION. Creates a checkbox with the given text, initial checked/unchecked state, and changed method. Example
TagGroup DLGAddElement( TagGroup container, TagGroup element ) Add an element to a container or element list; returns the element: (Comparison between with and without FOR command: Example5 and Example6)
Example1
Example2
Example3
Example4
TagGroup DLGAddElement( TagGroup container, TagGroup element, String side ) Add an element with the specified 'Side' attribute to a container or element list; returns the element. Example
TagGroup DLGAddElement( TagGroup container, TagGroup element, String side, String anchor ) Add an element with the specified 'Side' and 'Anchor' attributes to a container or element list; returns the element. Example
     
iheight: An intrinsic variable for the height of an image. Some comments Example1
Example2
"image" A basic types of variable. Some comments  

“Image X” or “Image XY”

Refers to the image which displays “X: …” or “XY: …” in its window title on DM interface. X or XY is called image-letter.  
image IMG, COPYING1, NEWIMG1 Assign three image variables  

image IMG
GetFrontImage(IMG)

Assign an image variable (named IMG here) to the front-most displayed image so that the image can be used later Example1
Example2
window.ImageReference GetFrontImage( void ) Return the foremost image.  
Boolean GetFrontImage( ImageVariable ) Set the image variable to represent the foremost image, returns 1 if successful; return 0 otherwise.  
ImageReference GetFrontImage( ) Return the foremost image.  
     
Number GetFrontImageID( ) Return the id of the front most image window.  
ImageGetID() Returns a unique number for each image in memory temporarily  

Number ImageGetID( ImageReference )

Returns a unique identifier for the image.  
ImageIsValid() Returns true if 'image' is a valid object. E.g. Example1, Example2.
Boolean ImageIsValid( ImageReference image) Returns true if 'image' is a valid object. Example
DocumentWindow ImageDocumentShow( ImageDocument imgDoc ) Shows the given image document.  
DocumentWindow ImageDocumentShowAtPosition( ImageDocument imgDoc, Number x, Number y ) Shows the given image document at the application position (x,y).  
DocumentWindow ImageDocumentShowAtRect( ImageDocument imgDoc, Number top, Number left, Number bottom, Number right ) Shows the given image document at the rect (top,left,bottom,right).  
Number CountImageDocuments( void ) Returns the number of image documents. Example1
Example2
ImageDocumentGetImage   Example1 Example2
ImageReference ImageDocumentGetImage( ImageDocument imgDoc, Number position ) Returns the image contained within this image document by position.  
ImageReference ImageDocumentGetImageByID( ImageDocument imgDoc, Number id ) Returns an image contained in this image document by id.  
ImageDisplay ImageDocumentGetImageModeDisplay( ImageDocument imgDoc ) Gets the image display targeted by the current image mode.  
Boolean WindowIsValid( DocumentWindow window ) Returns true if 'window' points to a valid object. Example
Number WindowGetType( DocumentWindow window ) Gets the type of thw window. Example

Number WorkspaceFindByWindow( Window win )

Returns the workspace wsID which the document window 'win' is assigned to. Example
     
     

void MatrixPrint( Image a )

Print an image as a matrix to the results window.  
mod(a, b) For instance, "mod(14,3)=2" is equal to "14 = 4*3 + 2". Example
NULL E.g. allows a modified dialog text and a default value Example
"Number" A basic types of variable. Some comments  
Number abs( Number v1 )    
Number acos( Number v1 )    
Number distance( Number v1, Number v2 )    
Number DotProduct( RealImageExpression, RealImageExpression) Return the dot product of two image expressions (which are treated as vectors).  
Number mean( RealImageExpression ) Return the mean pixel value of the image expression.  
Number RMS( RealImageExpression ) Return the RMS of all pixel values of the image expression.  
     

TagGroup DLGTableLayout( TagGroup element, number columns, number rows, number uniform )

Sets the 'Layout' attribute to a table layout with the given number of columns, rows, and cell uniformity flag; returns the element: Example1, Example2  

TagGroup DLGTableLayout( TagGroup tg, number columns, number rows, string uniform_str )

Sets the 'Layout' attribute to a table layout with the given number of columns, rows, and cell uniformity flag; returns the element.  
TagGroup DLGCreateRealField( number value ) Creates a real-valued field with the given initial value, field width, and format.  

TagGroup DLGCreateRealField( number value, number width, number format )

Creates a real-valued field with the given initial value, field width, and format: Example.  
TagGroup DLGCreateRealField( number value, number width, number format, string changedmethod ) Creates a real-valued field with the given initial value, field width, format, and changed method.  
TagGroup DLGCreateRealField( string title, TagGroup &field_item, number value, number width, number format ) Creates a named real-valued field group with the given title, initial value, width and format; passes back the field item; returns the named field group. E.g. input dialogs for confirming or manually entering your own number (link). E.g. Example1, Example2.

TagGroup DLGCreateIntegerField( number value )

Creates a integer-valued field with the given initial value, and field width.  

TagGroup DLGCreateIntegerField( number value, number width )

Creates a integer-valued field with the given initial value, and field width.  

TagGroup DLGCreateIntegerField( number value, number width, string changedmethod )

Creates a integer-valued field with the given initial value, field width, and changed method.  

TagGroup DLGCreateIntegerField( string title, TagGroup &field_item, number value, number width )

Creates a named integer-valued field group with the given title, initial value and width; passes back the field item; returns the named field group.  

TagGroup DLGCreateStringField( String value )

Creates a string-valued field with the given initial value, and field width. Example
TagGroup DLGCreateStringField( String value, number width )

Creates a string-valued field with the given initial value, and field width.

 
TagGroup DLGCreateStringField( String value, number width, string changedmethod ) Creates a string-valued field with the given initial value, field width, and changed method.  

TagGroup DLGCreateStringField( string title, TagGroup &field_item, string value, number width )

Creates a named string-valued field group with the given title, initial value and width; passes back the field item; returns the named field group.  

TagGroup DLGIdentifier( TagGroup element, String id )

Sets the 'Identifier' attribute; returns the element. Example
TagGroup LookupElement( object self, string identifier )

Retrieves the tagGroup associated with a particular dialog element: Example1, Example2.

number DLGGetValue( TagGroup tags, number &value )

Gets the numeric 'Value' attribute setting; returns 1 if succeeded, 0 otherwise. Example1
Example2
Example3
number DLGGetValue( TagGroup tags, string &value )

Gets the string 'Value' attribute setting; returns 1 if succeeded, 0 otherwise.

 

number DLGGetValue( object frame, string identifier, number &val )

Gets the numeric 'Value' attribute setting for a labeled element in a uiframe object; returns 1 if succeeded, 0 otherwise.  
number DLGGetValue( object frame, string identifier, string &val ) Gets the string 'Value' attribute setting for a labeled element identifier in a uiframe object; returns 1 if succeeded, 0 otherwise.  
number DLGGetValue( TagGroup tags )

Returns the numeric 'Value' attribute setting.

Example
TagGroup DLGCreateGroup()

A GROUP FUNCTION: Creates a group container

 
TagGroup DLGCreateGroup( TagGroup &items )

A GROUP FUNCTION: Creates a group container; passes back an empty items list, and returns the container.

 
TagGroup DLGGroupItems( TagGroup item1, TagGroup item2 )

A GROUP FUNCTION: Creates a group containing the given two items; returns the container: Example1., Example2.

 
TagGroup DLGGroupItems( TagGroup item1, TagGroup item2, TagGroup item3 )

A GROUP FUNCTION: Creates a group containing the given three items; returns the container.

 
TagGroup DLGGroupItems( TagGroup item1, TagGroup item2, TagGroup item3, TagGroup item4 )

A GROUP FUNCTION: Creates a group containing the given four items; returns the container.

 
TagGroup DLGValue( TagGroup element, Number value )

Sets the numeric 'Value' attribute; returns the element.

 
TagGroup DLGValue( TagGroup element, string value )

Sets the string 'Value' attribute; returns the element.

 
TagGroup DLGValue( object frame, string identifier, number val )

Sets the numeric 'Value' attribute in a labeled element in a uiframe object; returns the TagGroup containing the identifier.

 
TagGroup DLGValue( object frame, string identifier, string val )

Sets the string 'Value' attribute in a labeled element in a uiframe object; returns the TagGroup containing the identifier.

 
Number CountDocumentWindowsOfType( Number type ) Returns the number of document windows with type 'type'.  
Number LinePlotImageDisplayCountSlices( LinePlotImageDisplay lpid ) Returns the number of slices in the line plot. Example
ImageDisplayGetSliceidByIndex   Example
ImageDisplayGetSliceLabelByID   Example
Number ImageCountImageDisplays( ImageReference ) Returns the number of image displays in which this image is displayed. Example
Number ImageCountImageDisplaysInImageDocument( ImageReference, ImageDocument imgDoc ) Returns the number of image displays in the image document in which this image is displayed.  
void ROISetVolatile( ROI roi, Boolean is_volatile )

Set whether the region of interest is volatile or not.

Example

Number CreateFileForWriting( String fileName )

Create and open the file for writing. Return the file reference for this file. This call must be balanced with call to CloseFile() with the returned reference number. Example
Number ImageGetNumDimensions( ImageReference ) Returns number of dimensions of the image (E.g. two-dimensional, 2D). Example

Number OpenFileForReading( String fileName )

Open the file for reading. Return the file reference for this file. This call must be balanced with call to CloseFile() with the returned reference number.  

Number OpenFileForReadingAndWriting( String fileName )

Open the file for reading and writing. Return the file reference for this file. This call must be balanced with call to CloseFile() with the returned reference number. Example

Number OpenFileForWriting( String fileName )

Open the file for writing. Return the file reference for this file. This call must be balanced with call to CloseFile() with the returned reference number.  
number NUM3 Define a variable (a number here: the name of variable needs to start with a letter) Example
number width, height
GetNumber("Enter image width:", 512, width)
GetNumber("Enter image height:", width, height)
Ask the user for the image dimensions (x and y in pixels) HRTEM
number SNR, xRays
GetNumber("Enter signal-to-noise ratio:", 1, SNR)
GetNumber("Enter number of X-rays:", 0, xRays)
Ask the user for the SNR (signal-to-noise ratio) and probability of x-rays HRTEM
number pi = 3.1415926, spacingX = 15, spacingY = 20 Set up the x and y lattice spacings in pixels HRTEM
Number GetImageDataSeed( ImageReference ) Return a seed representing the data of the image. Each time the image data changes, the seed will change.  
ImageReference ImageClone( ImageReference img ) Returns a clone of 'img', i.e., duplicate an image. Example1
Example2
SetElementIsEnabled() Set the state of an element either to 'active' (1) or 'inactive' (0). The inactive elements appear greyed-out and cannot be changed: Example1, Example2.
ImageReference NewLiveFFT( ImageDisplay imageDisplay, ROI roi, Boolean reduce ) Creates a new live FFT of the area in 'roi', that is reduced if 'reduce' is 'true' Example
Boolean GetDirectoryDialog( String dirName ) Puts up the GetDirectory dialog and stores the path of the chosen directory in 'dirName' Example

TagGroup DLGCreatePushButton( String title, String action_method )

Creates a single-state text button with the given display title and action method: Example1, Example2, Example3.  
TagGroup DLGCreateBevelButton( TagGroup onBitmap, TagGroup offBitmap, string actionmethod ) Creates a single-state bitmap button with the given on/off bitmap TagGroups and action method.  
TagGroup DLGCreateBevelButton( Image onImage, Image offImage, string actionmethod ) Creates a single-state bitmap button with the given on/off images and action method.  
TagGroup DLGCreateBevelButton( Image img, string actionmethod ) Creates a single-state bitmap button with the given image and action method.  
TagGroup DLGCreateDualStateBevelButton( string identifier, TagGroup onBitmap, TagGroup offBitmap, string actionmethod ) Creates a dual-state bitmap button with the given identifier, on/off bitmap TagGroups, and action method.  
TagGroup DLGCreateDualStateBevelButton( string identifier, Image onImage, Image offImage, string actionmethod ) Creates a dual-state bitmap button with the given identifier, on/off images, and action method.  
TagGroup DLGCreateDualStateBevelButton( string identifier, Image img, string actionmethod ) Creates a dual-state bitmap button with the given identifier, image, and action method.  
Number DLGGetBevelButtonOn( object frame, String identifier, TagGroup &tags ) Gets the On/Off state of a labeled bevel button in a uiframe object; passes back the button TagGroup in tags, and 1 if on , 0 if off.  
TagGroup DLGBevelButtonOn( TagGroup button_tags, number isOn ) Sets the On/Off state of a button; returns the button TagGroup.  
TagGroup DLGBevelButtonOn( object frame, string identifier, number isOn ) Sets the On/Off state of a labeled button in a uiframe object; returns the button TagGroup.  
TagGroup DLGCreateElement( string type ) Create a dialog element of the specified type; returns the newly created element.  

TagGroup DLGCreateElementWithItems( string type, TagGroup &items )

Create a container of the specified type, and passes back an empty items list; returns the container.  
TagGroup DLGCreateElementWithItems( string type) Create a container of the specified type  
TagGroup DLGAddElementBefore( TagGroup container, number index, TagGroup element ) Insert an element before the given index; returns the element  
TagGroup DLGAddElementAfter( TagGroup container, number index, TagGroup element ) Insert an element after the given index; returns the element  

TagGroup DLGGetElement( TagGroup container, number index )

Retrieve an element at the given index from a container: Example  
TagGroup DLGGetElement( TagGroup container, string label, number &index ) Retrieve an element with the given label; passes back the index of the element  
TagGroup DLGGetElement( TagGroup container, string label ) Retrieve an element with the given label  
TagGroup DLGRemoveElement( TagGroup container, number index ) Remove an element at the given index from a container; returns the removed element.  

TagGroup DLGRemoveLastElement( TagGroup container)

Remove the last element from a container; returns the removed element.  
TagGroup DLGRemoveElement( TagGroup container, string label ) Remove an element with the given label; returns the removed element.  
Number DLGSetElement( TagGroup container, number index, TagGroup new_element ) Sets the element at the given index; returns 1 if succeeded, 0 otherwise  
Number DLGSetElement( TagGroup container, string label, TagGroup new_element ) Sets the element with the given label; returns 1 if succeeded, 0 otherwise  

TagGroup DLGSetElementLabel( TagGroup container, number index, string new_label )

Sets the label of the element at the given index; returns the element  
TagGroup DLGSetElementLabel( TagGroup container, string label, string new_label ) Sets the label of the element with the given label; returns the element  
TagGroup DLGCreateTableLayout( number cols, number rows, number uniform ) Create a table layout with the given number of columns, rows, and whether the table cells are uniform in size; returns the table layout.  
TagGroup DLGCreateTableLayout( number cols, number rows, string uniform ) Create a table layout with the given number of columns, rows, and whether the table cells are uniform in size; returns the table layout.  

TagGroup DLGBitmapData( TagGroup tg, Image img )

Sets the image data for a bitmap: Example.  

TagGroup DLGInternalPadding( TagGroup element, number x_pad, number y_pad )

Sets the 'InternalPadding' attribute; returns the element: Example  
TagGroup DLGInternalPadding( TagGroup element, Number t_pad, Number l_pad, Number b_pad, Number r_pad ) Sets the 'InternalPadding' attribute; returns the element.  

TagGroup DLGCreateBitmap( Image img )

A bitmap function for bevel buttons to creates a bitmap TagGroup from the given image.  
validateView() Return true: Example.  
TagGroup DLGMultipleSelect( TagGroup tg, number multiple_select ) Sets the 'MultipleSelect' attribute for Lists; returns the element.  

TagGroup DLGChangedMethod( TagGroup element, string changed_method )

Sets the 'ChangedMethod' attribute; returns the element: Example.  

TagGroup DLGLayout( TagGroup tg, TagGroup layout )

Sets the 'Layout' attribute for Groups; returns the element.  

TagGroup DLGEnabled( TagGroup item, number enabled )

Sets the 'enabled' attribute of a an item.  
TagGroup DLGInvalid( TagGroup tg, number isInvalid ) Sets the 'Invalid' attribute for a modified element. Used for run-time update of dialog displays  

TagGroup DLGLabel( TagGroup tg, string label )

Sets the 'Label' attribute for an element  
TagGroup DLGSide( TagGroup element, String side ) Sets the 'Side' attribute: "Left", "Right", "Top", "Bottom", "Center"; returns the element.  
TagGroup DLGAnchor( TagGroup element, String anchor ) Sets the 'Anchor' attribute: "North", "South", "East", "West"; returns the element.  
TagGroup DLGFill( TagGroup element, String fill )

Sets the 'Fill' attribute: "X", "Y", "XY", "Both"; returns the element.

 
TagGroup DLGExpand( TagGroup element, Number do_expand ) Sets the 'Expand' attribute: 0 for x-direction, 1 for y-direction; returns the element.  

TagGroup DLGExpand( TagGroup element, String s )

Sets the 'Expand' attribute: "X", "Y", "XY"; returns the element.  
TagGroup DLGMinValue( TagGroup element, Number value ) Sets the 'MinValue' attribute; returns the element.  
TagGroup DLGMaxValue( TagGroup element, Number value ) Sets the 'MaxValue' attribute; returns the element.  

TagGroup DLGWidth( TagGroup element, number width )

Sets the 'Width' attribute; returns the element.  

TagGroup DLGHeight( TagGroup element, number height )

Sets the 'Height' attribute; returns the element.  

TagGroup DLGFont( TagGroup element, string font )

Sets the 'Font' attribute; returns the element.  

TagGroup DLGTitle( TagGroup element, string title )

Sets the 'Title' attribute; returns the element.  

TagGroup DLGActionMethod( TagGroup element, string action_method )

Sets the 'ActionMethod' attribute; returns the element.  

Boolean GetPersistentNumberNote( String noteLabel, NumberVariable noteValue )

Stores the value of the persistent note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise: Example.  
ImageDisplay ImageDocumentAddImageDisplay( ImageDocument imgDoc, ImageReference image, Number displayType ) Adds the given image and an image display for it of the given type. E.g. Example1.  

void ImageChangeDataType( ImageReference img, Number dataType )

Changes the image data type to 'dataType'. To construct an appropriate dataType value, use the ImageConstructDataType command.  
Image NewLiveProfile( ImageDisplay imageDisplay, Number start_x, Number start_y, Number end_x, Number end_y, Number width ) Creates a new live profile from (start_x,start_y) to (end_x,end_y): Example.  
Image NewLiveHistogram( ImageDisplay imageDisplay, ROI roi, Number num_channels ) Creates a new live histogram of the area in 'roi', binned by 'num_channels': Example.  
     
     
     
     
     
     
     
     
     
     
     
     
     

 

   

  1111
String ImageDocumentGetName( ImageDocument imgDoc ) Returns the name of the image document.  
ImageDocument   Example
ImageDocument GetFrontImageDocument( ) Returns the front image document.  
ImageDocument =( ImageDocument, ! )    
ImageDocument =( ImageDocument, ImageDocument )    
ImageDocument CreateImageDocument( String title ) Creates an empty image document. E.g. Example1.  
ImageDocument GetImageDocument( Number position ) Returns the image document by position with the application.  
ImageDocument GetImageDocumentByID( Number id ) Returns the image document whose id is 'id'.  
ImageDocument ImageDocumentNullify( ! )    
ImageDocument ImageWindowGetImageDocument( DocumentWindow window ) Gets the image document displayed in the window.  
ImageDocument NewImageDocument( String title ) Creates an empty image document.  
ImageDocument ComponentGetImageDocument( Component annot ) Gets the image document associated with the annotation.  
ImageDocument ImageDocumentClone( ImageDocument imgDoc, Boolean doDeepCopy ) Returns a duplicate of the image docuemnt, creating a copy of its images if 'doDeepCopy' is true.  
ImageDocument ImageGetOrCreateImageDocument( ImageReference im ) Returns an image document containing the image, creating one if necessary.  
ImageDocument NewImageDocumentFromFile( String path_name ) Creates a new image document from a file.  
ImageDocument ReinterpretLongAsImageDocument( Number l )    
ImageDocument ReinterpretLongAsImageDocumentPtr( Number l )    
     
Number ImageDisplayGetDisplayType( ImageDisplay imgDisp ) Returns type of the image display >> -2: Best image display; 1: Raster image display (e.g. TEM STEM images); 2: Surface plot image display; 3: Line plot image display (e.g. EELS and EDS profiles); 4: RGB image display; and 7: Spreadsheet image display Example1
Example2
"Operations/operators" Operations are represented by operators. The parameters of the operation are called operands. Operators that work on one operand and two operands are called unary operators and binary operators, respectively.  
"Realnumber" A basic types of variable. Some comments  

RealNumberExpression !( RealNumberExpression src )

Return the logical NOT of src.  

RealNumberExpression !=( RealNumberExpression, RealNumberExpression )

Return 1 if the two numbers are not equal and 0 otherwise.  
RealNumberExpression !=( ComplexNumberExpression, ComplexNumberExpression ) Return 1 if the two numbers are not equal and 0 otherwise.  

RealNumberExpression !=( RGBNumberExpression, RGBNumberExpression )

Return 1 if the two RGB values are not equal and 0 otherwise.  

RealNumberExpression &&( RealNumberExpression, RealNumberExpression )

Return the logical AND of the two numbers.  
RealNumberExpression *( RealNumberExpression, RealNumberExpression ) Return the product of the two numbers.
 

RealNumberExpression **( RealNumberExpression n, RealNumberExpression exp )

Return n raised to the exp power.  

RealNumberExpression *=( lvalue RealNumberExpression dst, RealNumberExpression src )

Assign dst*src to dst.  

RealNumberExpression +( RealNumberExpression, RealNumberExpression )

Return the sum of the two numbers.  

RealNumberExpression ++( lvalue RealNumberExpression dst )

Increment dst by 1.  

RealNumberExpression ++!( lvalue RealNumberExpression dst )

Increment dst by 1.  
RealNumberExpression +=( lvalue RealNumberExpression dst, RealNumberExpression src ) Assign dst+src to dst.  

RealNumberExpression -( RealNumberExpression )

Return the negation of the number.  
RealNumberExpression -( RealNumberExpression, RealNumberExpression ) Return the difference of the two numbers.  

RealNumberExpression --( lvalue RealNumberExpression dst )

Decrement dst by 1.  
RealNumberExpression --!( lvalue RealNumberExpression dst ) Decrement dst by 1.  

RealNumberExpression -=( lvalue RealNumberExpression dst, RealNumberExpression src )

Assign dst-src to dst.  

RealNumberExpression /( RealNumberExpression, RealNumberExpression )

Return the result of dividing the two numbers.  

RealNumberExpression /=( lvalue RealNumberExpression dst, RealNumberExpression src )

Assign dst/src to dst.  
RealNumberExpression <( RealNumberExpression, RealNumberExpression ) Return 1 if the left number is less than the right number and 0 otherwise.  

RealNumberExpression <=( RealNumberExpression, RealNumberExpression )

Return 1 if the left number is less or equal to than the right number and 0 otherwise.  

RealNumberExpression =( lvalue RealNumberExpression dst, RealNumberExpression src )

Assign src to dst.  
RealNumberExpression ==( RGBNumberExpression, RGBNumberExpression ) Return 1 if the left RGB value is equal to the right RGB value and 0 otherwise.  
RealNumberExpression ==( ComplexNumberExpression, ComplexNumberExpression ) Return 1 if the left number is equal to the right number and 0 otherwise.  

RealNumberExpression ==( RealNumberExpression, RealNumberExpression )

Return 1 if the left number is equal to the right number and 0 otherwise.  
RealNumberExpression >( RealNumberExpression, RealNumberExpression ) Return 1 if the left number is greater than the right number and 0 otherwise.  
RealNumberExpression >=( RealNumberExpression, RealNumberExpression ) Return 1 if the left number is greater than or equal to the right number and 0 otherwise.  
RealNumberExpression ?( RealNumberExpression condition, RealNumberExpression truenumber, RealNumberExpression falsenumber ) Evaluates the condition expression and returns either the truenumber or falsenumber expression depending on condition.  

RealNumberExpression ||( RealNumberExpression, RealNumberExpression )

Return the logical OR of the two numbers.  

RealNumberExpression abs( RealNumberExpression )

Return the absolute value of the number.  
RealNumberExpression abs( ComplexNumberExpression ) Return the absolute value of the modulus of a complex number.  
RealNumberExpression acos( RealNumberExpression ) Return the arc-cosine of the number.  
RealNumberExpression AiryAi( Number ) Return the Airy Ai function of the number.  

RealNumberExpression AiryBi( Number )

Return the Airy Bi function of the number.  
RealNumberExpression alpha( RGBNumberExpression ) Return the alpha portion of an RGB number.  

RealNumberExpression asin( RealNumberExpression )

Return the arc-sine of the number.  
RealNumberExpression atan( RealNumberExpression ) Return the arc-tangent of the number.  
RealNumberExpression atan2( RealNumberExpression y, RealNumberExpression x ) Return the arc-tangent of the ratio of y/x.  
RealNumberExpression atanh( RealNumberExpression ) Return the hyperbolic arc-tangent of the number.  
RealNumberExpression BesselI( Number, Number ) Return the general Bessel I function of two numbers.  
RealNumberExpression BesselJ( Number, Number ) Return the general Bessel J function of two numbers.  
RealNumberExpression BesselK( Number, Number ) Return the general Bessel K function of two numbers.  
RealNumberExpression BesselY( Number, Number ) Return the general Bessel Y function of two numbers.  

RealNumberExpression Beta( Number, Number )

Return the beta function of two numbers.  

RealNumberExpression BinomialCoefficient( Number, Number )

Return the binomial coefficient of two numbers.  
RealNumberExpression BinomialRandom( Number, Number ) Return a random number with binomial distribution between [0,1)  
RealNumberExpression blue( RGBNumberExpression ) Return the blue portion of an RGB number.  

RealNumberExpression Ceil( RealNumberExpression )

Return the number truncated to an integer (rounding towards positive infinity).  

RealNumberExpression clip( RealNumberExpression value, RealNumberExpression minimum, RealNumberExpression maximum )

Return the value clipped to be in the range bounded by minimum and maximum.  

RealNumberExpression cos( RealNumberExpression )

Return the cosine of the number.  

RealNumberExpression cosh( RealNumberExpression )

Return the hyperbolic cosine of the number.  

RealNumberExpression distance( RealNumberExpression x, RealNumberExpression y )

Return sqrt( x * x + y * y ).  

RealNumberExpression erf( Number )

Return the error function of the number.  
RealNumberExpression erfc( Number ) Return the complement of the error function of the number.  

RealNumberExpression exp( RealNumberExpression )

Return the exponential of the number.  

RealNumberExpression exp1( RealNumberExpression )

Return the exponential - 1 of the number.  
RealNumberExpression exp10( RealNumberExpression )
Return 10 raised to the number.  
RealNumberExpression exp2( RealNumberExpression )
Return 2 raised to the number.  
RealNumberExpression ExponentialRandom( void ) Return a random number with exponential distribution between [0,1).  

RealNumberExpression Factorial( Number )

Return the factorial of the number.  

RealNumberExpression Floor( RealNumberExpression )

Return the number truncated to an integer (rounding towards negative infinity).  
RealNumberExpression Gamma( Number )
Return the gamma of the number.  
RealNumberExpression GammaP( Number, Number ) Return the incomplete gamma function of two numbers.  

RealNumberExpression GammaQ( Number, Number )

Return the complement of the incomplete gamma function of two numbers.  
RealNumberExpression GammaRandom( Number ) Return a random number with gamma distribution between [0,1).  

RealNumberExpression GaussianRandom( void )

Return a random number with gaussian distribution between [0,1).  

RealNumberExpression green( RGBNumberExpression )

Return the green portion of an RGB number.  

RealNumberExpression imaginary( ComplexNumberExpression )

Return the imaginary portion of the complex number.  

RealNumberExpression LegendrePolynomial( Number, Number, Number )

Return the Legendre polynomial function for a number.  
RealNumberExpression log( RealNumberExpression ) Return the natural logarithm of the number.  
RealNumberExpression log1( RealNumberExpression ) Return the natural logarithm of the number + 1.  
RealNumberExpression log10( RealNumberExpression ) Return the logarithm base 10 of the number.  

RealNumberExpression log2( RealNumberExpression )

Return the logarithm base 2 of the number.  

RealNumberExpression LogGamma( Number )

Return the log gamma of the number.  

RealNumberExpression max( RealNumberExpression, RealNumberExpression )

Return the maximum of the two numbers.  

RealNumberExpression Maximum( RealNumberExpression... )

Return the maximum of a list of numbers.  

RealNumberExpression Median( RealNumberExpression... )

Return the median of a list of numbers.  

RealNumberExpression min( RealNumberExpression, RealNumberExpression )

Return the minimum of the two numbers.  
RealNumberExpression Minimum( RealNumberExpression... ) Return the minimum of a list of numbers.  

RealNumberExpression mod( RealNumberExpression, RealNumberExpression )

Return the modulus of the first number divided by the second number.  

RealNumberExpression modulus( ComplexNumberExpression )

Return the modulus of a complex number.  

RealNumberExpression Nearest( RealNumberExpression )

Return the number rounded to the nearest integer.  

RealNumberExpression norm( ComplexNumberExpression )

Return the norm of a complex number. This is the modulus squared.  

RealNumberExpression Phase( ComplexNumberExpression )

Return the phase of the complex number.  

RealNumberExpression PoissonRandom( Number )

Return a random number with poisson distribution between [0,1).  

RealNumberExpression random( void )

Return a random number in the range 0 to 65535.  

RealNumberExpression real( ComplexNumberExpression )

Return the real portion of the complex number.  

RealNumberExpression red( RGBNumberExpression )

Return the red portion of an RGB number.  

RealNumberExpression remainder( RealNumberExpression, RealNumberExpression )

Return the remainder of the first number divided by the second number.  

RealNumberExpression Round( RealNumberExpression )

Return the number converted to integer using current rounding mode.  

RealNumberExpression sgn( RealNumberExpression )

Returns 1 if the number is equal to or greater than 0 otherwise returns -1.  

RealNumberExpression sin( RealNumberExpression )

Return the sine of the number.  

RealNumberExpression sinh( RealNumberExpression )

Return the hyberbolic sine of the number.  
RealNumberExpression SphericalBesselJ( Number order, Number )
Return the spherical Bessel J function of the given order for a number.  

RealNumberExpression SphericalBesselY( Number, Number )

Return the spherical Bessel Y function of the given order for a number.  

RealNumberExpression sqrt( RealNumberExpression )

Return the square root of the number.  

RealNumberExpression tan( RealNumberExpression )

Return the tangent of the number.  

RealNumberExpression tanh( RealNumberExpression )

Return the hyperbolic tangent of the number.  

RealNumberExpression tert( RealNumberExpression condition, RealNumberExpression truenumber, RealNumberExpression falsenumber )

Evaluates the condition expression and returns either the truenumber or falsenumber expression depending on condition.  

RealNumberExpression Trunc( RealNumberExpression )

Return the number truncated to an integer (rounding towards zero).  

RealNumberExpression UniformRandom( void )

Return a random number with uniform distribution between [0,1).  

RealNumberExpression !( RealNumberExpression src )

Return the logical NOT of src.  
RealNumber ConvertRneRn( RealNumberExpression )    
RealNumberExpression ConvertRnRne( RealNumber sexp )    

RealNumberExpression ConvertRnRneLValue( RealNumber )

   
"realimage" A basic types of variable. Some comments  
RealImage [( RealImage )    
RealImageExpression =( lvalue RealImageExpression, RealImageExpression )    
RealImageExpression =( lvalue RealImageVariable, RealImageExpression )    

RealImageExpression =( lvalue PredefinedRealImage dst, RealImageExpression src )

Assign src to dst, pixel by pixel.  

RealImage AutoCorrelate( RealImage source )

Return an image which is the result of the auto correlation of source.  
RealImage AutoCorrelation( RealImage source ) Return an image which is the result of the auto correlation of source.  

RealImage BinaryImage( String title, Number d0 )

Creates a 1D binary image of size [d0] with the given title.  
RealImage BinaryImage( String title, Number d0, Number d1 ) Creates a 2D binary image of size [d0,d1] with the given title.  
RealImage BinaryImage( String title, Number d0, Number d1, Number d2 ) Creates a 3D binary image of size [d0,d1,d2] with the given title.  

RealImage Convolution( Image source, Image kernel )

Creates a new image that is the convolution of the source image with the kernel. The kernel should be less than 7x7.  
RealImage ConvertBiRi( BasicImage bi )    
RealImageExpression ConvertBiRie( BasicImage )    
RealImageExpression ConvertBiRieLValue( BasicImage )    

RealImage ConvertRieRi( RealImageExpression )

   
RealImageExpression ConvertRiRie( RealImage )    
RealImageExpression ConvertRiRieLValue( RealImage )    
RealImageExpression ConvertRneRie( RealNumberExpression )    
RealImage CreateInlineArray(RealImage, RealNumber...)    

RealImage CreateByteImage( String title, Number width, Number height )

Creates a 2D unsigned 1-byte integer image of size [width,height] with the given title.  

RealImage CreateFloatImage( String title, Number width, Number height )

Creates a 2D single precision float image of size [width,height] with the given title. E. g. Example.  

RealImage CreateLongImage( String title, Number width, Number height )

Creates a 2D signed 4-byte integer image of size [width,height] with the given title.  

RealImage CreateShortImage( String title, Number width, Number height )

Creates a 2D signed 2-byte integer image of size [width,height] with the given title.  

RealImage CrossCorrelate( RealImage source1, RealImage source2 )

Return an image which is the result of the cross correlation of source1 and source2. E.g. Example.  

RealImage CrossCorrelation( RealImage source1, RealImage source2 )

Return an image which is the result of the cross correlation of source1 and source2.  
RealImage CrossProduct( RealImage a, RealImage b ) Return the matrix cross product image of matrix images a and b.  
RealImageExpression EvaluateXneEtc_RneFnToXieEtc_RieFn( RealNumberExpression, ImageExpression... )    

RealImageExpression FourPointAverage( RealImage source )

Returns an image expression that evaluates to half the size of the source expression. Each point in the return image expression is the average of the four corresponding points in the source expression.  
RealImageExpression icol( )    
RealImageExpression icolumn( )    
RealImageExpression idepth( )    
RealImageExpression iheight( )    
RealImageExpression ipoints( )    
RealImageExpression iradius( )    
RealImageExpression irow( )    
RealImageExpression iplane( )    
RealImageExpression itheta( )    
RealImageExpression iwidth( )    

RealImageExpression Index( RealImage, RealImageExpression x, RealImageExpression y )

Returns a pixel in the given real image at the position [x,y]. Performs bounds checking.  

RealImageExpression Index( RealImage, RealImageExpression x, RealImageExpression y, RealImageExpression z )

Returns a pixel in the given real image at the position [x,y,z]. Performs bounds checking.  

RealImage IntegerImage( String title, Number bytes, Boolean isSigned, Number d0, Number d1, Number d2 )

Creates a 3D integer image of size [d0,d1,d2] with the given title. The bytes can be 1, 2, or 4 and isSigned can be 1 (true) or 0 (false).  

RealImage IntegerImage( String title, Number bytes, Boolean isSigned, Number d0, Number d1 )

Creates a 2D integer image of size [d0,d1] with the given title. The bytes and isSigned parameters specify integer specific attributes of the data. Size is the size in bytes, isSigned 1 (true) if the data is to be signed (0 for unsigned), width the width in pixels, and height the height in pixels. Example.  

RealImage IntegerImage( String title, Number bytes, Boolean isSigned, Number d0 )

Creates a 1D integer image of size [d0] with the given title. The bytes and isSigned parameters specify integer specific attributes of the data.  

RealImage LUDecomposition( RealImage a, RealImage b )

Return the image resulting from a LU decomposition on images a,b.  

RealImage MatrixInverse( RealImage a )

Return the matrix inverse image of matrix image a.  
RealImage MatrixMultiply( RealImage a, RealImage b )
Return the matrix product image of matrix images a and b.  

RealImage MatrixTranspose( RealImage a )

Return the matrix transpose image of matrix image a.  

RealImage MedianFilter( Image source, Number filterType, Number size )

Performs a median filter on the source image according to the filterType parameter (0=horizontal, 1=vertical, 2=cross, 3=entire) and the size parameter. Size specifies size in each direction - so a 'size' of 2 is a 5x5 window.  
MPClose Command of script-access to binary image processing  

RealImage MPClose( RealImage image, Number neighbors )

Morphologically close the image using the neighbors parameter to control the closing and return the resulting image. The source image must be binary.  
MPDilate Command of script-access to binary image processing  
RealImage MPDilate( RealImage image, Number neighbors ) Morphologically dilate the image using the neighbors parameter to control the dilation and return the resulting image. The source image must be binary.  
MPDistanceMap Command of script-access to binary image processing  
RealImage MPDistanceMap( Image image ) Generate a distance map from the source image and return the resulting real image. The source image must be binary.  
MPErode Command of script-access to binary image processing  
RealImage MPErode( RealImage image, Number neighbors ) Morphologically erode the image using the neighbors parameter to control the erosion and return the resulting image. The source image must be binary.  
MPEuclideanDistanceMap Command of script-access to binary image processing  
RealImage MPEuclideanDistanceMap( Image image ) Generate a Euclidean distance map from the source image and return the resulting real image. The source image must be binary.  
MPOpen Command of script-access to binary image processing  

RealImage MPOpen( RealImage image, Number neighbors )

Morphologically open the image using the neighbors parameter to control the opening and return the resulting image. The source image must be binary.  
MPOutline Command of script-access to binary image processing
 
RealImage MPOutline( RealImage image ) Morphologically outline the image and return the resulting image. The source image must be binary.  

RealImageExpression NoClipIndex( RealImage, RealImageExpression x, RealImageExpression y, RealImageExpression z )

Returns a pixel in the given real image at the position [x,y,z]. Does not perform bounds checking. This is slightly faster than Index().  
RealImageExpression NoClipIndex( RealImage, RealImageExpression x, RealImageExpression y ) Returns a pixel in the given real image at the position [x,y]. Does not perform bounds checking. This is slightly faster than Index().  

RGBImageExpression NoClipIndex( RGBImage, RealImageExpression x, RealImageExpression y )

Returns a pixel in the given RGB image at the position [x,y]. Does not perform bounds checking. This is slightly faster than Index().  

RGBImageExpression NoClipIndex( RGBImage, RealImageExpression x, RealImageExpression y, RealImageExpression z )

Returns a pixel in the given RGB image at the position [x,y,z]. Does not perform bounds checking. This is slightly faster than Index().  

RealImageExpression Offset( RealImage, Number dh, Number dv )

Returns the pixel with the offset specified by [dh,dv] from the current evaluation position within the image.  
RealImageExpression Offset( RealSubArea, Number dh, Number dv ) Returns the pixel with the offset specified by [dh,dv] from the current evaluation position within the image subarea.  

RealImage PackedIFFT( ComplexImage source )

Creates a new real image from the inverse FFT of the packed complex image source.  

RealImage RasterizeRGB( RGBImage source, Boolean dither )

Rasterize the source RGB image and return the resulting Raster image displayed image with an appropriate color table. The dither parameter controls dithering.  

RealImage RealIFFT( ComplexImage source )

Creates a new real image from the inverse FFT of the complex 8-byte image source.  
RealImage RealImage( String title, Number bytes, Number d0, Number d1, Number d2 ) Creates a 3D real image of size [d0,d1,d2] with the given title. The bytes parameter can be 4 or 8 for single and double precision floating point numbers.  
RealImage RealImage( String title, Number bytes, Number d0, Number d1 ) Creates a 2D real image of size [d0,d1] with the given title. The bytes parameter can be 4 or 8 for single and double precision floating point numbers.  
RealImage RealImage( String title, Number bytes, Number d0 ) Creates a 1D real image of size [d0] with the given title. The bytes parameter can be 4 or 8 for single and double precision floating point numbers. Example

RealImage Rotate( Image source, Number radians )

Creates a new real image by rotating the source image counterclockwise by radians.  

RealImage slice1( RealImage, Number x, Number y, Number z, Number d0, Number l0, Number s0 )

Returns the subslice [(x,y,z),(d0,l0,s0)].  

RealImage slice2( RealImage, Number x, Number y, Number z, Number d0, Number l0, Number s0, Number d1, Number l1, Number s1 )

Returns the subslice [(x,y,z),(d0,l0,s0),(d1,l1,s1)]. Example

RealImage slice3(RealImage, Number x, Number y, Number z, Number d0, Number l0, Number s0, Number d1, Number l1, Number s1, Number d2, Number l2, Number s2)

Returns the subslice [(x,y,z),(d0,l0,s0),(d1,l1,s1),(d2,l2,s2)].  
BasicImage slice1( BasicImage, Number x, Number y, Number z, Number d0, Number l0, Number s0 ) Returns the subslice [(x,y,z),(d0,l0,s0)].  

RealImage SVDecomposition( RealImage a, RealImage b )

Return the image resulting from a SV decomposition on images a,b.  

RealImage SVDFit( RealImage a, RealImage b, Number tolerance )

Return the image resulting from a SVD fit on images a,b with the given tolerance.  

RealImageExpression TimeBar( String title, RealImageExpression expression )

Displays a timebar with the given title during evaluation of the expression. Return the expression directly.  

RealImageExpression Warp( RealImage source, RealImageExpression x, RealImageExpression y )

Returns the bilinear interpolated value at the position [x,y] within the source image.  

RealImage [( RealImage, Number x, Number y )

Returns a pixel in the given real image at the position [x,y]. This operator is equivalent to Index(image,x,y).  
RealImage [( RealImage, Number x, Number y, Number z ) Returns a pixel in the given real image at the position [x,y,z]. This operator is equivalent to Index(image,x,y,z).  
RealImage [( RealImage, Number top, Number left, Number bottom, Number right ) Returns the sub-area image specified by the coordinates [top,left,bottom,right].  
RealImage [( RealImage, Number y1, Number x1, Number z1, Number y2, Number x2, Number z2 ) Returns the sub-area image specified by the coordinates [x,y] where x and y are 3-D positions.  
RealImageExpression [( RealImage image, RealImageExpression x, RealImageExpression y )    
RealImageExpression [( RealImage image, RealImageExpression x, RealImageExpression y, RealImageExpression z )    
"realsubarea" A basic types of variable. Some comments  

RealSubArea [( RealImage, Number y1, Number x1, Number z1, Number y2, Number x2, Number z2 )

Returns the sub-area image specified by the coordinates [x,y] where x and y are 3-D positions.  
RealSubArea [( RealImage, Number top, Number left, Number bottom, Number right ) Returns the sub-area image specified by the coordinates [top,left,bottom,right].  
RealSubArea [( RealImage, Number x, Number y, Number z ) Returns a pixel in the given real image at the position [x,y,z]. This operator is equivalent to Index(image,x,y,z).  
RealSubArea [( RealImage, Number x, Number y ) Returns a pixel in the given real image at the position [x,y]. This operator is equivalent to Index(image,x,y).  
RGBImage [( RGBImage )    

RGBImage [( RGBImage, Number x, Number y )

Returns a RGB pixel in the given RGB image at the position [x,y]. This operator is equivalent to Index(image,x,y).  

RGBImageExpression =( lvalue PredefinedRGBImage dst, RGBImageExpression src )

Assign src to dst, pixel by pixel.  

RGBImage [( RGBImage, Number top, Number left, Number bottom, Number right )

Returns the RGB sub-area image specified by the coordinates [top,left,bottom,right].  
RGBImage [( RGBImage, Number y1, Number x1, Number z1, Number y2, Number x2, Number z2 ) Returns the RGB sub-area image specified by the coordinates [x,y] where x and y are 3-D positions.  
RGBImageExpression [( RGBImage, RealImageExpression x, RealImageExpression y )    
RGBImageExpression [( RGBImage image, RealImageExpression x, RealImageExpression y, RealImageExpression z )    

RGBImage CreateImageFromDisplay( Image )

Convert the display of image to an RGB image.  

RGBImage CreateRGBImage( String title, Number width, Number height )

Creates a 2D RGB image of size [width,height] with the given title.  

RGBImage CreateRGBImageFromPicture( Number picture )

Create an RGB image by drawing into it with a picture  

RGBImageExpression FourPointAverage( RGBImage source )

Returns an image expression that evaluates to half the size of the source expression. Each point in the return image expression is the average of the four corresponding points in the source expression.  

RGBImage GetCLUT( Image )

Return the image's CLUT as a 256x1 RGB image.  

RGBImage GetDisplayAsImage( Image )

Convert the display of image to an RGB image.  

RGBImageExpression Index( RGBImage, RealImageExpression x, RealImageExpression y )

Returns a pixel in the given RGB image at the position [x,y]. Performs bounds checking.  

RGBImageExpression Index( RGBImage, RealImageExpression x, RealImageExpression y, RealImageExpression z )

Returns a pixel in the given RGB image at the position [x,y,z]. Performs bounds checking.  

RGBImage MatrixTranspose( RGBImage a )

Return the matrix transpose image of matrix image a.  

RGBImageExpression Offset( RGBImage, Number deltax, Number deltay )

Returns the pixel with the offset specified by [dh,dv] from the current evaluation position within the image.  
RGBImageExpression Offset( RGBSubArea, Number dh, Number dv ) Returns the pixel with the offset specified by [dh,dv] from the current evaluation position within the image sub-area.  

RGBImageExpression TimeBar( String title, RGBImageExpression expression )

Displays a timebar with the given title during evaluation of the expression. Return the expression directly.  

RGBImageExpression Warp( RGBImage source, RealImageExpression sourceX, RealImageExpression sourceY )

Returns the bilinear interpolated value at the position [x,y] within the source image.  
RGBImageExpression =( lvalue RGBImageVariable, RGBImageExpression )    
RGBImageExpression =( lvalue RGBImageExpression, RGBImageExpression )    

RGBImage ConvertBiGi( BasicImage bi )

   
RGBImageExpression ConvertBiGie( BasicImage )    
RGBImageExpression ConvertBiGieLValue( BasicImage )    
RGBImage ConvertGieGi( RGBImageExpression )    

RGBImageExpression ConvertGiGie( RGBImage )

   
RGBImageExpression ConvertGiGieLValue( RGBImage )    
RGBImageExpression ConvertGneGie( RGBNumberExpression )    
RGBImageExpression ConvertRieGie( RealImageExpression )    

RGBImageExpression EvaluateXneEtc_GneFnToXieEtc_GieFn( RGBNumberExpression, ImageExpression... )

   
RGBImage CreateInlineArray( RGBImage, RGBNumber... )    
"rgbnumber" A basic types of variable. Some comments  

RGBNumberExpression *( RGBNumberExpression, RGBNumberExpression )

Return the product of the two RGB values.  

RGBNumberExpression +( RGBNumberExpression, RGBNumberExpression )

Return the sum of the two RGB values.  
RGBNumberExpression -( RGBNumberExpression, RGBNumberExpression ) Return the difference of the two RGB values.  

RGBNumberExpression -( RGBNumberExpression )

Return the negation of the RGB value. This is the same as RGBA(255,255,255,255)-value.  
RGBNumberExpression /( RGBNumberExpression, RGBNumberExpression ) Return the result of dividing the two RGB values.  

RGBNumberExpression =( lvalue RGBNumberExpression dst, RGBNumberExpression src )

Assign src to dst.  

RGBNumberExpression ?( RealNumberExpression condition, RGBNumberExpression truenumber, RGBNumberExpression falsenumber )

Evaluates the condition expression and returns either the truenumber or falsenumber expression depending on condition.  

RGBNumber GetPixel( RGBImage, Number x, Number y )

Return the pixel in the image at [x,y].  
RGBNumberExpression rgb( RealNumberExpression red, RealNumberExpression green, RealNumberExpression blue ) Creates an RGB number from the individual number components.  
RGBNumberExpression rgba( RealNumberExpression red, RealNumberExpression green, RealNumberExpression blue, RealNumberExpression alpha ) Creates an RGB number from the individual number components, including the alpha channel.  

RGBImage RGBImage( String title, Number bytes, Number d0 )

Creates a 1D RGB image of size [d0] with the given title. The bytes parameter must be 4.  
RGBImage RGBImage( String title, Number bytes, Number d0, Number d1 ) Creates a 2D RGB image of size [d0,d1] with the given title. The bytes parameter must be 4.  
RGBImage RGBImage( String title, Number bytes, Number d0, Number d1, Number d2 ) Creates a 3D RGB image of size [d0,d1,d2] with the given title. The bytes parameter must be 4.  

RGBNumberExpression tert( RealNumberExpression condition, RGBNumberExpression truenumber, RGBNumberExpression falsenumber )

Evaluates the condition expression and returns either the truenumber or falsenumber expression depending on condition.  
RGBNumber ConvertGneGn( RGBNumberExpression )    
RGBNumberExpression ConvertGnGne( RGBNumber )    
RGBNumberExpression ConvertGnGneLValue( RGBNumber )    
RGBNumberExpression ConvertRneGne( RealNumberExpression )    

RGBImage slice1( RGBImage, Number x, Number y, Number z, Number d0, Number l0, Number s0 )

Returns the subslice [(x,y,z),(d0,l0,s0)].  

RGBImage slice2( RGBImage, Number x, Number y, Number z, Number d0, Number l0, Number s0, Number d1, Number l1, Number s1 )

Returns the subslice [(x,y,z),(d0,l0,s0),(d1,l1,s1)]. Example

RGBImage slice3( RGBImage, Number x, Number y, Number z, Number d0, Number l0, Number s0, Number d1, Number l1, Number s1, Number d2, Number l2, Number s2 )

Returns the subslice [(x,y,z),(d0,l0,s0),(d1,l1,s1),(d2,l2,s2)].  
"rgbsubarea" A basic types of variable. Some comments  

RGBSubArea [( RGBImage, Number x, Number y )

Returns a RGB pixel in the given RGB image at the position [x,y]. This operator is equivalent to Index(image,x,y).  
RGBSubArea [( RGBImage, Number y1, Number x1, Number z1, Number y2, Number x2, Number z2 ) Returns the RGB sub-area image specified by the coordinates [x,y] where x and y are 3-D positions.  
RGBSubArea [( RGBImage, Number top, Number left, Number bottom, Number right ) Returns the RGB sub-area image specified by the coordinates [top,left,bottom,right].  
     
     
     
     
"scientific" notation "Scientific" notation is allowed in DM scripts. E.g. 6.8e-7,  -3e11, and .23E+6.  
shape.ClassName( ) Print out the name of the shape class Example
shape.ParentClassName( ) Print out the name of the parent class of the shape class Example

Boolean SpaceDown( void )

Returns 1 if the space key is down and 0 otherwise.  
"stream" Place pointers at any position of the text file, and automatically close the file if the stream runs ‘out of scope’.  

ScriptObject NewStreamFromFileReference( Number file_ref, Boolean do_close )

Creates a new stream object from the file reference. On destruction, closes the file reference if 'do_close' is true. Example

Number StreamGetSize( ScriptObject stream )

Reads the size of the file. Example

void StreamSetPos( ScriptObject stream, Number base, Number offset )

Sets the current position within the file as an offset from 'base', where base == 0 denotes beginning of file, 1 denotes current position, and 2 denotes end of file (The second
parameter gives an offset (in bytes) to the reference point defined by the first parameter).
Example

void StreamWriteAsText( ScriptObject stream, Number encoding, String data )

Write the string to the file with the specified encoding. Example

void StreamSetSize( ScriptObject stream, Number size )

Sets the size of the file.  

void WriteRawStream( Number rawStream, Number data, Number length )

Write length bytes from the memory pointed to by data to rawStream.  

void GetRawStreamPos( Number rawStream, NumberVariable pos )

Store the current position in rawStream into the pos variable.  

void GetRawStreamSize( Number rawStream, NumberVariable size )

Store the length of rawStream into the size variable.  

void ReadRawStream( Number rawStream, Number data, Number length )

Read length bytes from rawStream and store it into the memory pointed to by data.  

void SetRawStreamPos( Number rawStream, Number mode, Number offset )

Set the current position in rawStream to offset using the mode.  

void ImageReadImageDataFromStream( ImageReference image, ScriptObject stream, Number stream_endianness )

Reads image data from the stream. The image data type determines how the data is read, and 'stream_endianness' specifies the endianness of the stream, 1 == bigendian, 2 == littleendian.  

void ImageWriteImageDataToStream( ImageReference image, ScriptObject stream, Number stream_endianness )

Writes image data to the stream. The image data type determines how the data is written, and 'stream_endianness' specifies the endianness of the stream, 1 == bigendian, 2 == littleendian.  

ScriptObject NewStreamFromBuffer( Number initial_size )

Creates a new stream object from from a memory buffer with initial size 'initial_size'.  

Number StreamGetPos( ScriptObject stream )

Returns the current position within the file.  

String StreamReadAsText( ScriptObject stream, Number encoding, Number count )

Reads count bytes from a file, returning them as a string assuming they have the specified encoding. Example

Boolean StreamReadTextLine( ScriptObject stream, Number encoding, String str_out )

Read a line of text from the stream, storing it into the string variable, assuming the text has the specified encoding. Return 1 if successful and 0 otherwise.  
Number sqrt( Number v1 )    

"string constants"

Is zero or more characters surrounded by double quotes. E.g. "9" and "My name is ".  
String STR3 Define a variable (a string here: the name of variable needs to start with a letter) Example

String =( String dst, ! )

Assigns NULL to dst string.  

String StringNullify( ! )

Assigns NULL to dst string.  

String GetApplicationDirectory( Number index, Boolean create_if_necessary )

Return one of the application directories. 0=current directory, 1=executable directory. Example1
Example2

String ReadFile( Number file, Number count )

Read count bytes from the file, returning them as a string. Example

String ReadFile( Number file, Number encoding, Number count )

Reads count bytes from a file, returning them as a string assuming they have the specified encoding.  

String BaseN( Number n, Number base, Number length )

Returns the number as a base n string of the given length.  
String BaseN( Number n, Number base ) Returns the number as a base n string.  

String Binary( Number n )

Returns the number as a binary string.  
String Binary( Number n, Number length ) Returns the number as a binary string of the given length.  

String chr( Number n )

Returns the ASCII character specified by n as a string.  

String ComponentGetFontFaceName( Component comp )

Gets the face name of the component's font.  

String ConvertEndOfLine( Number eol_format, String str )

Converts the string to the end-of-line format indicated by 'eol_format_index': 0 == platform format, 1 = Macintosh format, 2 = Windows format.  

String ConvertUnicodeCharToMultibyteString( Number uch, Number encoding )

Converts the unicode character 'uch' to a multibyte string in the encoding specified by 'encoding'.  

String DateStamp( void )

Return a string representing the current date and time. Example
String Decimal( Number n, Number length ) Returns the number as a decimal string of the given length.  
String Decimal( Number n ) Returns the number as a decimal string.  

String EditorWindowGetText( DocumentWindow window, Number encoding )

Gets the text in an editor window.  

String format( Number, String formatString )

Convert the number to a string using the printf-style real format specified by formatString.  

String FunctionGenerateStub( Function func, Boolean include_body, Number version )

Generates a stub function in the format specified by version.  

String GetAnnotationStringNote( Image, Number annotationID, String noteLabel )

Returns the value of the annotation note with the label noteLabel. Returns an empty string if the note does not exist.  

String GetDate( Number dateFormat )

Return a string representing the current date in the date format indicated by dateFormat. The dateFormat parameter can be 0=short, 1=long, 2=abbreviated.  

String GetExceptionString( void )

Return the message that would be displayed in the error dialog box for an exception as a string.  

String GetExceptionDescription( )

Return the message that would be displayed in the error dialog box for an exception as a string.  

String GetLabel( Image )

Return the image label of the image.  

String GetName( Image )

Return the name of the image's image document.  

String GetNthPersistentNoteTitle( String tagPath, Number index )

Returns the title of the tag with the given index from the persistent tag group indicated by tagPath.  
     

String GetPersistentStringNote( String noteLabel )

Returns the value of the persistent note with the label noteLabel. Returns an empty string if the note does not exist.  

String GetSpecialDirectory( Number index )

Return one of the special directories. 0=current directory, 1=executable directory.  

String GetStringFromList( Image, String tagPath, Number index )

Returns the string with the given index from the image tag list indicated by tagPath.  
String GetStringFromPersistentList( String tagPath, Number index ) Returns the string with the given index from the persistent tag list indicated by tagPath.  

String GetStringNote( Image, String noteLabel )

Returns the value of the image note with the label noteLabel. Returns an empty string if the note does not exist.  

String GetTime( Boolean wantSeconds )

Return a string representing the current time with or without seconds as indicated by the wantSeconds parameter.  

String Hex( Number n, Number length )

Returns the number as a hexidecimal string of the given length.  

String Hex( Number n )

Returns the number as a hexidecimal string.  

String mid( String, Number offset, Number count )

Returns count characters of a string starting at offset.  

String Octal( Number n )

Returns the number as an octal string.  
String Octal( Number n, Number length ) Returns the number the number as an octal string of the given length.  

 

   

String ImageGetDescriptionText( ImageReference img )

Gets the description text associated with the image.  

String ImageGetDimensionUnitString( ImageReference, Number dimension )

Copies the unit string of the given dimension of image to the buffer.  

String ImageGetLabel( ImageReference img )

Gets the label of the image as used in scripts.  

String ImageGetName( ImageReference img )

Gets the name of the image. Example

String PathAddParentIndirection( String path )

Returns 'path' appended with a string denoting indirection to the parent directory  
String PathBeginRelative( void ) Returns a string that begins a relative path  
String PathConcatenate( String initial_path, String final_path ) Concatenates 'final_path' to 'initial_path' to create a new path, adding separators as necessary.  
String PathGetFullpath( String path ) Returns the full path name of the file denoted by 'path'  

String PathExtractBaseName( String path, Number path_type )

Returns the base name portion of 'dir_path', where 'path_type' denotes '1' for Mac paths, '2' for Windows paths, and '0' for current OS paths  

String right( String, Number count )

Returns rightmost count characters of a string.  

String ScriptToUserCoordinates( Image, Number x, Number y )

Return a string representing the script coordinates.  

String TextAnnotationGetText( Component comp, Number encoding )

Gets the text of a text annotation.  
String TextAnnotationGetText( Component comp ) Gets the text of a text annotation.  

String +=( String s1, String s2 )

Appends string s2 to s1, converting its encoding to that of s1 if necessary.  

String =( String dst, String src )

Assigns src string to dst string.  

String PathExtractDirectory( String path, Number path_type )

Returns the directory portion of 'dir_path', where 'path_type' denotes '1' for Mac paths, '2' for Windows paths, and '0' for current OS paths  

String PathExtractExtension( String path, Number path_type )

Returns the extension portion of 'dir_path', where 'path_type' denotes '1' for Mac paths, '2' for Windows paths, and '0' for current OS paths  

String PathExtractFileName( String path, Number path_type )

Returns the file name portion of 'dir_path', where 'path_type' denotes '1' for Mac paths, '2' for Windows paths, and '0' for current OS paths  

String PathExtractParentDirectory( String path, Number path_type )

Returns the parent directory portion of 'dir_path', where 'path_type' denotes '1' for Mac paths, '2' for Windows paths, and '0' for current OS paths  

String ROIGetLabel( ROI roi )

Return the label of the region of interest.  

String ROIGetName( ROI roi )

Return the name of the region of interest.  

String StringAppend( String s1, String s2 )

Appends string s2 to s1, converting its encoding to that of s1 if necessary.  
String StringAppend( String s1, Number ch, Number encoding_id ) Appends character ch to s1, converting its encoding to that of s1 if necessary.  

String StringConvertToEncoding( String s1, Number encoding_id )

Converts 's1' to the encoding specified by 'encoding_id'.  

String WindowGetTitle( DocumentWindow window )

Gets the title of the window.  
"subarea" A basic types of variable. Some comments  
Sum(Image) Calculate the sum of an image  
TagGroup =( TagGroup tagGroup1, ! )    
TagGroup =( TagGroup tagGroup1, TagGroup tagGroup2 )    

TagGroup ComponentGetTagGroup( Component annot)

Gets the tag group associated with the annotation.  

TagGroup TagGroupAddTagGroupAtBeginning( TagGroup tagList, TagGroup newGroup )

Adds 'newGroup' to the beginning of 'tagList'.  

TagGroup TagGroupAddLabeledTagGroup(TagGroup tagGroup, String label, TagGroup newGroup)

Adds 'newGroup' to 'tagGroup' at the label 'label'.  

TagGroup GetPersistentTagGroup(void )

Gets the persistent tag group.  

TagGroup GetPackageTags(String identifier)

Return the tags specified by identifier. The identifier is used to identify tags loaded with a specific package.  

TagGroup GetFilesInDirectory(String path, Number search_flags)

Returns a tag group containing a list of the file names in the directory 'dir_path'  

TagGroup ImageDocumentGetTagGroup(ImageDocument imgDoc)

Gets the tag group associated with the image document.  

TagGroup ImageGetTagGroup(ImageReference img)

Gets the tags associated with the image: Example.  

TagGroup NewTagGroup(void )

Creates an empty tag group.  

TagGroup NewTagList( void )

Creates an empty tag list.  
TagGroup ReinterpretLongAsTagGroup(Number l)    
TagGroup ReinterpretLongAsTagGroupPtr(Number l)    
TagGroup TagGroupNullify( ! )    

TagGroup TagGroupAddTagGroupAfter(TagGroup tagList, Number ref_index, TagGroup newGroup)

Adds 'newGroup' to 'tagList' after index 'ref_index'.  

TagGroup TagGroupAddTagGroupBefore(TagGroup tagList, Number ref_index, TagGroup newGroup)

Adds 'newGroup' to 'tagList' before index 'ref_index'.  

TagGroup TagGroupAddTagGroupAtEnd( TagGroup tagList, TagGroup newGroup )

Adds 'newGroup' to the end of 'tagList'.  

TagGroup TagGroupClone(TagGroup tagGroup)

Returns an identical copy of 'tagGroup' and its sub-tags.  

void TagGroupCopyTagToIndex( TagGroup tagGroup, Number dstIndex, TagGroup srcGroup, Number srcIndex )

Copies data in the 'srcIndex'th tag in 'srcGroup' to the 'dstIndex'th tag in 'tagGroup'.  

TagGroup TagGroupCreateGroupTagAfter( TagGroup tagList, Number ref_index )

Creates a new tag group after 'ref_index' in 'tagList'.  

TagGroup TagGroupCreateGroupTagAtBeginning( TagGroup tagList )

Creates a new tag group at the beginning of 'tagList'.  

TagGroup TagGroupCreateGroupTagAtEnd( TagGroup tagList )

Creates a new tag group at the end of 'tagList'.  

TagGroup TagGroupCreateGroupTagBefore( TagGroup tagList, Number ref_index )

Creates a new tag group before 'ref_index' in 'tagList'.  

TagGroup TagGroupCreateListTagAfter( TagGroup tagList, Number ref_index )

Creates a new tag group after 'ref_index' in 'tagList'.  

TagGroup TagGroupCreateListTagAtBeginning( TagGroup tagList)

Creates a new tag group at the beginning of 'tagList'.  

TagGroup TagGroupCreateListTagAtEnd( TagGroup tagList )

Creates a new tag group at the end of 'tagList'.  

TagGroup TagGroupCreateListTagBefore( TagGroup tagList, Number ref_index )

Creates a new tag group before 'ref_index' in 'tagList'.  

TagGroup TagGroupCreateNewLabeledGroup( TagGroup tagGroup, String label )

Adds a new tag group at label 'label' and returns the new group.  

TagGroup TagGroupCreateNewLabeledList( TagGroup tagGroup, String label )

Adds a new tag list at label 'label' and returns the new group.  

TagGroup TagGroupGetOrCreateTagGroup(TagGroup tagGroup, String tagPath)

Gets the tag group named by 'tagPath', or creates a new such group and all necessary intermediate groups.  

TagGroup TagGroupGetOrCreateTagList(TagGroup tagGroup, String tagPath)

Gets the tag list named by 'tagPath', or creates a new such list and all necessary intermediate groups.  
TagGroup Test_ReferenceCount_V1( ROI roi_out )    
TagGroup Test_ReferenceCount_V2( ROI roi_out )    

Boolean ClipboardGetAsTagGroup( TagGroup tagGroup)

Gets the contents of the clipboard as a tag group, if possible, and returns true if successful.  

Boolean SaveAsDialog( String prompt, String defaultName, String saveName )

Puts up the SaveAs dialog with the given prompt and default file name, and then stores the chosen path for the saved file into the saveName variable. Returns 1 for OK and 0 for Cancel. Example

Boolean TagGroupDoesTagExist(TagGroup tagGroup, String tagPath)

Finds the tag group and index corresponding to the tag referenced by 'tagPath' in 'tagGroup'.  

Boolean TagGroupGetIndexedTagAsArray(TagGroup tagGroup, Number index, ImageReference image)

Gets the data at 'index' in 'tagGroup' as an array of data in 'image'.  

Boolean TagGroupGetIndexedTagAsBoolean(TagGroup tagGroup, Number index, NumberVariable val)

Gets the data at 'index' in 'tagGroup' as a boolean.  

Boolean TagGroupGetIndexedTagAsDouble(TagGroup tagGroup, Number index, NumberVariable number)

Gets the data at 'index' in 'tagGroup' as a double.  

Boolean TagGroupGetIndexedTagAsDoubleComplex(TagGroup tagGroup, Number index, ComplexNumberVariable c)

Gets the data at 'index' in 'tagGroup' as a double complex.  

Boolean TagGroupGetIndexedTagAsEightBitColor(TagGroup tagGroup, Number index, RGBNumberVariable c)

Gets the data at 'index' in 'tagGroup' as an eight bit color.  

Boolean TagGroupGetIndexedTagAsFloat(TagGroup tagGroup, Number index, NumberVariable number)

Gets the data at 'index' in 'tagGroup' as a float.  

Boolean TagGroupGetIndexedTagAsFloatComplex(TagGroup tagGroup, Number index, ComplexNumberVariable c)

Gets the data at 'index' in 'tagGroup' as a float complex.  

Boolean TagGroupGetIndexedTagAsFloatPoint(TagGroup tagGroup, Number index, NumberVariable x, NumberVariable y)

Gets the data at 'index' in 'tagGroup' as a float point.  

Boolean TagGroupGetIndexedTagAsFloatRect(TagGroup tagGroup, Number index, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r)

Gets the data at 'index' in 'tagGroup' as a float rect.  

Boolean TagGroupGetIndexedTagAsLong(TagGroup tagGroup, Number index, NumberVariable number)

Gets the data at 'index' in 'tagGroup' as a long.  

Boolean TagGroupGetIndexedTagAsLongPoint(TagGroup tagGroup, Number index, NumberVariable x, NumberVariable y)

Gets the data at 'index' in 'tagGroup' as a long point.  

Boolean TagGroupGetIndexedTagAsLongRect(TagGroup tagGroup, Number index, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r)

Gets the data at 'index' in 'tagGroup' as a long rect.  

Boolean TagGroupGetIndexedTagAsNumber(TagGroup tagGroup, Number index, NumberVariable number)

Gets the data at 'index' in 'tagGroup' as a real number.  

Boolean TagGroupGetIndexedTagAsNumber(TagGroup tagGroup, Number index, ComplexNumberVariable number)

Gets the data at 'index' in 'tagGroup' as a complex number.  

Boolean TagGroupGetIndexedTagAsNumber(TagGroup tagGroup, Number index, RGBNumberVariable number)

Gets the data at 'index' in 'tagGroup' as a RGB number.  

Boolean TagGroupGetIndexedTagAsShort(TagGroup tagGroup, Number index, NumberVariable number)

Gets the data at 'index' in 'tagGroup' as a short.  

Boolean TagGroupGetIndexedTagAsShortPoint(TagGroup tagGroup, Number index, NumberVariable x, NumberVariable y)

Gets the data at 'index' in 'tagGroup' as a short point.  

Boolean TagGroupGetIndexedTagAsShortRect(TagGroup tagGroup, Number index, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r)

Gets the data at 'index' in 'tagGroup' as a short rect.  

Boolean TagGroupGetIndexedTagAsString(TagGroup tagGroup, Number index, String str)

Gets the data at 'index' in 'tagGroup' as a string.  

Boolean TagGroupGetIndexedTagAsTagGroup(TagGroup tagGroup, Number index, TagGroup subGroup)

Gets the data at 'index' in 'TagGroup' as a group.  

Boolean TagGroupGetIndexedTagAsText(TagGroup tagGroup, Number index, String str)

Gets the data at 'index' in 'tagGroup' as a string.  

Boolean TagGroupGetIndexedTagAsUInt16(TagGroup tagGroup, Number index, NumberVariable number)

Gets the data at 'index' in 'tagGroup' as a 16-bit unsigned integer.  

Boolean TagGroupGetIndexedTagAsUInt32(TagGroup tagGroup, Number index, NumberVariable number)

Gets the data at 'index' in 'tagGroup' as a 32-bit unsigned integer.  

Boolean TagGroupGetTagAsArray( TagGroup tagGroup, String tagPath, ImageReference image )

Gets the data at 'tagPath' in 'tagGroup' as an array of data in 'image'.  

Boolean TagGroupGetTagAsBoolean( TagGroup tagGroup, String tagPath, NumberVariable val )

Gets the data at 'tagPath' in 'tagGroup' as a boolean.  

Boolean TagGroupGetTagAsDouble( TagGroup tagGroup, String tagPath, NumberVariable number )

Gets the data at 'tagPath' in 'tagGroup' as a double.  

Boolean TagGroupGetTagAsDoubleComplex( TagGroup tagGroup, String tagPath, ComplexNumberVariable c )

Gets the data at 'tagPath' in 'tagGroup' as a double complex.  

Boolean TagGroupGetTagAsEightBitColor( TagGroup tagGroup, String tagPath, RGBNumberVariable c )

Gets the data at 'tagPath' in 'tagGroup' as an eight bit color.  

Boolean TagGroupGetTagAsFloat( TagGroup tagGroup, String tagPath, NumberVariable number )

Gets the data at 'tagPath' in 'tagGroup' as a float.  

Boolean TagGroupGetTagAsFloatComplex( TagGroup tagGroup, String tagPath, ComplexNumberVariable c )

Gets the data at 'tagPath' in 'tagGroup' as a float complex.  

Boolean TagGroupGetTagAsFloatPoint( TagGroup tagGroup, String tagPath, NumberVariable x, NumberVariable y )

Gets the data at 'tagPath' in 'tagGroup' as a short point.  

Boolean TagGroupGetTagAsFloatRect( TagGroup tagGroup, String tagPath, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r )

Gets the data at 'tagPath' in 'tagGroup' as a short rect.  

Boolean TagGroupGetTagAsLong( TagGroup tagGroup, String tagPath, NumberVariable number )

Gets the data at 'tagPath' in 'tagGroup' as a long.  

Boolean TagGroupGetTagAsLongPoint( TagGroup tagGroup, String tagPath, NumberVariable x, NumberVariable y )

Gets the data at 'tagPath' in 'tagGroup' as a long point.  

Boolean TagGroupGetTagAsLongRect( TagGroup tagGroup, String tagPath, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r )

Gets the data at 'tagPath' in 'tagGroup' as a long rect.  

Boolean TagGroupGetTagAsNumber( TagGroup tagGroup, String tagPath, NumberVariable number )

Gets the data at 'tagPath' in 'tagGroup' as a real number.  

Boolean TagGroupGetTagAsNumber( TagGroup tagGroup, String tagPath, RGBNumberVariable number )

Gets the data at 'tagPath' in 'tagGroup' as a rgb number.  

Boolean TagGroupGetTagAsRGBUInt16( TagGroup tagGroup, Number index, NumberVariable r, NumberVariable g, NumberVariable b )

Gets the data at 'index' in 'tagGroup' as a 16-bit rgb value.  

Boolean TagGroupGetTagAsRGBUInt16( TagGroup tagGroup, String tagPath, NumberVariable r, NumberVariable g, NumberVariable b )

Gets the data at 'tagPath' in 'tagGroup' as a 16-bit rgb value.  

Boolean TagGroupGetTagAsShort( TagGroup tagGroup, String tagPath, NumberVariable number )

Gets the data at 'tagPath' in 'tagGroup' as a short.  

Boolean TagGroupGetTagAsShortPoint( TagGroup tagGroup, String tagPath, NumberVariable x, NumberVariable y )

Gets the data at 'tagPath' in 'tagGroup' as a short point.  

Boolean TagGroupGetTagAsShortRect( TagGroup tagGroup, String tagPath, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r )

Gets the data at 'tagPath' in 'tagGroup' as a short rect.  

Boolean TagGroupGetTagAsString( TagGroup tagGroup, String tagPath, String str )

Gets the data at 'tagPath' in 'tagGroup' as a string.  

Boolean TagGroupGetTagAsTagGroup( TagGroup tagGroup, String tagPath, TagGroup subGroup )

Gets the data at 'tagPath' in 'TagGroup' as a group.  

Boolean TagGroupGetTagAsText( TagGroup tagGroup, String tagPath, String str )

Gets the data at 'tagPath' in 'tagGroup' as a string.  

Boolean TagGroupGetTagAsUInt16( TagGroup tagGroup, String tagPath, NumberVariable number )

Gets the data at 'tagPath' in 'tagGroup' as a 16-bit unsigned integer.  

Boolean TagGroupGetTagAsUInt32( TagGroup tagGroup, String tagPath, NumberVariable number )

Gets the data at 'tagPath' in 'tagGroup' as a 32-bit unsigned integer.  

Boolean TagGroupHasChangedSince( TagGroup tagGroup, Number seeds )

Returns true if the tag group has changed since 'seeds' was constructed.  

Boolean TagGroupIsList( TagGroup tagGroup )

Returns true if the tag group is a list.  

Boolean TagGroupIsOpen( TagGroup tagGroup )

Returns whether 'tagGroup' is open or not.  

Boolean TagGroupIsValid( TagGroup tagGroup )

Returns true if 'tagGroup' references a valid object.  

Boolean TagGroupLoadFromFile( TagGroup tagGroup, String path )

Loads the contents of the file specified by 'path' into the tag group.  

Boolean TagGroupLoadFromFileWithLabel( TagGroup tagGroup, String path, String label )

Loads the contents of the file specified by 'path' into the tag group and returns the label, if any.  

Boolean TagGroupLoadFromStream( TagGroup tagGroup, ScriptObject stream )

Loads the contents of the stream specified by 'stream' into the tag group.  

Boolean TagGroupLoadFromStreamWithLabel( TagGroup tagGroup, ScriptObject stream, String label )

Loads the contents of the stream specified by 'stream' into the tag group and returns the label, if any.  

DocumentWindow TagGroupOpenBrowserWindow( TagGroup tagGroup, Boolean isFileBased )

Opens a browser window for the tag group.  

Number TagGroupGetSeeds(TagGroup tagGroup)

Gets a set of seeds that describe the tag group.  

Number TagGroupCopyTag(TagGroup tagGroup, TagGroup srcGroup, Number srcIndex)

Copies the 'srcIndex'th tag in 'srcGroup' to 'tagGroup'.  

Number TagGroupCountTags( TagGroup tagGroup )

Returns the number of sub-tags in this tag group.  

Number TagGroupCreateNewLabeledTag(TagGroup tagGroup, String label)

Creates a new labeled tag and returns its index.  

Number TagGroupCreateNewTagAfter(TagGroup tagList, Number ref_index)

Creates a new tag after 'ref_index' in 'tagList'.  

Number TagGroupCreateNewTagAtBeginning(TagGroup tagList)

Creates a new tag at the beginning of 'tagList'.  

Number TagGroupCreateNewTagAtEnd(TagGroup tagList)

Creates a new tag at the end of 'tagList'.  

Number TagGroupCreateNewTagBefore(TagGroup tagList, Number ref_index)

Creates a new tag before 'ref_index' in 'tagList'.  

Number TagGroupParseAndCreateTagPath( TagGroup tagGroup, String tagPath, TagGroup parentGroup, String label )

Finds the tag group and index corresponding to the tag referenced by 'tagPath' in 'tagGroup'.  

Number TagGroupParseTagPath( TagGroup tagGroup, String tagPath, TagGroup parentGroup, String label )

Finds the tag group and index corresponding to the tag referenced by 'tagPath' in 'tagGroup'.  
Number ReinterpretTagGroupAsLong(TagGroup tg)    

Number TagGroupGetTagSize( TagGroup tagGroup, Number index )

Gets the size of the tag.  

Number TagGroupGetTagType( TagGroup tagGroup, Number index, Number type_index )

Returns the 'type_index'th element of the tag's type.  

Number TagGroupGetTagTypeLength( TagGroup tagGroup, Number index )

Returns number of elements in the tag's type.  

String TagGroupGetTagLabel( TagGroup tagGroup, Number index )

Gets the label of the 'index'th tag in the tag group.  

void TagGroupInsertTagAsArray( TagGroup tagGroup, Number ref_index, ImageReference image )

Inserts new data before 'ref_index' in 'tagGroup' as an array of data in 'image'.  

void TagGroupInsertTagAsBoolean( TagGroup tagGroup, Number ref_index, Boolean val )

Inserts new data before 'ref_index' in 'tagGroup' as a boolean.  

void TagGroupInsertTagAsDouble( TagGroup tagGroup, Number ref_index, Number number )

Inserts new data before 'ref_index' in 'tagGroup' as a double.  

void TagGroupInsertTagAsDoubleComplex( TagGroup tagGroup, Number ref_index, ComplexNumber c )

Inserts new data before 'ref_index' in 'tagGroup' as a double complex.  

void TagGroupInsertTagAsEightBitColor( TagGroup tagGroup, Number ref_index, RGBNumber c )

Inserts new data before 'ref_index' in 'tagGroup' as an eight bit color.  

void TagGroupInsertTagAsFloat( TagGroup tagGroup, Number ref_index, Number number )

Inserts new data before 'ref_index' in 'tagGroup' as a float.  

void TagGroupInsertTagAsFloatComplex( TagGroup tagGroup, Number ref_index, ComplexNumber c )

Inserts new data before 'ref_index' in 'tagGroup' as a float complex.  

void TagGroupInsertTagAsFloatPoint( TagGroup tagGroup, Number ref_index, Number x, Number y )

Inserts new data before 'ref_index' in 'tagGroup' as a float point.  

void TagGroupInsertTagAsFloatRect( TagGroup tagGroup, Number ref_index, Number t, Number l, Number b, Number r )

Inserts new data before 'ref_index' in 'tagGroup' as a float rect.  

void TagGroupInsertTagAsLong( TagGroup tagGroup, Number ref_index, Number number )

Inserts new data before 'ref_index' in 'tagGroup' as a long.  

void TagGroupInsertTagAsLongPoint( TagGroup tagGroup, Number ref_index, Number x, Number y )

Inserts new data before 'ref_index' in 'tagGroup' as a long point.  

void TagGroupInsertTagAsLongRect( TagGroup tagGroup, Number ref_index, Number t, Number l, Number b, Number r )

Inserts new data before 'ref_index' in 'tagGroup' as a long rect.  

void TagGroupInsertTagAsNumber( TagGroup tagGroup, Number ref_index, RGBNumber number )

Inserts new data before 'ref_index' in 'tagGroup' as a RGB number.  

void TagGroupInsertTagAsNumber( TagGroup tagGroup, Number ref_index, ComplexNumber number )

Inserts new data before 'ref_index' in 'tagGroup' as a complex number.  

void TagGroupInsertTagAsNumber( TagGroup tagGroup, Number ref_index, Number number )

Inserts new data before 'ref_index' in 'tagGroup' as a real number.  

void TagGroupInsertTagAsRGBUInt16( TagGroup tagGroup, Number ref_index, Number r, Number g, Number b )

Inserts new data before 'ref_index' in 'tagGroup' as a 16-bit rgb value.  

void TagGroupInsertTagAsShort( TagGroup tagGroup, Number ref_index, Number number )

Inserts new data before 'ref_index' in 'tagGroup' as a short.  

void TagGroupInsertTagAsShortPoint( TagGroup tagGroup, Number ref_index, Number x, Number y )

Inserts new data before 'ref_index' in 'tagGroup' as a short point.  

void TagGroupInsertTagAsShortRect( TagGroup tagGroup, Number ref_index, Number t, Number l, Number b, Number r )

Inserts new data before 'ref_index' in 'tagGroup' as a short rect.  

void TagGroupInsertTagAsString( TagGroup tagGroup, Number ref_index, String s )

Inserts new data before 'ref_index' in 'tagGroup' as a string.  

void TagGroupInsertTagAsTagGroup( TagGroup tagGroup, Number ref_index, TagGroup subGroup )

Inserts new data before 'ref_index' in 'TagGroup' as a group.  

void TagGroupInsertTagAsText( TagGroup tagGroup, Number ref_index, String s )

Inserts new data before 'ref_index' in 'tagGroup' as a string.  

void TagGroupInsertTagAsUInt16( TagGroup tagGroup, Number ref_index, Number number )

Inserts new data before 'ref_index' in 'tagGroup' as a 16-bit unsigned integer.  

void TagGroupInsertTagAsUInt32( TagGroup tagGroup, Number ref_index, Number number )

Inserts new data before 'ref_index' in 'tagGroup' as a 32-bit unsigned integer.  

void TagGroupMarkAsChanged( TagGroup tagGroup )

Marks 'tagGroup' as having beein modified.  

void TagGroupCopyTagsFrom(TagGroup tagGroup, TagGroup srcGroup)

Copies tags in 'srcGroup' to 'tagGroup'.  

void AddTagsToPackage(TagGroup tags, String packageName, Number packageLevel, String identifier)

Install the tags into the package. The identifier is used to identify the tags in the packages. Clients should take care to use unique identifiers.  

void TagGroupDeleteAllTags(TagGroup tagGroup)

Deletes all the tags in 'tagGroup'.  

void TagGroupDeleteTagWithIndex(TagGroup taGroup, Number index)

Deletes the tag at index 'index'.  

void TagGroupDeleteTagWithLabel(TagGroup tagGroup, String tagPath)

Deletes the tag labelled by the path 'tagPath'.  

void TagGroupExecuteScriptGroup(TagGroup tagGroup, String form)

Execute a group of script functions in 'tagGroup'. The actual scripts executed will be formed by sprintf'ing into the 'form' parameter. The form parameter should contain exactly one '%s' into which the function name will be inserted.  

void TagGroupReadIndexedTagDataFromStream( TagGroup tagGroup, Number index, ScriptObject stream, Number stream_endianness )

Reads data from the stream into the indicated tag. The tag type determines how the data is read, and 'stream_endianness' specifies the endianness of the stream, 1 == bigendian, 2 == littleendian.  

void TagGroupReadTagDataFromStream( TagGroup tagGroup, String tag_path, ScriptObject stream, Number stream_endianness )

Reads data from the stream into the indicated tag. The tag type determines how the data is read, and 'stream_endianness' specifies the endianness of the stream, 1 == bigendian, 2 == littleendian.  

void TagGroupReleaseSeeds( TagGroup tagGroup, Number seeds )

Releases the seeds returned by 'TagGroupGetSeeds'.  

void TagGroupReplaceTagsWithCopy( TagGroup tagGroup, TagGroup srcGroup )

Deletes all tags in 'tagGroup' and copies tags in 'srcGroup' to 'tagGroup'.  

void TagGroupSaveToFile( TagGroup tagGroup, String path )

Saves the contents of the tag group to the file specified by 'path'.  

void TagGroupSaveToFileWithLabel( TagGroup tagGroup, String path, String label )

Saves the contents of the tag group and the label 'label' to the file specified by 'path'.  

void TagGroupSaveToStream( TagGroup tagGroup, ScriptObject stream )

Saves the contents of the tag group to the stream specified by 'stream'.  

void TagGroupSaveToStreamWithLabel( TagGroup tagGroup, ScriptObject stream, String label )

Saves the contents of the tag group and the label 'label' to the stream specified by 'stream'.  

void TagGroupSetIndexedTagAsArray( TagGroup tagGroup, Number index, ImageReference image )

Set the data at 'index' in 'tagGroup' as an array of data in 'image'.  

void TagGroupSetIndexedTagAsBoolean( TagGroup tagGroup, Number index, Boolean val )

Sets the data at 'index' in 'tagGroup' as a boolean.  

void TagGroupSetIndexedTagAsDouble( TagGroup tagGroup, Number index, Number number )

Sets the data at 'index' in 'tagGroup' as a double.  

void TagGroupSetIndexedTagAsDoubleComplex( TagGroup tagGroup, Number index, ComplexNumber c )

Sets the data at 'index' in 'tagGroup' as a double complex.  

void TagGroupSetIndexedTagAsEightBitColor( TagGroup tagGroup, Number index, RGBNumber c )

Sets the data at 'index' in 'tagGroup' as an eight bit color.  

void TagGroupSetIndexedTagAsFloat( TagGroup tagGroup, Number index, Number number )

Sets the data at 'index' in 'tagGroup' as a float.  

void TagGroupSetIndexedTagAsFloatComplex( TagGroup tagGroup, Number index, ComplexNumber c )

Sets the data at 'index' in 'tagGroup' as a float complex.  

void TagGroupSetIndexedTagAsFloatPoint( TagGroup tagGroup, Number index, Number x, Number y )

Sets the data at 'index' in 'tagGroup' as a float point.  

void TagGroupSetIndexedTagAsFloatRect( TagGroup tagGroup, Number index, Number t, Number l, Number b, Number r )

Sets the data at 'index' in 'tagGroup' as a float rect.  

void TagGroupSetIndexedTagAsLong( TagGroup tagGroup, Number index, Number number )

Sets the data at 'index' in 'tagGroup' as a long.  

void TagGroupSetIndexedTagAsLongPoint( TagGroup tagGroup, Number index, Number x, Number y )

Sets the data at 'index' in 'tagGroup' as a long point.  

void TagGroupSetIndexedTagAsLongRect( TagGroup tagGroup, Number index, Number t, Number l, Number b, Number r )

Sets the data at 'index' in 'tagGroup' as a long rect.  

void TagGroupSetIndexedTagAsNumber( TagGroup tagGroup, Number index, RGBNumber number )

Sets the data at 'index' in 'tagGroup' as a RGB number.  

void TagGroupSetIndexedTagAsNumber( TagGroup tagGroup, Number index, ComplexNumber number )

Sets the data at 'index' in 'tagGroup' as a complex number.  

void TagGroupSetIndexedTagAsNumber( TagGroup tagGroup, Number index, Number number )

Sets the data at 'index' in 'tagGroup' as a real number.  

void TagGroupSetIndexedTagAsRGBUInt16( TagGroup tagGroup, Number index, Number r, Number g, Number b )

Sets the data at 'index' in 'tagGroup' as a 16-bit rgb value.  

void TagGroupSetIndexedTagAsShort( TagGroup tagGroup, Number index, Number number )

Sets the data at 'index' in 'tagGroup' as a short.  

void TagGroupSetIndexedTagAsShortPoint( TagGroup tagGroup, Number index, Number x, Number y )

Sets the data at 'index' in 'tagGroup' as a short point.  

void TagGroupSetIndexedTagAsShortRect( TagGroup tagGroup, Number index, Number t, Number l, Number b, Number r )

Sets the data at 'index' in 'tagGroup' as a short rect.  

void TagGroupSetIndexedTagAsString( TagGroup tagGroup, Number index, String s )

Sets the data at 'index' in 'tagGroup' as a string.  

void TagGroupSetIndexedTagAsTagGroup( TagGroup tagGroup, Number index, TagGroup subGroup )

Sets the data at 'index' in 'TagGroup' as a group.  

void TagGroupSetIndexedTagAsText( TagGroup tagGroup, Number index, String s )

Sets the data at 'index' in 'tagGroup' as a string.  

void TagGroupSetIndexedTagAsUInt16( TagGroup tagGroup, Number index, Number number )

Sets the data at 'index' in 'tagGroup' as a 16-bit unsigned integer.  

void TagGroupSetIndexedTagAsUInt32( TagGroup tagGroup, Number index, Number number )

Sets the data at 'index' in 'tagGroup' as a 32-bit unsigned integer.  

void TagGroupSetIsOpen( TagGroup tagGroup, Boolean is_open )

Sets whether 'tagGroup' is open or not.  

void TagGroupSetTagAsArray( TagGroup tagGroup, String tagPath, ImageReference image )

Set the data at 'tagPath' in 'tagGroup' as an array of data in 'image'.  

void TagGroupSetTagAsBoolean( TagGroup tagGroup, String tagPath, Boolean val )

Sets the data at 'tagPath' in 'tagGroup' as a boolean.  

void TagGroupSetTagAsDouble( TagGroup tagGroup, String tagPath, Number number )

Sets the data at 'tagPath' in 'tagGroup' as a double.  

void TagGroupSetTagAsDoubleComplex( TagGroup tagGroup, String tagPath, ComplexNumber c )

Sets the data at 'tagPath' in 'tagGroup' as a double complex.  

void TagGroupSetTagAsEightBitColor( TagGroup tagGroup, String tagPath, RGBNumber c )

Sets the data at 'tagPath' in 'tagGroup' as an eight bit color.  

void TagGroupSetTagAsFloat( TagGroup tagGroup, String tagPath, Number number )

Sets the data at 'tagPath' in 'tagGroup' as a float.  

void TagGroupSetTagAsFloatComplex( TagGroup tagGroup, String tagPath, ComplexNumber c )

Sets the data at 'tagPath' in 'tagGroup' as a float complex.  

void TagGroupSetTagAsFloatPoint( TagGroup tagGroup, String tagPath, Number x, Number y )

Sets the data at 'tagPath' in 'tagGroup' as a float point.  

void TagGroupSetTagAsFloatRect( TagGroup tagGroup, String tagPath, Number t, Number l, Number b, Number r )

Sets the data at 'tagPath' in 'tagGroup' as a float rect.  

void TagGroupSetTagAsLong( TagGroup tagGroup, String tagPath, Number number )

Sets the data at 'tagPath' in 'tagGroup' as a long.  

void TagGroupSetTagAsLongPoint( TagGroup tagGroup, String tagPath, Number x, Number y )

Sets the data at 'tagPath' in 'tagGroup' as a long point.  

void TagGroupSetTagAsLongRect( TagGroup tagGroup, String tagPath, Number t, Number l, Number b, Number r )

Sets the data at 'tagPath' in 'tagGroup' as a long rect.  

void TagGroupSetTagAsNumber( TagGroup tagGroup, String tagPath, RGBNumber number )

Sets the data at 'tagPath' in 'tagGroup' as a RGB number.  

void TagGroupSetTagAsNumber( TagGroup tagGroup, String tagPath, ComplexNumber number )

Sets the data at 'tagPath' in 'tagGroup' as a complex number.  

void TagGroupSetTagAsNumber( TagGroup tagGroup, String tagPath, Number number )

Sets the data at 'tagPath' in 'tagGroup' as a real number.  

void TagGroupSetTagAsRGBUInt16( TagGroup tagGroup, String tagPath, Number r, Number g, Number b )

Sets the data at 'tagPath' in 'tagGroup' as a 16-bit rgb value.  

void TagGroupSetTagAsShort( TagGroup tagGroup, String tagPath, Number number )

Sets the data at 'tagPath' in 'tagGroup' as a short.  

void TagGroupSetTagAsShortPoint( TagGroup tagGroup, String tagPath, Number x, Number y )

Sets the data at 'tagPath' in 'tagGroup' as a short point.  

void TagGroupSetTagAsShortRect( TagGroup tagGroup, String tagPath, Number t, Number l, Number b, Number r )

Sets the data at 'tagPath' in 'tagGroup' as a short rect.  

void TagGroupSetTagAsString( TagGroup tagGroup, String tagPath, String s )

Sets the data at 'tagPath' in 'tagGroup' as a string.  

void TagGroupSetTagAsTagGroup( TagGroup tagGroup, String tagPath, TagGroup subGroup )

Sets the data at 'tagPath' in 'TagGroup' as a group.  

void TagGroupSetTagAsText( TagGroup tagGroup, String tagPath, String s )

Sets the data at 'tagPath' in 'tagGroup' as a string.  

void TagGroupSetTagAsUInt16( TagGroup tagGroup, String tagPath, Number number )

Sets the data at 'tagPath' in 'tagGroup' as a 16-bit unsigned integer.  

void TagGroupSetTagAsUInt32( TagGroup tagGroup, String tagPath, Number number )

Sets the data at 'tagPath' in 'tagGroup' as a 32-bit unsigned integer.  

void TagGroupSetTagRGBBitmap( TagGroup tagGroup, String tagPath, ImageReference image )

Sets the data at 'tagPath' in 'tagGroup' as a RGB bitmap.  

void TagGroupWriteIndexedTagDataToStream( TagGroup tagGroup, Number index, ScriptObject stream, Number stream_endianness )

Writes data from the indicated tag into the stream. The tag type determines how the data is written, and 'stream_endianness' specifies the endianness of the stream, 1 == bigendian, 2 == littleendian.  

void TagGroupWriteTagDataToStream( TagGroup tagGroup, String tag_path, ScriptObject stream, Number stream_endianness )

Reads data from the indicated tag into the stream. The tag type determines how the data is written, and 'stream_endianness' specifies the endianness of the stream, 1 == bigendian, 2 == littleendian.  

void ClipboardSetAsTagGroup( TagGroup tagGroup )

Sets the contents of the clipboard to the tag group.  
try
       Statement1
catch
       Statement2
Try-catch Statement: The Try-Catch loop is to catch an exception within the script. If an exception occurs within Statement1, Statement2 will be evaluated. If no exception occurs in Statement1, then Statement2 is ignored. Example
void trycatch( Expression, Expression )    

tryguard( Statement )

Statement is evaluated and if an exception occurs a dialog (with an error message) is posted and exception is lowered.

 
try
       Statement1
recover
       Statement2
In any case (either an exception occurs within Statement1 or not), Statement2 is evaluated.  
void tryrecover( Expression, Expression )    
"Variable" Is used to store values, including numbers, images, and strings, in a script. Each variable has a name and a type. It must be declared before being used, with the exception of image letters and intrinsic variables. Details
VOID Allow functions which return no value. If a function has 0 arguments then the keyword "void" is used in place of argument list. Example1
Example2

void CloseFile( Number file )

Close the file. This function should be called to close a file whenever a file is opened. Example

void WriteFile( Number file, String data )

Write the string to the file (e.g. txt, ppt, doc files). Example

void WriteFile( Number file, Number encoding, String data )

Write the string to the file with the specified encoding.  
void ClassRemoveMethod( String class_name, Function method )    
void CleanImage( ImageReference ) Mark the image as having been saved.  

void ClearImage( ImageReference )

Set each pixel in the image to zero.  
void ClearSelection( ImageReference ) Remove selection (if any) from the image.  
void ClipboardSetAsPicture( Number picture ) Sets the contents of the clipboard to the picture.  

void ClipboardSetAsString( String )

Sets the contents of the clipboard to the text.  
void CloseImage( ImageReference )

Attempt to close the image. If the data has changed, a dialog box appears to ask the user to save the image before closing it.

 

void CloseProgressWindow( )

Close the progress window if it is open.  
void CloseTimeBar( ) Closes the time bar.  
void FlipHorizontal( ImageReference ) Flips the image horizontally.  

void FlipVertical( ImageReference )

Flips the image vertically.  
void FloatingModelessDialog( String prompt, String buttonName, Number semaphore )

Present a floating window with the prompt and buttonName. When the user presses the button, the semaphore will be cleared. This function can only be used in the background.

 
void FM_ConjMultiplyPackedByPacked( ImageReference a, ImageReference b )

Conjugate multiply packed image a by packed image b and store the result in b. No data type checking is performed. This function uses the array processor if present.

 

void FM_ConvertInt16ToFloat( ImageReference a, ImageReference b )

Convert the signed 2-byte data in image a to real data and store the result in image b. No data type checking is performed. This function uses the array processor if present.

 

void FM_ConvertUInt8ToDisplay8( Image src, Number top, Number left, Number bottom, Number right, Number dst, Number rowBytes )

Copy the sub-area of unsigned 1-byte integer image src indicated by [top,left,bottom,right] to dst. The rowBytes parameter indicates the length of the row of dst. To copy to the screen, pass 0 for dst and rowBytes. No data type checking is performed. This function uses the array processor if present.

 

void FM_ConvertUInt8ToFloat( Image a, Image b )

Convert the unsigned 1-byte data in image a to real data and store the result in image b. No data type checking is performed. This function uses the array processor if present.

 
void FM_Flush( void ) Finish any pending operations on the array processor.  
void FM_FinishDMA( ImageReference image ) Finish an image for DMA access. This function should be called once for every FM_PrepareDMA() call.  
void FM_ImageDataChanged( ImageReference image ) Inform the application that the image has changed due to DMA or other memory access.  
void FM_MultiplyFloatByFloat( ImageReference a, ImageReference b )

Multiply real image a by real image b and store the result in a. No data type checking is performed. This function uses the array processor if present.

 
void FM_MultiplyPackedByFloat( ImageReference a, ImageReference b )

Multiply packed image a by real image b and store the result in a. No data type checking is performed. This function uses the array processor if present.

 

void FM_MultiplyPackedByScalar( ImageReference a, Number )

Multiply packed image a by real and store the result in a. No data type checking is performed. This function uses the array processor if present.

 
void FM_PackedFFT( ImageReference a )

Perform an in-place packed FFT on image a. No data type checking is performed. This function uses the array processor if present.

 
void FM_PackedIFFT( ImageReference )

Perform an in-place packed inverse FFT on image a. No data type checking is performed. This function uses the array processor if present.

 

void FM_PackedLnModulusToImage( ImageReference imageSrc, ImageReference imageDst, Number lowLimit, Number highLimit, Number range )

Store the unpacked log modulus of the packed complex image imageSrc into imageDst using the lowLimit, highLimit, and range parameters. No data type checking is performed. This function uses the array processor if present.

 
void FM_PrepareDMA( ImageReference image, NumberVariable logicalAddress, NumberVariable physicalAddress )

Prepare an image for DMA access by locking down the data and preventing it from being deleted. If DMA access is possible, store the physical address in the physicalAddress variable. Store the logical address in the logicalAddress variable.The FM_FinishDMA() function should be called once for every FM_PrepareDMA() call.

 
void FM_SubtractMeanPacked( ImageReference a )

Subtract the mean from the packed image a. No data type checking is performed. This function uses the array processor if present.

 
void FM_SetMacOnly( Boolean b )

Disable the plug-in array processor if present. This function may not be supported by plug-in array processors.

 
void FM_ShiftCenterFloat( Image a )

Shift the center of image a in-place (after a forward FFT or before an inverse FFT). No data type checking is performed. This function uses the array processor if present.

 
void FM_SubtractMultiply( ImageReference a, ImageReference b, ImageReference c )

Subtract real image b from real image a, multiply the result by real image c, and store the result in image a. No data type checking is performed. This function uses the array processor if present.

 
void FM_SurveyNormalPackedModulus( ImageReference image, NumberVariable lowLimit, NumberVariable highLimit )

Survey packed image a and store the minimum and maximum values found into the lowLimit and highLimit variables. No data type checking is performed. This function uses the array processor if present.

 

void FM_TurboFFT( Image buffer, Image fft, Image dark, Image gain, Number top, Number left, Number bottom, Number right, Number dst, Number rowBytes )

Perform a turbo FFT on the real image fft minus the real dark image and multiplied by the real gain image. Store the resulting FFT into the packed complex image fft. Copy the sub-area of unsigned 1-byte integer image src indicated by [top,left,bottom,right] to dst. The rowBytes parameter indicates the length of the row of dst. To copy to the screen, pass 0 for dst and rowBytes. The real buffer image is a scratch area. No data type checking is performed. This function uses the array processor if present.

 
void FreeSemaphore( Number ) Free the semaphore. Used only with background processing.  
void Get1DSize( ImageReference, NumberVariable d0 ) Store the length of the 1D image into the d0 variable.  
void Get2DSize( Image, NumberVariable d0, NumberVariable d1 ) Store the width and height of the 2D image into the d0 and d1 variables.  
void Get3DSize( ImageReference, NumberVariable d0, NumberVariable d1, NumberVariable d2 ) Store the x,y, and z sizes of the 3D image into the d0, d1, and d2 variables. Example
void PrintImage( ImageReference ) Print the image.  
void print( Number x )    

void PIctureGetBounds( Number picture, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right )

Gets the preferred bounds of the picture for display on the screen.  
void PictureAnnotationSetPicture( Component comp, Number picture ) Sets the picture of an annotation.  
void RotateLeft( Image ) Rotates the image to the left by 90°.  
void RotateRight( Image ) Rotates the image to the right by 90°.  
void Save( Image ) Save the image under the it's current filename.  
void ROISetColor( ROI roi, Number r, Number g, Number b ) Set the color of the region of interest. Each number should be in the range of 0 to 1.  
void ROISetDeletable( ROI roi, Boolean deletable ) Sets whether the region of interest should be deletable or not.  
void ROISetIsClosed( ROI roi, Boolean is_closed ) Sets whether the region of interest is a closed loop or not (that is the last vertex connects to the first).  
void ROISetLabel( ROI roi, String name ) Set the label on the region of interest. Example
void ROISetLine( ROI roi, Number sx, Number sy, Number ex, Number ey ) Set the region of interest to a line with the given start and end coordinates.
 
void ROISetMoveable( ROI roi, Boolean moveable ) Sets whether the region of interest should be moveable or not.  
void ROISetName( ROI roi, String name ) Set the name of the region of interest.  
void ROISetPoint( ROI roi, Number x, Number y ) Set the region of interest to a point with the given coordinate. E.g. Bring the two earliest opened images to front and assign mirror/identical ROI (single memory object, ROIs are automatically 'linked') on them (link). The Mirror ROIs can only be moved simultaneously, different from Clone ROIs. Example
void ROISetRange( ROI roi, Number start, Number end )
Sets the region of interest to a range with the given start and end columns.  
void ROISetRectangle( ROI roi, Number top, Number left, Number bottom, Number right ) Set the region of interest to a rectangle with the given coordinates. Example1, Example2.

void ROISetRegionToValue( ROI roi, ComplexImage mask, ComplexNumber value, Number top, Number left, Number bottom, Number right )

Sets the area in 'mask' corresponding to the region to the value 'value'.  
void ROISetRegionToValue( ROI roi, RGBImage mask, RGBNumber value, Number top, Number left, Number bottom, Number right ) Sets the area in 'mask' corresponding to the region to the value 'value'.  
void ROISetRegionToValue( ROI roi, ImageReference mask, Number value, Number top, Number left, Number bottom, Number right ) Sets the area in 'mask' corresponding to the region to the value 'value'.  
void ROISetResizable( ROI roi, Boolean resizable ) Sets whether the region of interest should be resizable or not.  
void ROISetVertex( ROI roi, Number index, Number x, Number y ) Set the coordinates of the given vertex of the region of interest.  
void ROISetVolatile( ROI roi, Boolean is_volatile ) Set whether the region of interest is volatile or not.  
void SaveAsGatan( ImageReference, String fileName ) Save the image to the fileName in Gatan 3.0 file format.  
void SaveAsGIF( ImageReference, String fileName )

Save the image to the fileName in GIF file format. The DM Import/Export Plug-in must be installed in order for this function to work.

 
void SaveAsPCX( ImageReference, String fileName )

Save the image to the fileName in PCX file format. The DM Import/Export Plug-in must be installed in order for this function to work.

 
void SaveAsPICT( Image, String fileName )

Save the image to the fileName in PICT file format. The DM Import/Export Plug-in must be installed in order for this function to work.

 
void SaveAsRawData( Image, String fileName ) Save the image to the fileName in raw file format.  
void SaveAsSmallHeader( Image, String fileName ) Save the image to the fileName in Gatan small header file format.  
void SaveAsText( Image, String fileName ) Save the image to the fileName in text file format.  
void SaveAsTIFF( Image, String fileName )

Save the image to the fileName in TIFF file format. The DM Import/Export Plug-in must be installed in order for this function to work.

 
void SaveImage( Image, String fileName ) Save the image to the fileName in it's current file format.  
void SaveNotes( Image, String tagPath, String fileName ) Saves the image notes indicated by tagPath into the given fileName. The tagPath must refer to a group.  
void SavePersistentNotes( String tagPath, String fileName ) Saves the persistent notes indicated by tagPath into the given fileName. The tagPath must refer to a group.  
void ScrapClear( Image ) Clear the pasted image (if there is one) from the image.  
void ScrapCopy( Image ) Copy the selected portion of the image to the scrap.  
void ScrapGetLocation( Image, NumberVariable top, NumberVariable left ) Store the pasted image location (in image coordinates) into the top and left variables.  
void ScrapGetSize( Image, NumberVariable width, NumberVariable height ) Store the pasted image size (in image coordinates) into the width and height variables.  
void ScrapMerge( Image ) Merge the pasted image (if there is one) with the image.  
void ScrapPaste( Image ) Paste the scrap into the image.  
void ScrapPasteNew( void ) Paste the scrap into a new image.  
void ScrapSetLocation( Image, Number top, Number left ) Set the location of the pasted image (if there is one) to [top,left].  
void ScreenGetBounds( Number index, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r ) Gets the bounds of the 'index'th screen.  
void ScreenGetWorkArea(Number index, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r) Gets the bounds of the 'index'th screen.  
void ScriptWindowExecute( DocumentWindow window ) Executes the script in the script window.  
void ScriptInterfaceGenerateStubs( String interface_name, String str_h, String str_cp ) Generates C++ stubs for the interface.  
     
void SelectImage( Image ) Bring the image's image document window to the front. Example
 

 

 
void SetAnnotationComplexNumberNote(Image, Number annotationID, String noteLabel, ComplexNumber noteValue ) Sets the value of the annotation note with label noteLabel to noteValue. If the note does not exist, it is created.  
 

 

 
     
 

 

 
void SetAnnotationNumberNote( Image, Number annotationID, String noteLabel, Number noteValue ) Sets the value of the annotation note with label noteLabel to noteValue. If the note does not exist, it is created.  
     

 

 

 
void SetAnnotationRGBNumberNote( Image, Number annotationID, String noteLabel, RGBNumber noteValue ) Sets the value of the annotation note with label noteLabel to noteValue. If the note does not exist, it is created.  
     
void SetAnnotationStringNote( Image, Number annotationID, String noteLabel, String noteValue )
Sets the value of the annotation note with label noteLabel to noteValue. If the note does not exist, it is created.  
void SetColorMode( Image, Number mode ) Set the color mode of the image. The possible values for mode are 1=greyscale, 3=rainbow, 4=temperature.  
void SetApplicationFont( Number which_font, String face_name, Number attributes, Number size, Number text_encoding ) Sets the selected appliction font to have the specified face name, attributes, size, and text encoding.  
void SetComplexMode( Image, Number mode )

Set the complex-to-real mode of the image. The possible value for mode are 1=real, 2=imaginary, 3=modulus, 4=log of modulus, 5=phase.

 
void SetComplexNumberNote( Image, String noteLabel, ComplexNumber noteValue ) Sets the value of the image note with label noteLabel to noteValue. If the note does not exist, it is created.
 
void SetContrastMode( Image, Number mode ) Set the constrast mode of the image. The possible value for mode are 1=linear, 2=equalized, 3=contoured, 4=custom, 5=gamma.  
void SetCustomCLUT( Image, RGBImage clutImage ) Set the CLUT for the image to clutImage. clutImage must be a 256x1 RGB image.  
void SetDaemonComponent( ImageReference, Number ) Set the daemon component for the image. See the SDK documentation for more information.  
void SetDisplayType( Image, Number displayType )

Set the display type of the image. Possible displayType values are -1=best, 1=raster image, 2=surface plot, 3=RGB, 4=line plot, 5=spreadsheet.

Example
void SetDoCreateCustomIcon( Image image, Boolean doCreateCustomIcon )
Open the image with the filename. Returns the opened image.  
void SetDoSavePreview( Image image, Boolean doSavePreview ) Sets whether to save a preview along with the saved file.  
void SetEstimatedMinMax( Image, Number min, Number max ) Set the estimated minimum and maximum of the image to min, max. This can be used if survey is turned off.  
void SetImage( Image src, RealImageVariable dst ) Assigns src to dst by reference.  
void SetImagePositionWithinWindow( Image, Number x, Number y ) Set top-left position of the image to [x,y] within the image document.  
void SetInversionMode( Image, Boolean inverted ) Set the contrast of the image to be inverted or not inverted.  
void SetKeywordNote( Image, String keyword ) Adds the keyword to the image keyword list if it does not already exist.  
void SetLimits( Image, Number low, Number high )

Set the lowest and highest displayed pixel values for the image. Everything below low will be the 'black' color and every above high will be the 'white' color. The black and white colors may not actually be black and white if the color table is not greyscale.

 
void SetMinContrast( Image, Number minContrast ) Set the minimum amount of contrast for the image to minContrast.  
void SetName( Image, String name ) Sets the name of the image's image document to name.  
void SetNoteState( Image, String noteLabel, Boolean hidden ) Sets whether the given image note is in the copy-to-image list. The hidden parameter is unused.  
void SetNumberNote( Image, String noteLabel, Number noteValue ) Sets the value of the image note with label noteLabel to noteValue. If the note does not exist, it is created.  
void SetOrigin( Image, Number x, Number y ) Set the origin of the image coordinates to [x,y] which are in pixel units.  
void SetPersistentComplexNumberNote( String noteLabel, ComplexNumber noteValue ) Sets the value of the persistent note with label noteLabel to noteValue. If the note does not exist, it is created.  
void SetPersistentKeywordNote( String keyword ) Adds the keyword to the persistent keyword list if it does not already exist.  
void SetPersistentLongNote( String noteLabel, Number noteValue ) Sets the value of the persistent note with label noteLabel to noteValue. If the note does not exist, it is created.  
void SetPersistentNoteState( String noteLabel, Boolean copyToImage, Boolean hidden ) Sets whether the given persistent note is in the copy-to-image list. The hidden parameter is unused.  
void SetPersistentNumberNote( String noteLabel, Number noteValue ) Sets the value of the persistent note with label noteLabel to noteValue. If the note does not exist, it is created: Example.  
void SetPersistentPointNote( String noteLabel, Number x, Number y )

Sets the value of the persistent note with label noteLabel to the point formed from the x and y parameters. If the note does not exist, it is created.

 
void SetPersistentRectNote( String noteLabel, Number top, Number left, Number bottom, Number right )

Sets the value of the persistent note with label noteLabel to the rectangle formed from the top, left, bottom, and right parameters. If the note does not exist, it is created.

 
void SetPersistentRGBNumberNote( String noteLabel, RGBNumber noteValue ) Sets the value of the persistent note with label noteLabel to noteValue. If the note does not exist, it is created.  
void SetPersistentStringNote( String noteLabel, String noteValue ) Sets the value of the persistent note with label noteLabel to noteValue. If the note does not exist, it is created.  
void SetPixel( ComplexImage, Number x, Number y, ComplexNumber value ) Sets the pixel in the image at [x,y] to value. Does not work on packed complex images.  
void SetPixel( RealImage, Number x, Number y, Number value )
Sets the pixel in the image at [x,y] to value. E.g. Example.  
void SetPixel( RGBImage, Number x, Number y, RGBNumber value ) Sets the pixel in the image at [x,y] to value.  
void SetPointNote( Image, String noteLabel, Number x, Number y )

Sets the value of the image note with label noteLabel to the point formed from the x and y parameters. If the note does not exist, it is created.

 
void SetRectNote( Image, String noteLabel, Number top, Number left, Number bottom, Number right )

Sets the value of the image note with label noteLabel to the rectangle formed from the top, left, bottom, and right parameters. If the note does not exist, it is created.

 
void SetRGBNumberNote( Image, String noteLabel, RGBNumber noteValue ) Sets the value of the image note with label noteLabel to noteValue. If the note does not exist, it is created.  
void SetScale( Image, Number x, Number y ) Set the scale of the image to [x,y].  
void SetSelection( Image, Number top, Number left, Number bottom, Number right ) Sets the selection of the image to [top,left,bottom,right].  
void SetStarveRegisters( Boolean )    
void SetStringNote( Image, String noteLabel, String noteValue ) Sets the value of the image note with label noteLabel to noteValue. If the note does not exist, it is created.  
void SetSurvey( ImageReference, Boolean surveyOnOff ) Turn surveying on or off for the image.  
void SetSurveyTechnique( ImageReference, Number mode ) Set the survey technique for the image to mode. Mode can be 0=cross-wire, 1=whole image, 2=sparse.  
void SetUnitString( ImageReference, String unitString ) Set the units of the image to unitString.  
void SetWindowBounds( ImageReference, Number top, Number left, Number bottom, Number right ) Set the image's image document window bounds to (left,top),(right,bottom).  
void SetWindowPosition( ImageReference, Number xPos, Number yPos ) Set the image's image document window position to [xPos, yPos]. Only valid for images that are already shown in a window.  
void SetWindowSize( Image, Number width, Number height ) Set the image's image document window size to [width, height].  
void SetZoom( Image, Number zoom ) Set the zoom of the image display.  
void ShiftCenter( Image image ) Shifts each dimension of an image by half. For two dimensional images it will swap quadrants.  
void ShowImage( Image ) Display the image's image document in a window if it is not displayed already.  
void ShowAlert( String prompt, Number alertStyle ) Puts up an alert with the given prompt and style. Example
void Sleep( Number seconds ) Puts the current thread to sleep for the given number of seconds (resolution may vary by platform).  
void StopAcquisitionDaemon( ImageReference ) Stop all acquisition daemons associated with the image.  
void StopAllAcquisitionDaemons( void ) Stop all acquisition daemons with any image within the application.  
void swap( RealImageExpression a, RealImageExpression b ) Swap images a and b, pixel by pixel.  

void SurfacePlotImageDisplayGetCubeAxes( SurfacePlotImageDisplay spid, NumberVariable x_axis_x, NumberVariable x_axis_y, NumberVariable y_axis_x, NumberVariable y_axis_y, NumberVariable z_axis )

Gets the points describing the surface plot cube.  
void swap( ComplexImageExpression a, ComplexImageExpression b ) Swap images a and b, pixel by pixel.  
void SwapByteOrder( ImageReference ) Swaps the byte order for each long word in the image. ABCD become DCBA.  
void SwapWordOrder( Image ) Swaps the byte order for each short word in the image. ABCD become BADC.  
void swap( RGBImageExpression a, RGBImageExpression b ) Swap images a and b, pixel by pixel.  

void SurfacePlotImageDisplayGetCubePoint( SurfacePlotImageDisplay spid, Number which_point, NumberVariable x, NumberVariable y )

Gets the child coordinates of the cube point indicated by 'which_point'  

void SurfacePlotImageDisplaySetCubeAxes( SurfacePlotImageDisplay spid, Number x_axis_x, Number x_axis_y, Number y_axis_x, Number y_axis_y, Number z_axis )

Sets the points describing the surface plot cube.  
void SurfacePlotImageDisplaySetShadingOn( SurfacePlotImageDisplay spid, Boolean on ) Sets whether shading is on or off.  
void :=( RGBImageVariable dst, RGBImage src ) Assign src to dst by reference.  
void :=( ComplexImageVariable dst, ComplexImage src ) Assign src to dst by reference.  
void :=( RealImageVariable dst, RealImage src ) Assign src to dst by reference.  
void :=( BasicImage dst, BasicImage src ) Assign src to dst by reference.  
void =( StringVariable dst, String src ) Assigns src string to dst string.  
void AbortAllAcquisitionDaemons( void ) Abort all acquisition daemons with any image within the application.  
void AbortAcquisitionDaemon( Image ) Abort all acquisition daemons associated with the image.  

void AddArrayMaskToImage( ImageReference mask, Number x_center, Number y_center, Number x_radius, Number y_radius, Number x_v1, Number y_v1, Number x_v2, Number y_v2, Number filter_length, Boolean do_inverse )

   

void AddBandPassMaskToImage( ImageReference mask, Number x_center, Number y_center, Number band_radius_1, Number band_radius_2, Number filter_length, Boolean do_inverse )

   
void AddOvalMaskToImage( ImageReference mask, Number t_oval, Number l_oval, Number b_oval, Number r_oval, Number filter_length, Boolean do_inverse )    
void AddPathToCopyToImageList( String path ) Adds 'path' to the list of tags to transfer to acquired images.  
void AddScriptFileToMenu( String fileName, String commandName, String menuName, String optionalSubMenuName, Boolean isLibrary ) Install the script in the file indicated by fileName into the application. The commandName indicates the string by which this script will be known to the application. If the script is to be installed in the menu, the menuName and optionalSubMenuName parameters specify the menu. Pass 1 for isLibrary if the script is a library only and 0 to install it in the menu.  
void AddScriptFileToPackage( String fileName, String packageName, Number packageLevel, String commandName, String menuName, String optionalSubMenuName, Boolean isLibrary ) Install the script in the file indicated by fileName into the application. The commandName indicates the string by which this script will be known to the application. If the script is to be installed in the menu, the menuName and optionalSubMenuName parameters specify the menu. Pass 1 for isLibrary if the script is a library only and 0 to install it in the menu.  
void AddScriptToMenu( String script, String commandName, String menuName, String optionalSubMenuName, Boolean isLibrary ) Install the script into the application. The commandName indicates the string by which this script will be known to the application. If the script is to be installed in the menu, the menuName and optionalSubMenuName parameters specify the menu. Pass 1 for isLibrary if the script is a library only and 0 to install it in the menu.  
void AddScriptToPackage( String script, String packageName, Number packageLevel, String commandName, String menuName, String optionalSubMenuName, Boolean isLibrary ) Install the script into the application. The commandName indicates the string by which this script will be known to the application. If the script is to be installed in the menu, the menuName and optionalSubMenuName parameters specify the menu. Pass 1 for isLibrary if the script is a library only and 0 to install it in the menu.  
void AddStringToList( Image, String tagPath, String string ) Adds the string to the image tag list indicated by tagPath.  
void AddStringToPersistentList( String tagPath, String string ) Adds the string to the persistent tag list indicated by tagPath.  
void AddTwinMaskToImage( ImageReference mask, Number x_center, Number y_center, Number x_offset, Number y_offset, Number x_radius, Number y_radius, Number filter_length, Boolean do_inverse )    
void AddWedgeMaskToImage( ImageReference mask, Number x_center, Number y_center, Number x_v1, Number y_v1, Number x_v2, Number y_v2, Number filter_length, Boolean do_inverse )    
void AdjustScriptMenuItem( String commandName, String menuName, String optionalSubMenuName, String newCommandName, Boolean enabled, Boolean checked, Number key, Number acceleratorPos ) Adjusts the display characteristics of the given script menu item. NewCommandName specifies the new name for the menu item. The menu item will have to be referred to by that name from then forth. Enabled/checked indicate whether the item is enabled/checked. Key refers to the command key equivalent on the MacOS. Pass 0 to have no command key equivalent. AcceleratorPos refers to the position of the accelerator equivalent on Windows. Pass -1 to have to accelerator.  
void ApplicationGetBounds( NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r ) Gets the bounds of the main area of the application in application coordinates.  
void ApplicationGetOrigin( NumberVariable x, NumberVariable y ) Gets the origin of the application in global coordinates.  
void Beep( void ) Play the current system beep.  
void BrowseTagFile( void ) Present an open file dialog to the user, allow them to select a tag file, and then allow them to browse through it.  
void CheckHeap( void ) Checks the integrity of the application memory.  
void ComponentAddChildAfter( Component parent, Component child, Component annot_pos ) Adds 'child' to 'parent's list of sub-annotations after 'annot_pos'.  
void ComponentAddChildAtBeginning( Component parent, Component child ) Adds 'child' to the beginning of 'parent's list of sub-annotations.  
void ComponentAddChildAtEnd( Component parent, Component child ) Adds 'child' to the end of 'parent's list of sub-annotations.  
void ComponentAddChildBefore( Component parent, Component child, Component annot_pos ) Adds 'child' to 'parent's list of sub-annotations before 'annot_pos'.  
void ConvertImageData( Image from, Image to )    
void ConvertImageDataSlice_2D( Image from, Image to, Number x_l, Number y_l, Number f_x_0, Number f_y_0, Number f_x_d, Number f_x_s, Number f_y_d, Number f_y_s, Number t_x_0, Number t_y_0, Number t_x_d, Number t_x_s, Number t_y_d, Number t_y_s )    
void ConvertToByte( ImageReference ) Converts the given image to unsigned integer 1-byte data.  
void ConvertToComplex( ImageReference ) Converts the given image to complex single precision data.  
void ConvertToFloat( ImageReference ) Converts the given image to single precision real data.  
void ConvertToLong( Image ) Converts the given image to signed integer 4-byte data.  
void ConvertToPackedComplex( Image ) Converts the given image to packed complex data.  
void ConvertToShort( ImageReference ) Converts the given image to signed integer 2-byte data.  
void ConvertXieAny( ImageExpression )    
void ConvertXneAny( NumberExpression )    
void CreateDirectory( String fileName ) Create a folder named fileName.  
void CreateFile( String fileName ) Create a file named fileName.  
void CreateJavaInterface( )    
void CreateJavaStubs( )    
void CreateOldPlugInInterfaceFiles( Number os_id )    
void Delay( Number ) Delay for the given number of tick counts.  
     
 
 
void DeleteDirectory( String dirName ) Deletes the folder named dirName.  
void DeleteFile( String fileName ) Delete the file.  
void DeleteImage( ImageVariable ) Close the image without asking the user to save it.  
void DeleteImageFile( String fileName ) Delete the image file.  
void DeleteListEntry( Image, String tagPath, Number index ) Deletes the tag with the given index from within the image tag list indicated by tagPath.  
void DeleteNote( ImageReference, String noteLabel ) Removes the image note with the label noteLabel.  
void DeletePersistentListEntry( String tagPath, Number index ) Deletes the tag with the given index from within the persistent tag list indicated by tagPath.  
void DeletePersistentNote( String noteLabel ) Removes the note with the label noteLabel from the persistent note list.  
     
void DestroyPicture( NumberVariable picture ) Destroy a picture  
void DisconnectObject( Number object, String message, String ident ) Break the connection specified by ident for the given object and message.  
void DisplayAt( Image, Number x, Number y ) Display the image's image document if it is not display already and moves the window position to [x,y] screen coordinates.  
void DoEvents( ) Process all pending MacOS events.  
void DontInterpret( Number x )    
void EditorWindowAddText( DocumentWindow window, String text ) Appends the text to a editor window.  
void EditorWindowGetFont( DocumentWindow window, String face_name, NumberVariable attributes, NumberVariable size, NumberVariable text_encoding ) Gets the font of a script window.  
void EditorWindowSaveToFile( DocumentWindow window, String path ) Saves the editor window to the specified path.  
void EditorWindowSetFont( DocumentWindow window, String face_name, Number attributes, Number size, Number text_encoding ) Sets the font of a script window.  
void EditorWindowSetText( DocumentWindow window, Number encoding, String text ) Sets the text in an editor window.  
void EMBeamShift( Number xAmount, Number yAmount ) Shift the beam by xAmount, yAmount. The EM Control Plug-in must be currently installed and configured.  
void EMChangeFocus( Number amount ) Change the focus by amount. The EM Control Plug-in must be currently installed and configured.  
void EMChangeStigmation( Number xAmount, Number yAmount ) Change the stigmation by xAmount, yAmount. The EM Control Plug-in must be currently installed and configured.  
void EMChangeTilt( Number xAmount, Number yAmount ) Change the tilt by xAmount, yAmount. The EM Control Plug-in must be currently installed and configured.
 
void EMCloseCommunication( ) Close communication to the microscope. The EM Control Plug-in must be currently installed and configured.  
void EMImageShift( Number xAmount, Number yAmount ) Shift the image by xAmount, yAmount. The EM Control Plug-in must be currently installed and configured.  
void EMPrepareImageShift( void ) Prepare image shift. Call this before a sequence of image shift changes. The EM Control Plug-in must be currently installed and configured.  
void EMPrepareShift( ) Prepare beam shift. Call this before a sequence of beam shift changes. The EM Control Plug-in must be currently installed and configured.  
void EMPrepareStigmation( void ) Prepare stigmation. Call this before a sequence of stigmation changes. The EM Control Plug-in must be currently installed and configured.  
void EMPrepareTilt( void ) Prepare tilt. Call this before a sequence of tilt changes. The EM Control Plug-in must be currently installed and configured.  
void EMSetupCommunication( ) Setup communication with the microscope. The EM Control Plug-in must be currently installed and configured.  
void ExecutePersistentScriptGroup( String tagPath, String form ) Execute a group of script functions in the persistent tag list indicated by tagPath. The actual scripts executed will be formed by sprintf'ing into the form parameter. The form parameter should contain exactly one %s in which will be inserted the function name.  
void ExecuteScriptGroup( Image image, String tagPath, String form ) Execute a group of script functions in the image tag list indicated by tagPath. The actual scripts executed will be formed by sprintf'ing into the form parameter. The form parameter should contain exactly one %s in which will be inserted the function name.  
void exit( Number ) Stops execution of the current script immediately and returns the number as the result of the script.  
void Extract2D_Linear( Image from, Image to, Number extract_style, Number x_start, Number y_start, Number x_scale_0, Number y_scale_0, Number x_scale_1, Number y_scale_1 )    
void for( RealNumber, Expression, Expression )    
void FormatDouble( Number x, Number err, Number nchars, Number use_num_sig, Number format )    
     
void GetEstimatedMinMax( ImageReference, NumberVariable minPtr, NumberVariable maxPtr ) Store the current estimated minimum and maximum of the image into the minPtr and maxPtr variables.  
void GetLimits( Image, NumberVariable lowPtr, NumberVariable highPtr ) Stores display limits into the lowPtr and highPtr variables.  
void GetMaximalDocumentWindowRect( Number options, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the bounds of the content region of the largest document window.  
void GetNthPersistentNumberNote( String tagPath, Number index, NumberVariable noteValue ) Stores the number with the given index from the persistent tag list indicated by tagPath into noteValue.  
void GetOrigin( ImageReference, NumberVariable x, NumberVariable y ) Store the origin of image into the x and y variables. The origin is in the same units as scale.  
void GetScale( Image, NumberVariable x, NumberVariable y ) Store the scale of image into the x and y variables.  
void GetScreenSize( NumberVariable width, NumberVariable height ) Store the size of the screen into the width and height variables.  
void GetSize( Image, NumberVariable width, NumberVariable height ) Store the width and height of the 2D image into the width and height variables: Example.  
void GetWindowPosition( ImageReference, NumberVariable xPos, NumberVariable yPos ) Store the image's image document window position into the xPos and yPos variables.  
void GetWindowSize( Image, NumberVariable width, NumberVariable height ) Store the image's image document window size into the width and height variables.  
void GrabSemaphore( Number ) Grab the semaphore. Block until it is available. Used only with background processing.  
void GroupAnnotationUngroup( Component comp ) Ungroups the group annotation.  
void HideImage( Image ) Hide the image's image document.  
void if( RealNumber, Expression )    
void if( RealNumber, Expression, Expression )    
void ImageCalculateHistogram( ImageReference image, ImageReference hist_image, Number complexMode, Number min, Number max ) Calculates the histogram of 'image', mapping [min,max] into 'hist_image'.  
void ImageCalculateMinMax( ImageReference image, Number surveyTechnique, Number complexMode, NumberVariable min, NumberVariable max ) Calculates the minimum and maximum value of 'image' using survey technique 'surveyTechnique'.  
void ImageData_CacheChanged( Number imageDataID ) Tell the array processor manager that the cached image has changed. See the SDK documentation for more information.  
void ImageData_Changed( Number imageDataID ) Tell the array processor manager that the image has changed. See the SDK documentation for more information.  
void ImageData_FlushCache( Number imageDataID ) Tell the array processor manager to flush the image from the cache. See the SDK documentation for more information.  
void ImageData_SetLocalSeed( Number imageDataID, Number value ) Tell the array processor manager to set the local data seed. See the SDK documentation for more information.  
void ImageDisplayAccumulateROIsToMask( ImageDisplay imgDisp, ImageReference mask, Number top, Number left, Number bottom, Number right, Number mask_val ) Sets mask to mask_val at points in imageDisplay's rois  
void ImageDisplayAddKeyListener( ImageDisplay imgDisp, String listener_key, String listener_script ) Adds the listener_script to the key listener list under the tag listener_key.  
void ImageDisplayAddROI( ImageDisplay imgDisp, ROI roi ) Adds the ROI to this image display. Example1, Example2, Example3.  
void KeepImage( ImageReference ) Keep the image from being deleted automatically when the image's script scope is exited.  
void KillProcess( Number pid ) Kills the process specified by pid.  
LinePlotImageDisplay Convert_ImageDisplay_LinePlotImageDisplay( ImageDisplay imgDisp )    
RasterImageDisplay Convert_ImageDisplay_RasterImageDisplay( ImageDisplay imgDisp )    
SurfacePlotImageDisplay Convert_ImageDisplay_SurfacePlotImageDisplay( ImageDisplay imgDisp )    
RasterImageDisplay =( RasterImageDisplay dst, ImageDisplay id )
   
LinePlotImageDisplay =( LinePlotImageDisplay dst, ! )
   
LinePlotImageDisplay =( LinePlotImageDisplay dst, LinePlotImageDisplay lpid )
  Example
LinePlotImageDisplay LinePlotImageDisplayNullify( ! )    
     
void LinePlotImageDisplayGetContrastLimits( LinePlotImageDisplay lpid, NumberVariable lowLimit, NumberVariable highLimit ) Gets the lowest and higest intensities displayed.  
void LinePlotImageDisplayGetDisplayedChannels( LinePlotImageDisplay lpid, NumberVariable leftChannel, NumberVariable rightChannel ) Gets the leftmost and rightmost displayed channels.  
void LinePlotImageDisplayGetDoAutoSurvey( LinePlotImageDisplay lpid, NumberVariable doAutoSurveyLow, NumberVariable doAutoSurveyHigh ) Gets whether to auto-survey is done on the high and low intensity limits.  
void LinePlotImageDisplayGetSliceComponentColor( LinePlotImageDisplay lpid, Number slice_index, Number comp_index, NumberVariable r, NumberVariable g, NumberVariable b ) Returns the color of the 'comp_index'th component of the 'slice_index'th slice.  
void LoadNotes( ImageReference, String tagPath, String fileName ) Loads the image notes from the given fileName into tagPath. This function will read the group name from the file. The tagPath must refer to a group.  
void LoadNotesAs( ImageReference, String tagPath, String fileName ) Loads the image notes from the given fileName into tagPath. The tagPath must refer to a group.  
void LoadPersistentNotes( String tagPath, String fileName ) Loads the persistent notes from the given fileName into tagPath. This function will read the group name from the file. The tagPath must refer to a group.  
void LoadPersistentNotesAs( String tagPath, String fileName ) Loads the persistent notes from the given fileName into tagPath. The tagPath must refer to a group.  
void minmax( RealImageExpression, NumberVariable minP, NumberVariable maxP ) Finds the minimum and maximum pixel in the image and store those values into minP and maxP.  
void ModelessDialog( String prompt, String buttonName, Number semaphore ) Present a modeless dialog with the prompt and buttonName. When the user presses the button, the semaphore will be cleared. This function can only be used in the background.  
     
void ObjectTransformInvert( Number i_o_x, Number i_o_y, Number i_s_x, Number i_s_y, NumberVariable o_o_x, NumberVariable o_o_y, NumberVariable o_s_x, NumberVariable o_s_y ) Inverts the transform (i_o_x,i_o_y,i_s_x,i_s_y) and places the result in (*o_o_x,*o_o_y,*o_s_x,*o_s_y).  
void ObjectTransformCompose( Number i1_o_x, Number i1_o_y, Number i1_s_x, Number i1_s_y, Number i2_o_x, Number i2_o_y, Number i2_s_x, Number i2_s_y, NumberVariable o_o_x, NumberVariable o_o_y, NumberVariable o_s_x, NumberVariable o_s_y ) Composes the transform (i1_o_x,i1_o_y,i1_s_x,i1_s_y) with (i2_o_x,i2_o_y,i2_s_x,i2_s_y) and places the result in (*o_o_x,*o_o_y,*o_s_x,*o_s_y).  
void ObjectTransformTransformPoint( Number i_o_x, Number i_o_y, Number i_s_x, Number i_s_y, Number i_p_x, Number i_p_y, NumberVariable o_p_x, NumberVariable o_p_y ) Transforms the point (i_p_x,i_p_y) by the transform (i_o_x,i_o_y,i_s_x,i_s_y) and places the result in (*o_p_x,*o_p_y).  
void ObjectTransformTransformRect( Number i_o_x, Number i_o_y, Number i_s_x, Number i_s_y, Number i_r_t, Number i_r_l, Number i_r_b, Number i_r_r, NumberVariable o_r_t, NumberVariable o_r_l, NumberVariable o_r_b, NumberVariable o_r_r ) Transforms the point (i_r_t,i_r_l,i_r_b,i_r_r) by the transform (i_o_x,i_o_y,i_s_x,i_s_y) and places the result in (*o_r_t,*o_r_l,*o_r_b,*o_r_r).  
void ObjectTransformUntransformPoint( Number i_o_x, Number i_o_y, Number i_s_x, Number i_s_y, Number i_p_x, Number i_p_y, NumberVariable o_p_x, NumberVariable o_p_y ) Transforms the point (i_p_x,i_p_y) by the transform (i_o_x,i_o_y,i_s_x,i_s_y) and places the result in (*o_p_x,*o_p_y).  
void ObjectTransformUntransformRect( Number i_o_x, Number i_o_y, Number i_s_x, Number i_s_y, Number i_r_t, Number i_r_l, Number i_r_b, Number i_r_r, NumberVariable o_r_t, NumberVariable o_r_l, NumberVariable o_r_b, NumberVariable o_r_r ) Transforms the point (i_r_t,i_r_l,i_r_b,i_r_r) by the transform (i_o_x,i_o_y,i_s_x,i_s_y) and places the result in (*o_r_t,*o_r_l,*o_r_b,*o_r_r).  
     
void OpenAndSetProgressWindow( String line1, String line2, String line3 ) Open the progress window and sets the text within to line1, line2, and line3.  
void OpenResultsWindow( void ) Open the results window if it is not already open.  
void OpenTimeBar( String prompt, Number total ) Opens the time bar with the given prompt. The total parameter is ignored. CloseTimeBar() must be invoked exactly once for every OpenTimeBar() call.  
void OutputCode( Number x )    
void OutputDAGs( Number x )    
void OutputTrees( Number x )    
void RawCopyImage( Image src, Image dst ) Copies the src image to the dst image ignoring data types. The data type sizes of the two images must be the same.  
void Reduce( ImageReference ) Reduces the image by 2X.  
void RegisterClass( String class_name, String parent_class_name, ! alloc_proc, ! dealloc_proc, Number refCon )    
void RegisterMenuAdjustment( String menuName, String adjustedMenuName ) Unregister a menu name adjustment. See the SDK documentation for more information.  
void RegisterScriptPalette( ScriptObject, String type, String name )    
void ReleaseSemaphore( Number ) Release a semaphore. Used only with background processing.  
void RemoveDaemonHack( ImageReference, Number id ) Remove the daemon component for the image. See the SDK documentation for more information.  
void RemovePathFromCopyToImageList( String path ) Removes 'path' from the copy to image list.  
void RemoveScriptFromMenu( String commandName, String menuName, String optionalSubMenuName ) Removes the given menu command from the menu. The commandName indicates the string by which this script is known to the application. The menuName and optionalSubMenuName parameters specify the menu.  
void Result( String ) Output the string to the results window.  
void Result( Number, String format ) Output the real number with the printf-style format to the results window.  
void Result( Number ) Output the real number to the results window.  
void Result( ComplexNumber ) Output the complex number to the results window.  
void Result( RGBNumber ) Output the RGB number to the results window.  
void return( Expression )    
void return( )    
void Yield( ) Yield to another background task.  
void XX_InstallImageProcess( ImageReference, Number pid )
Associate the process indicated by pid with the image. Keystrokes going to the image will queue in the process after this call.
 
void ComponentGetBoundingRectInView( Component comp, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r )
Gets the bounding rect of the annotation.  
void ComponentGetBoundingRect( Component comp, NumberVariable t, NumberVariable l, NumberVariable b, NumberVariable r ) Gets the bounding rect of the annotation.  
void break( )    
void ComponentGetChildToLocalTransform( Component comp, NumberVariable off_x, NumberVariable off_y, NumberVariable scale_x, NumberVariable scale_y ) Gets the transformation from child to local coordinates.  
void ComponentGetChildToPageTransform( Component comp, NumberVariable off_x, NumberVariable off_y, NumberVariable scale_x, NumberVariable scale_y ) Gets the transformation from child to page coordinates.  
void ComponentGetChildToViewTransform( Component comp, NumberVariable off_x, NumberVariable off_y, NumberVariable scale_x, NumberVariable scale_y ) Gets the transformation from child to view coordinates.  
void ComponentGetChildToWindowTransform( Component comp, NumberVariable off_x, NumberVariable off_y, NumberVariable scale_x, NumberVariable scale_y ) Gets the transformation from child to window coordinates.  
void ComponentGetFontInfo( Component comp, String faceName, NumberVariable attributes, NumberVariable size, NumberVariable text_encoding ) Gets a description of the component's font.  
void ComponentGetFontInfo( Component comp, String faceName, NumberVariable attributes, NumberVariable size ) Gets a description of the component's font.  
void ComponentGetLocalToPageTransform( Component comp, NumberVariable off_x, NumberVariable off_y, NumberVariable scale_x, NumberVariable scale_y ) Gets the transformation from local to page coordinates.  
void ComponentGetLocalToViewTransform( Component comp, NumberVariable off_x, NumberVariable off_y, NumberVariable scale_x, NumberVariable scale_y ) Gets the transformation from local to view coordinates.  
void ComponentGetLocalToWindowTransform( Component comp, NumberVariable off_x, NumberVariable off_y, NumberVariable scale_x, NumberVariable scale_y ) Gets the transformation from local to window coordinates.  
void ComponentGetRect( Component comp, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the rectangle of the annotation.  
void ComponentGetRectInView( Component comp, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the rectangle of the annotation.  
void ComponentOffsetControlPoint( Component comp, Number loc, Number x, Number y, Number restrict_style ) Changes the control point 'loc' of 'comp' by '(x,y)' using restrictions specified by 'restrict_style'.  
void ComponentPositionAroundPoint( Component comp, Number new_x, Number new_y, Number rel_x, Number rel_y, Boolean horz, Boolean vert ) Moves the annotation so if 'horz', the 'rel_x' horizontal point in the bounding rect is at 'new_x', and if 'vert', the 'rel_y' vertical point in the bounding rect is at 'new_y'  
void ComponentRemoveFromParent( Component comp ) Removes the image document component from its parent component (e.g. imageDisplay) Example
void ComponentSetControlPoint( Component comp, Number loc, Number x, Number y, Number restrict_style ) Sets the control point 'loc' of 'comp' to '(x,y)' using restrictions specified by 'restrict_style'.  
void ComponentSetDrawingMode( Component comp, Number mode ) Sets the drawing mode of the image document component.  
void ComponentSetFillMode( Component comp, Number mode ) Sets the fill mode of the image document component.  
void ComponentSetFontAttributes( Component comp, Number attributes ) Sets the attributes of the component's font.  
void ComponentSetFontFaceName( Component comp, String face_name ) Sets the face name of the component's font.  
void ComponentSetFontInfo( Component comp, String face_name, Number attributes, Number size, Number text_encoding ) Sets the font information of the component's font.  
void ComponentSetFontInfo( Component comp, String face_name, Number attributes, Number size ) Sets the font information of the component's font.  
void ComponentSetFontSize( Component comp, Number size ) Sets the point size of the component's font.  
void ComponentSetRect( Component comp, Number top, Number left, Number bottom, Number right ) Sets the rectangle of the annotation.  
void ComponentSetSelected( Component comp, Boolean select ) Sets the selection status of the component.  
void ComponentTransformCoordinates( Component comp, Number off_x, Number off_y, Number scale_x, Number scale_y ) Transforms the component by the specified transform.  
void ConnectObject( Number object, String message, String ident, ScriptObject scriptObject, String method ) Build the connection with the given object and message under ident.  
void CreatePlugInInterfaceFiles( Number os_id )    
void CreateShortScriptHTMLDocumentation( String directory )    
void CreateXMLFunctionDescriptions( )    
void DM_Utility_GetScriptMemoryUsage( )    
void ExecuteCompiledScripts( Number x )    
void GetApplicationFont( Number which_font, String face_name, NumberVariable attributes, NumberVariable size, NumberVariable text_encoding ) Gets the face name, attributes, size, and text encoding of the selected appliction font.  
void ImageCopyCalibrationFrom( ImageReference image, ImageReference src_image ) Copy the calibration of 'src_image' to 'image'. Example1
Example2
void ImageDisplayChangeDisplayType( ImageDisplay imgDisp, Number new_type ) Changes the type of the image display.  
void ImageDisplayDeleteROI( ImageDisplay imgDisp, ROI roi ) Deletes the roi from this image display. Example
void ImageDisplayExportToFile( ImageDisplay imgDisp, String format, String file_name ) Exports the display to the file 'file_name' using the format 'format'.  
void ImageDisplayGetContrastLimits( ImageDisplay imgDisp, NumberVariable low, NumberVariable high ) Gets the contrast limits of the display.  
void ImageDisplayGetContrastParameters( ImageDisplay imgDisp, NumberVariable bright, NumberVariable contrast ) Gets the parameters for the contrast mode.  
void ImageDisplayGetDisplayedLayers( ImageDisplay imgDisp, NumberVariable start, NumberVariable end ) Gets the layers that are summed into the display.  
void ImageDisplayGetImageAdjustRect( ImageDisplay imgDisp, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Returns the image display outside the image rect  
void ImageDisplayGetImageAdjustRectInView( ImageDisplay imgDisp, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Returns the image display outside the image rect in view coordinates  
void ImageDisplayGetImageRect( ImageDisplay imgDisp, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the bounds of the image in the image display.  
void ImageDisplayGetImageRectInView( ImageDisplay imgDisp, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the bounds of the image in the image display in view coordinates.  
void ImageDisplayRemoveKeyListener( ImageDisplay imgDisp, String listener_key ) Removes the listener script with the tag listener_key from the key listener list.  
void ImageDisplaySetCaptionOn( ImageDisplay imgDisp, Boolean on ) Sets whether to draw captions.  
void ImageDisplaySetComplexMode( ImageDisplay imgDisp, Number mode ) Sets the complex mode of the display.  
void ImageDisplaySetComplexModeRange( ImageDisplay imgDisp, Number range ) Sets the parameter used in converting complex to real.  
void ImageDisplaySetContrastLimits( ImageDisplay imgDisp, Number low, Number hight ) Sets the contrast limits of the display.  
void ImageDisplaySetContrastMode( ImageDisplay imgDisp, Number mode ) Sets the contrast mode.  
void ImageDisplaySetContrastParameters( ImageDisplay imgDisp, Number bright, Number contrast ) Gets the parameters for the contrast mode.  
void ImageDisplaySetDisplayedLayers( ImageDisplay imgDisp, Number start, Number end ) Sets the layers that are summed into the display.  
void ImageDisplaySetDoAutoSurvey( ImageDisplay imgDisp, Boolean do_survey ) Sets whether min and max are determined automatically.  
void ImageDisplaySetImageRect( ImageDisplay imgDisp, Number top, Number left, Number bottom, Number right ) Sets the bounds of the image part of the image display.  
void ImageDisplaySetInputColorTable( ImageDisplay imgDisp, ImageReference clut ) Sets the input color table of the display.  
void ImageDisplaySetIntensityTransformation( ImageDisplay imgDisp, ImageReference itt ) Sets the ITT of the display.  
void ImageDisplaySetMinimumContrast( ImageDisplay imgDisp, Number contrast ) Sets the minimum contrast of the display.  
void ImageDisplaySetROISelected( ImageDisplay imgDisp, ROI roi, Boolean select ) Sets the selection status of the region of interest in the image display.  
void ImageDisplaySetROISelectionStyle( ImageDisplay imgDisp, ROI r, Number style ) Sets the selection style of the roi in the imag display.  
void ImageDisplaySetSurveyTechnique( ImageDisplay imgDisp, Number tech ) Sets the survey technique of the display.  
void ImageDocumentAddImage( ImageDocument imgDoc, ImageReference image ) Adds the given image to the list maintained in the image document.  
void ImageDocumentAddToUserInterface( ImageDocument imgDoc ) Places the image document in the list of user interface documents.  
void ImageDocumentClean( ImageDocument imgDoc ) Marks the image document as clean (doesn't need to be saved).  
void ImageDocumentClose( ImageDocument imgDoc, Boolean saving ) Closes the given image document. If saving is true then asks whether to save it, otherwise just closes it.  
void ImageDocumentDeleteImage( ImageDocument imgDoc, ImageReference image ) Deletes the given image from this image document.  
void ImageDocumentEnsurePlacedOnPage( ImageDocument imgDoc ) Makes sure the document has been layed out on the physical page.  
void ImageDocumentGetMinimumPointSize( ImageDocument imgDoc, NumberVariable x, NumberVariable y ) Gets the size of the minimum point in view coordinates.  
void ImageDocumentGetPageBounds( ImageDocument imgDoc, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the page bounds of the document in page coordinates.  
void ImageDocumentGetPageResolution_72dpi( ImageDocument imgDoc, NumberVariable horz, NumberVariable vert ) Returns the resolution of page coordinates in 72 dots per inch ( returns page units per dot ).  
void ImageDocumentGetPageResolution_Printer( ImageDocument imgDoc, NumberVariable horz, NumberVariable vert ) Returns the resolution of page coordinates in printer pixels ( returns page units per printer pixel ).  
void ImageDocumentGetPaperBounds( ImageDocument imgDoc, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the paper bounds of the document in page coordinates.  
void ImageDocumentGetPreferredViewRect( ImageDocument imgDoc, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets rectangle in view coordinates of the area that is by default displayed in this mode.  
void ImageDocumentGetReferencePointSize( ImageDocument imgDoc, NumberVariable x, NumberVariable y ) Gets the size of the reference point in view coordinates.  
void ImageDocumentGetUnzoomedPointSize( ImageDocument imgDoc, NumberVariable x, NumberVariable y ) Gets the size of the unzoomed point in view coordinates.  
void ImageDocumentGetViewExtent( ImageDocument imgDoc, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the extent in view coordinates of the items visible in the current view mode.  
void ImageDocumentGetViewToWindowTransform( ImageDocument imgDoc, NumberVariable off_x, NumberVariable off_y, NumberVariable scale_x, NumberVariable scale_y ) Returns the transformation from view to screen coordinates.  
void ImageDocumentGetVisibleViewRect( ImageDocument imgDoc, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the view coordinates of the rectangle visible in the view.  
void ImageDocumentHide( ImageDocument imgDoc ) Hides the given image document.  
void ImageDocumentMaximizeRectInView( ImageDocument imgDoc, Number top, Number left, Number bottom, Number right ) Zooms the view so the rectangle is centered and maximal.  
void ImageDocumentRemoveFromUserInterface( ImageDocument imgDoc )
Removes the image document from the list of user interface documents.  
void ImageDocumentSaveToFile( ImageDocument imgDoc, String handler, String fileName ) Saves the image document to the given file name using the I/O handler specified.  
void ImageDocumentSetCurrentViewAsUnzoomed( ImageDocument imgDoc ) Makes the current view the unzoomed view.  
void ImageDocumentSetName( ImageDocument imgDoc, String name ) Sets the name of the image document.  
void ImageDocumentSetRectInView( ImageDocument imgDoc, Number v_t, Number v_l, Number v_b, Number v_r, Number w_t, Number w_l, Number w_b, Number w_r ) Zooms the view so the view rect (v_l,v_t,v_b,v_r) is displayed in the window rect (w_l,w_t,w_b,w_r).  
void ImageDocumentSwitchToImageMode( ImageDocument imgDoc, ImageDisplay imgDisp ) Switches the view of the document to image mode focused on the display 'imgDisp'.  
void ImageDocumentSwitchToPageMode( ImageDocument imgDoc ) Switches the view of the document to page mode.  
void ImageDocumentUpdateDisplay( ImageDocument imgDoc ) Updates the display of the image document.  
void ImageGetDimensionCalibration( ImageReference, Number dimension, NumberVariable origin, NumberVariable scale, String units, Number calibrationFormat ) Gets the calibration information of the given dimension: Example1 for summing the counts of a spectrum.  
void ImageGetDimensionUnitInfo( ImageReference, Number dimension, String canon_units, NumberVariable power ) Copies the unit string of the given dimension of image to the buffer.  
void ImageGetIntensityUnitInfo( ImageReference, String canon_units, NumberVariable power ) Copies the unit string of image's intensity to the buffer.  
void ImageSetDescriptionText( ImageReference img, String description ) Sets the description text associated with the image.  
void ImageSetDimensionCalibration( ImageReference, Number dimenstion, Number origin, Number scale, String unitString, Number calibrationFormat ) Sets the calibration for the given dimension.  
void ImageSetDimensionCalibrationDisplayed( ImageReference im, Number dim, Boolean do_display ) Sets whether or not to display the 'dim'th dimension in calibrated units to 'do_display'.  
void ImageSetDimensionOrigin( ImageReference, Number dimension, Number origin ) Sets the origin of the given dimension of image.  
void ImageSetDimensionScale( ImageReference, Number dimension, Number scale ) Sets the scale of the given dimension of image.  
void ImageSetDimensionUnitInfo( ImageReference, Number dimension, String canon_units, Number power ) Sets the unit string of the given dimension of image.  
ImageSetDimensionUnitString(0, "nm" )   Example
void ImageSetDimensionUnitString( ImageReference, Number dimension, String units ) Sets the unit string of the given dimension of image.  
void ImageSetIntensityCalibrationDisplayed( ImageReference im, Boolean do_display ) Sets whether or not to display the intensity in calibrated units to 'do_display'.  
void ImageSetIntensityOrigin( ImageReference, Number origin ) Sets the origin of image's intensity. Example
void ImageSetIntensityScale( ImageReference, Number scale ) Sets the scale of image's intensity. Example
void ImageSetIntensityUnitInfo( ImageReference, String canon_units, Number power ) Sets the unit string of image's intensity.  
void ImageSetIntensityUnitString( ImageReference, String units ) Sets the unit string of image's intensity. Example
void ImageSetName( ImageReference img, String name ) Sets the name of the image.  
void ImageSwapImageDataByteOrder( ImageReference ) Swaps the byte order for each long word in the image. ABCD become DCBA.  
void LinePlotImageDisplayGetTrackingStyle( LinePlotImageDisplay lpid, NumberVariable track_style_x, NumberVariable track_style_y ) Gets the tracking style of the line plot.  
void LinePlotImageDisplaySetBackgroundOn( LinePlotImageDisplay lpid, Boolean on ) Sets whether to erase the background.  
void LinePlotImageDisplaySetBaseIntensity( LinePlotImageDisplay lpid, Number base_intensity ) Sets the base intensity of the line plot.  
void LinePlotImageDisplaySetDisplayedChannels( LinePlotImageDisplay lpid, Number leftChannel, Number rightChannel ) Sets the leftmost and rightmost displayed channels.  
void LinePlotImageDisplaySetDoAutoSurvey( LinePlotImageDisplay lpid, Boolean doAutoSurveyLow, Boolean doAutoSurveyHigh ) Sets whether to do auto-survey on the high and low intensity limits. E.g. Example1, Example2.
void LinePlotImageDisplaySetFilled( LinePlotImageDisplay lpid, Boolean on ) Sets whether to fill the lineplot.  
void LinePlotImageDisplaySetFrameOn( LinePlotImageDisplay lpid, Boolean on ) Sets whether to draw the frame.  
void LinePlotImageDisplaySetGridOn( LinePlotImageDisplay lpid, Boolean on ) Sets whether to draw the grid.  
void LinePlotImageDisplaySetSlice( LinePlotImageDisplay lpid, Number slice ) Sets the slice currently displayed at the bottom.  
void LinePlotImageDisplaySetSliceComponentColor( LinePlotImageDisplay lpid, Number slice_index, Number comp_index, Number r, Number g, Number b ) Sets the color of the 'comp_index'th component of the 'slice_index'th slice. E.g. Set line color to red: ( 0, 0, 1, 0, 0 ); set fill color to yellow: ( 0, 1, 0.9, 0.9, 0 ), set fill color to green: (0, 1, 0, 1, 0). E.g. Example.  
void LinePlotImageDisplaySetSliceDrawingStyle( LinePlotImageDisplay lpid, Number slice_index, Number style ) Sets the drawing style of the 'slice_index'th slice. E.g. Example.  
void LinePlotImageDisplaySetTrackingStyle( LinePlotImageDisplay lpid, Number track_style_x, Number track_style_y ) Sets the tracking style of the line plot.  
void RasterImageDisplayAddThresholdToMask( RasterImageDisplay rid, ImageReference mask, Number top, Number left, Number bottom, Number right ) Sets the points in mask to 1 if they lie within the threshold.  
void RasterImageDisplayGetThresholdLimits( RasterImageDisplay rid, NumberVariable low, NumberVariable high ) Gets the threshold limits of the display.  
void RasterImageDisplaySetThresholdLimits( RasterImageDisplay rid, Number low, Number high ) Sets the threshold limits of the display.  
void RasterImageDisplaySetThresholdOn( RasterImageDisplay rid, Boolean on ) Sets whether the thresholding overlay is on or off.  
void ROIAddToMask( ROI roi, ImageReference mask, Number top, Number left, Number bottom, Number right ) Add the region of interest to the image within the bounds of the specified rectangle.  
void ROIAddVertex( ROI roi, Number x, Number y ) Add a vertex with the given coordinates to the region of interest.  
void ROIClearVertices( ROI roi ) Remove all vertices from the region of interest.  
void ROIDeleteVertex( ROI roi, Number index ) Delete the given vertex from the region of interest.  
void ROIGetColor( ROI roi, NumberVariable r, NumberVariable g, NumberVariable b ) Stores the color of the region of interest into the variables. Each number will be in the range of 0 to 1.  
void ROIGetLine( ROI roi, NumberVariable sx, NumberVariable sy, NumberVariable ex, NumberVariable ey ) Fill in the start and end points of the line represented by the region of interest.  
void ROIGetPoint( ROI roi, NumberVariable x, NumberVariable y ) Return the coordinates of the point represented by this region of interest.  
void ROIGetRange( ROI roi, NumberVariable start, NumberVariable end ) Fills in the start and end columns of the range represented by the region of interest.  
void ROIGetRectangle( ROI roi, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Fill in the coordinates of the rectangle represented by the region of interest. Example
void ROIGetVertex( ROI roi, Number index, NumberVariable x, NumberVariable y ) Return the coordinates of the given vertex of the region of interest.  
void ROIInsertVertex( ROI roi, Number before, Number x, Number y ) Insert a vertex with the given coordinates before the indicated vertex of the region of interest.  
void Test_AddTestAnnotation( Component c, Number kind, Number top, Number left, Number bottom, Number right )    
void Test_AssignToImageRef( ImageVariable img )    
void Test_AssignUniformRandom( ImageReference img )    
void Test_CallFunction_ImageParam( Function func, ImageReference img )    
void Test_CallFunctionOnImage( ImageReference img, String sig )    
void Test_DoubleArg( Number d )    
void Test_ForceImageUpdate( ImageReference img )    
void Test_ForceWindowUpdate( DocumentWindow win )    
void Test_ImageReferenceCounting( )    
void Test_OperatorDelete( Number )    
void Test_ResetCounter( )    
void Test_SetGlobalFunction( Function func )    
void Test_SurveyImage( ImageReference image, ImageDisplay imgDisp, Number survey_style, Number complex_mode, NumberVariable min, NumberVariable max )    
void Test_ThrowCPPException( Number index )    
void TextAnnotationGetFixedPoint( Component comp, NumberVariable x, NumberVariable y ) Gets the fixed point of the text annotation.  
void TextAnnotationSetAlignment( Component comp, Number alignment ) Sets the alignment of the text in the text annotation.  
void TextAnnotationSetFixedPoint( Component comp, Number x, Number y ) Sets the fixed point of the text annotation.  
void TextAnnotationSetResizeStyle( Component comp, Number style ) Sets the resize style of the text annotation.  
void TextAnnotationSetText(Component comp, String text) Sets the text of a text annotation.  
void Throw( Number exception ) Throws an exception by number.  
void Throw( String exception ) Throws an exception by string.  
void TransferTagsAndApplyDataBar( ImageReference ) Transfer tags and apply data bar to the image.  
void TransformPointFromImageToWindow( ImageReference image, Number x_image, Number y_image, NumberVariable x_window, NumberVariable y_window )    
void UnregisterClass( String class_name )    
void UnregisterCustomMenu( Number menuHandlerToken ) Unregister a custom menu. See the SDK documentation for more information.  
void UnregisterObjectListener( Number object, Number id ) Remove object listener from OM object. See the SDK documentation for more information.  
void UpdateDisplay( ImageReference, Number startRow, Number endRow ) Update the image display portion that displays the image rows from startRow to endRow.  
void UpdateImage( ImageReference ) Update the image immediately.  
void UpdatePictureAnnotation( ImageReference, Number annotationID, ! PicHandle ) Update the picture annotation indicated by the annotationID within the image with the new picHandle.  
void UpdateTimeBarPercentage( Number percentage ) Updates an open time bar to the given percentage.  
void while( RealNumber, Expression )    
void WindowClose( DocumentWindow window, Boolean verify ) Closes the window, prompting the user if 'verify' is true.  
void WindowGetContentBounds( DocumentWindow window, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the bounding rectangle of the content area of the 'window'.  
void WindowGetContentPosition( DocumentWindow window, NumberVariable x, NumberVariable y ) Gets the position of the top-left corner of the content area of the 'window'.  
void WindowGetContentSize( DocumentWindow window, NumberVariable x, NumberVariable y ) Gets the size of the content area of the 'window'.  
void WindowGetFrameBounds( DocumentWindow window, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right ) Gets the bounding rectangle of the frame area of the 'window'.  
void WindowGetFramePosition( DocumentWindow window, NumberVariable x, NumberVariable y ) Gets the position of the top-left corner of the frame area of the 'window'.  
void WindowGetFrameSize( DocumentWindow window, NumberVariable x, NumberVariable y ) Gets the size of the frame area of the 'window'.  
void WindowGetMousePosition( DocumentWindow window, NumberVariable x, NumberVariable y ) Gets the current position of the mouse in the windows coordinate system.  
void WindowHide( DocumentWindow window ) Hides the window.  
void WindowSelect( DocumentWindow window ) Brings 'window' to the front.  
void WindowSendBehind( DocumentWindow window, DocumentWindow behind_window ) Sends 'window' behind 'behind_window'.  
void WindowSetContentBounds( DocumentWindow window, Number top, Number left, Number bottom, Number right ) Sets the bounding rectangle of the content area of the 'window'.  
void WindowSetContentPosition( DocumentWindow window, Number x, Number y ) Sets the position of the top-left corner of the content area of the 'window'.  
void WindowSetContentSize( DocumentWindow window, Number x, Number y ) Sets the size of the content area of the 'window'.  
void WindowSetFrameBounds( DocumentWindow window, Number top, Number left, Number bottom, Number right ) Sets the bounding rectangle of the frame area of the 'window'.  
void WindowSetFramePosition( DocumentWindow window, Number x, Number y ) Sets the position of the top-left corner of the frame area of the 'window'. Example
void WindowSetFrameSize( DocumentWindow window, Number x, Number y ) Sets the size of the frame area of the 'window'.  
void WindowSetTitle( DocumentWindow window, String title ) Sets the title of the window.  
void WindowShow( DocumentWindow window ) Shows the window.  
void WindowUpdate( DocumentWindow window ) Updates 'window's display.  
void TextAnnotationSetText( Component comp, Number encoding, String text ) Sets the text of a text annotation.  
crystal = 150*(1 + 1*( sin(2*pi*icol/SpacingX) *sin(2*pi*irow/spacingY) + Random()/(SNR*2000)))
crystal += (Random() < xRays/(width*height)) ? 2000 : 0
Generate the image with a random noise component added (the random number is in the range 0 to 2000). If the random number is less than xrays/(width*height), then add 2000 to the pixel; otherwise, leave it as is. HRTEM
     

Boolean !=( String, String )
Returns true if the two strings are not equal character-by-character.

 

Image :=( ImageReference image, ! )


DocumentWindow =( DocumentWindow, ! )

DocumentWindow =( DocumentWindow, DocumentWindow )


ImageDisplay =( ImageDisplay, Component )

ImageDisplay =( ImageDisplay, ! )

ImageDisplay =( ImageDisplay, ImageDisplay )

Component =( Component, ! )

Component =( Component, Component )

SurfacePlotImageDisplay =( SurfacePlotImageDisplay dst, SurfacePlotImageDisplay spid )

SurfacePlotImageDisplay =( SurfacePlotImageDisplay dst, ! )

SurfacePlotImageDisplay =( SurfacePlotImageDisplay dst, ImageDisplay id )

RasterImageDisplay =( RasterImageDisplay dst, ImageDisplay id )

RasterImageDisplay =( RasterImageDisplay dst, ! )

RasterImageDisplay =( RasterImageDisplay dst, RasterImageDisplay rid )

Boolean ==( String, String )
Returns true if the two strings are equal character-by-character.

 

 

 

 



Number asc( String )
Returns the numeric value in ascii of the first character of the string.

Number average( RealImageExpression image )
Return the average pixel value of the image expression.


Boolean ChooseMenuItem( String menu, String subMenu, String item )
Choose the given menu item.

 


Boolean ClipboardGetAsPicture( NumberVariable picture )
Gets the contents of the clipboard as a picture, if possible, and returns true if successful.

Boolean ClipboardGetAsString( Number encoding, StringVariable str )
Gets the contents of the clipboard as a string with the given encoding, if possible, and returns true if successful.


Boolean CommandDown( void )
Returns 1 if the command key is down and 0 otherwise.

 

Component ComponentNullify( ! )

Number CountAllImages( void )
Returns the number of images.



Number CountDocumentWindows( void )
Returns the number of document windows.


Number CountFloatingWindows( void )
Returns the number of floating windows.


Number CountListEntries( Image, String tagPath )
Returns the number of tags within the given image tag list or group indicated by tagPath.

Number CountPersistentListEntries( String tagPath )
Returns the number of tags within the given persistent tag list or group indicated by tagPath.

Number CountScreens( void )
Returns the number of screens.

Number CountScriptFunctions( String fnName )
Returns the number of script functions having name 'fnName'.


Number CreatePictureAnnotation( Image, Number top, Number left, Number bottom, Number right, ! PicHandle )
Create a picture annotation in the image with the coordinates [top, left, bottom, right] from the picHandle. Return the new annotation's ID.

Boolean DoesDirectoryExist( String dirName )
Returns 'true' if the named directory exists

Boolean DoesFileExist( String dirName )
Returns 'true' if the named file exists

Boolean DoesFunctionExist( String fnName )
Determines if the given function exists.

Boolean DoesImageExist( Number imageID )
Determine if the image with imageID exists and returns 1 if it does; return 0 otherwise.

Boolean EditorWindowPrint( DocumentWindow window )
Prints the editor window.

Number ExecuteScriptFile( String fileName )
Executes the script file indicated by fileName and returns the exit value of that script. A script may specify a specific exit value by exiting with the exit(n) function. If a script does not use the exit() function the exit value will be 0.

Number ExecuteScriptString( String text )
Executes the script text and returns the exit value of that script. A script may specify a specific exit value by exiting with the exit(n) function. If a script does not use the exit() function the exit value will be 0.

Image FindFrontImage( void )
Returns the front image. Doesn't throw exceptions.

Image FindImageByID( Number id )
Returns the image having the given id, or an invalid image of no image has that id.

Image FindImageByLabel( String label )
Returns the image having the given label, or an invalid image if no such image exists.

Image FindImageByName( String name )
Returns the image having the given name, or an invalid image of no image has that name.

 

 
Image FirstImage( void )
Find the first image.


Number FM_GetVarianceFloat( Image )
Return the variance of the image. No data type checking is performed. This function uses the array processor if present.


Boolean GetAnnotationComplexNumberNote( Image, Number annotationID, String noteLabel, ComplexNumberVariable noteValue )
Stores the value of the annotation note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetAnnotationNumberNote( Image, Number annotationID, String noteLabel, NumberVariable noteValue )
Stores the value of the annotation note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.



Boolean GetAnnotationRGBNumberNote( Image, Number annotationID, String noteLabel, RGBNumberVariable noteValue )
Stores the value of the annotation note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetAnnotationStringNote( Image, Number annotationID, String noteLabel, StringVariable noteValue )
Copies the value of the annotation note with the label noteLabel into the noteBuffer variable. Returns 1 if the note exists returns 0 otherwise.

 

Boolean GetApplicationInfo( Number info_kind, NumberVariable info )
Get application info. For 'info_kind == 0', bit 2 of '*info' is set for demo versions.

Boolean GetBoolean( String prompt, Boolean initalValue, NumberVariable result )
Puts up a dialog with the given prompt and allows the user to enter Boolean. The initial value is passed as a parameter and the result in stored in result. Returns 1 for OK and 0 for Cancel.

Boolean GetCalibrationDialog( Number aw, Number ah, NumberVariable xs, NumberVariable ys, String initialUnitString, StringVariable unitString )
Present the calibration dialog to the user. The calibrating pixel dimensions are passed as the [aw,ah] parameters. The resulting calibration is stored into the [xs,ys] parameters. The initial unit string is passed in and the resulting unit string is stored into the unitString variable.Returns 1 for OK and 0 for Cancel.


Boolean GetFourImages( String title, ImageVariable image1, ImageVariable image2, ImageVariable image3, ImageVariable image4 )
Puts up a dialog and allows the user to choose four images. Returns 1 for Ok and 0 for Cancel.

Boolean GetFourImagesWithPrompt( String prompt, String title, ImageVariable image1, ImageVariable image2, ImageVariable image3, ImageVariable image4 )
Puts up a dialog with the given prompt and allows the user to choose four images. Returns 1 for Ok and 0 for Cancel.

Boolean GetFourLabeledImagesWithPrompt( String prompt, String title, String label1, ImageVariable image1, String label2, ImageVariable image2, String label3, ImageVariable image3, String label4, ImageVariable image4 )
Puts up a dialog with the given prompt and allows the user to choose four images. Returns 1 for Ok and 0 for Cancel.


ImageReference GetImageFromID( Number imageID )
Return the image corresponding the imageID.

Boolean GetImageFromID( ImageVariable, Number imageID )
Store the image corresponding the imageID into the image variable. Return 1 if one is found; return 0 otherwise.

Number GetImageID( Image )
Return the id of the image.

Boolean GetInteger( String prompt, Number initalValue, NumberVariable result )
Puts up a dialog with the given prompt and allows the user to enter an integer. The initial value is passed as a parameter and the result in stored in result. Returns 1 for OK and 0 for Cancel.

Boolean GetInversionMode( Image )
Return the contrast inversion mode of the image (1=inverted, 0=not inverted).

Number GetKey( void )
Returns the key that was last pressed.

 

ImageReference GetNamedImage( String name )
Return the image with the image document name.

Boolean GetNamedImage( ImageVariable, String name )
Store the image with the image document name into the image variable. Return 1 if one is found; return 0 otherwise.

Number GetNextImageID( Number id )
Return the id of the image window following the image with the given id.

Boolean GetNoteState( Image, String noteLabel, NumberVariable hidden )
Stores whether the image note with the label noteLabel is in the copy-to-image list into the copyToImage parameter. The hidden parameter is no longer used.



DocumentWindow GetNthDocumentWindowOfType( Number type, Number index )
Returns the 'index'th document window of type 'type'.

Number GetNthImageID( Number n )
Return the id of the nth image (number from 0). The images are in no particular order.

Boolean GetNthPersistentNoteTitle( String tagPath, Number index, StringVariable noteValue )
Stores the title of the tag with the given index from the persistent tag group indicated by tagPath into noteValue.


Boolean GetNumber( String prompt, Number initalValue, NumberVariable result )
Puts up a dialog with the given prompt and allows the user to enter a number. The initial value is passed as a parameter and the result in stored in result. Returns 1 for OK and 0 for Cancel.


Number GetOSTickCount( void )
Return a tick count appropriate for the operating system.

Number GetOSTicksPerSecond( void )
Return the number of ticks per second of a tick count appropriate for the operating system.

Boolean GetPersistentComplexNumberNote( String noteLabel, ComplexNumberVariable noteValue )
Stores the value of the persistent note with label noteLabel into the noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentLongNote( String noteLabel, NumberVariable noteValue )
Stores the value of the persistent note with label noteLabel into the noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentNoteState( String noteLabel, NumberVariable copyToImage, NumberVariable hidden )
Stores whether the note with the label noteLabel is in the copy-to-image list into the copyToImage parameter. The hidden parameter is no longer used.



Boolean GetPersistentPointNote( String noteLabel, NumberVariable x, NumberVariable y )
Gets the value of the persistent note with label noteLabel into the x and y variables. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentRectNote( String noteLabel, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right )
Gets the value of the persistent note with label noteLabel into the top, left, bottom, and right variables. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentRGBNumberNote( String noteLabel, RGBNumberVariable noteValue )
Stores the value of the persistent note with label noteLabel into the noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentStringNote( String noteLabel, StringVariable noteBuffer )
Copies the value of the persistent note with the label noteLabel into the noteBuffer variable. Returns 1 if the note exists returns 0 otherwise.

Number GetPixel( RealImage, Number x, Number y )
Return the pixel in the image at [x,y].

Number GetPlatformInfo( Number info )
Return platform info. info=1 is general platform (1=MacOS,2=Windows).

Boolean GetPointNote( Image, String noteLabel, NumberVariable x, NumberVariable y )
Gets the value of the image note with label noteLabel into the x and y variables. Returns 1 if the note exists returns 0 otherwise.

Number GetProcessID( void )
Returns the current process id.

 

 
Boolean GetRectNote( Image, String noteLabel, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right )
Gets the value of the image note with label noteLabel into the top, left, bottom, and right variables. Returns 1 if the note exists returns 0 otherwise.


Boolean GetRGBColorDialog( String prompt, RGBNumber defaultColor, RGBNumberVariable result )
Puts up the Color Picker dialog with the given prompt and allows the user to choose a color. The default color is passed in and the resulting color is stored in the result parameter. Returns 1 for OK and 0 for Cancel.

Boolean GetRGBNumberNote( Image, String noteLabel, RGBNumberVariable noteValue )
Stores the value of the image note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetSelection( Image, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right )
Stores the coordinates (in pixels) of the image's selection into the top, left, bottom, and right variables. Returns 1 if there was a selection and 0 if there wasn't.

Boolean GetString( String prompt, String initalValue, StringVariable result )
Puts up a dialog with the given prompt and allows the user to enter a string. The initial value is passed as a parameter and the result in stored in result. Returns 1 for OK and 0 for Cancel.

Boolean GetStringFromList( Image, String tagPath, Number index, StringVariable noteBuffer )
Copies the string with the given index from the image tag list indicated by tagPath to noteBuffer.

Boolean GetStringFromPersistentList( String tagPath, Number index, StringVariable noteBuffer )
Copies the string with the given index from the persistent tag list indicated by tagPath to noteBuffer.

Boolean GetStringNote( Image, String noteLabel, StringVariable noteValue )
Copies the value of the image note with the label noteLabel into the noteBuffer variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetThreeImages( String title, ImageVariable image1, ImageVariable image2, ImageVariable image3 )
Puts up a dialog and allows the user to choose three images. Returns 1 for Ok and 0 for Cancel.

Boolean GetThreeImagesWithPrompt( String prompt, String title, ImageVariable image1, ImageVariable image2, ImageVariable image3 )
Puts up a dialog with the given prompt and allows the user to choose three images. Returns 1 for Ok and 0 for Cancel.

Boolean GetThreeLabeledImagesWithPrompt( String prompt, String title, String label1, ImageVariable image1, String label2, ImageVariable image2, String label3, ImageVariable image3 )
Puts up a dialog with the given prompt and allows the user to choose three images. Returns 1 for Ok and 0 for Cancel.

Number GetTicks( void )
Return the MacOS system tick count.

Number GetTicksPerSecond( void )
Return the number of ticks per second.

Boolean GetTwoImages( String title, ImageVariable image1, ImageVariable image2 )
Puts up a dialog and allows the user to choose two images. Returns 1 for Ok and 0 for Cancel.

Boolean GetTwoImagesWithPrompt( String prompt, String title, ImageVariable image1, ImageVariable image2 )
Puts up a dialog with the given prompt and allows the user to choose two images. Returns 1 for Ok and 0 for Cancel.

Boolean GetTwoLabeledImagesWithPrompt( String prompt, String title, String label1, ImageVariable image1, String label2, ImageVariable image2 )
Puts up a dialog with the given prompt and allows the user to choose two images. Returns 1 for Ok and 0 for Cancel.

Number GetUnitsH( Image, Number x )
Return the horizontal pixels x in calibrated units.

Number GetUnitsV( Image, Number y )
Return the vertical pixels y in calibrated units.


Number GetZoom( Image )
Return the zoom of the image display.

Boolean HasAcquisitionDaemon( Image )
Returns 1 if the image has an attached daemon and returns 0 otherwise.

Number ImageData_GetSeed( Number imageDataID )
Ask the array processor manager for the data seed of the image. See the SDK documentation for more information.

Boolean ImageData_IsLocalCopyValid( Number imageDataID )
Ask the array processor manager if the local copy is valid or not. See the SDK documentation for more information.

ImageDisplay ImageDisplayNullify( ! )


Image ImageNullify( ! )

Number InstallScriptLibraryFile( String fileName )
Loads the script file indicated by fileName, executes it, and publishes any functions contained inside. Always returns 0.
 
Number integrate( RealImageExpression )
Return the sum of all pixel values of the image expression.

 
Number len( String )
Returns the length of a string.


Number MatrixDeterminant( RealImage a )
Return the matrix determinant number of matrix image a.
 
Number max( RealImageExpression )
Return the maxmimum pixel within the image expression.

 
Number max( RealImageExpression, NumberVariable x, NumberVariable y )
Finds the maximum pixel in the image, stores the coordinates of that pixel into x and y, and returns the value of the pixel.

 


Number MeanSquare( RealImageExpression )
Return the mean square of all pixel values of the image expression.

 

 

Number min( RealImageExpression )
Return the minimum pixel within the image expression.

Number min( RealImageExpression, NumberVariable x, NumberVariable y )
Finds the minimum pixel in the image, stores the coordinates of that pixel into x and y, and returns the value of the pixel.

Component NewArrowAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new arrow annotation.

Component NewBoxAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new box annotation.

Component NewComponent( Number type, Number f1, Number f2, Number f3, Number f4 )
Creates a new annotaiton of type 'type'

Component NewDoubleArrowAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new double arrow annotation.

Component NewGroupAnnotation( void )
Creates a new group annotation.

Image NewImage( String title, Number type, Number d0, Number d1, Number d2, Number d3 )
Creates a 4D image of type 'type' and size [d0,d1,d2,d3] with the given title.

Image NewImage( String title, Number type, Number d0, Number d1, Number d2 )
Creates a 3D image of type 'type' and size [d0,d1,d2] with the given title.

Image NewImage( String title, Number type, Number d0, Number d1 )
Creates a 2D image of type 'type' and size [d0,d1] with the given title.

Image NewImage( String title, Number type, Number d0 )
Creates a 1D image of type 'type' and size [d0] with the given title.


Component NewLineAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new line annotation.






Component NewOvalAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new oval annotation.

Component NewPictureAnnotation( Number top, Number left, Number bottom, Number right, Number picture )
Creates a new picture annotation.


DocumentWindow NewScriptWindow( String title, Number top, Number left, Number bottom, Number right )
Creates a new editor window.

DocumentWindow NewScriptWindowFromFile( String file_name )
Opens a file into a script window.

Number NewSemaphore( void )
Create a semaphore. Used only with background processing.

 

 
Component NewTextAnnotation( Number left, Number top, String text, Number size )
Creates a new text annotation.

Component NewTextAnnotation( Number left, Number top, Number encoding, String text, Number size )
Creates a new text annotation.

Image NextImage( Image )
Find the next image.

Boolean OkCancelDialog( String prompt )
Puts up a dialog with the given prompt. Returns 1 for OK and 0 for Cancel.

ImageReference OpenImage( String fileName )
Open the image with the filename. Returns the opened image.


Boolean OptionDown( void )
Returns 1 if the option key is down and 0 otherwise.

Number Pi( void )
Return an approximation of pi.

Number Polynomial( RealImageExpression, Number x )
Return the polynomial a0 + a1*x + a2*x*x ... where x is the free variable and a0 ... aN are the pixels of the image.

Number product( RealImageExpression )
Return the product of all pixel values of the image expression.
 
RasterImageDisplay RasterImageDisplayNullify( ! )

Number RegisterCustomMenu( Number menuHandler )
Register a custom menu. See the SDK documentation for more information.


Number RegisterObjectListener( Number object, Number proc, Number refCon )
Add object listener to OM object. See the SDK documentation for more information.



Boolean ShiftDown( void )
Returns 1 if the shift key is down and 0 otherwise.


Number sum( RealImageExpression )
Return the sum of all pixel values of the image expression.

SurfacePlotImageDisplay SurfacePlotImageDisplayNullify( ! )


Number TextAnnotationGetResizeStyle( Component comp )
Gets the resize style of the text annotation.

Number TickCount( void )
Return the MacOS system tick count.

 

 

 
ImageReference TryToUse( String name, Number width, Number height, Number dataType, Number h, Number v, NumberVariable fresh )
Look for an image with the given name, width, height, dataType, and position [h,v]. Return it if found and create it if not. Store 1 into fresh if it was created and 0 if not.

Boolean TwoButtonDialog( String prompt, String acceptLabel, String rejectLabel )
Puts up a dialog with the given prompt and two buttons labeled according to the parameters. Returns 1 for the acceptLabel button and false for the other one.

 
Number val( String )
Returns the numeric value of a string.



Number variance( Image )
Return the variance of the image.

 

DocumentWindow WindowNullify( ! )

 

 
Number XX_GetProcessKey( Number pid )
Return a keystroke associated with the background process indicated by pid.

DigitalMicrograph Script Functions

 

 
Boolean !( Boolean v1 )

Boolean !=( String, String )
Returns true if the two strings are not equal character-by-character.

 

Boolean !=( Number v1, Number v2 )

Boolean &&( Boolean v1, Boolean v2 )

 

Number *( Number v1, Number v2 )

Number **( Number v1, Number v2 )

Number *=( NumberVariable dst, Number src )

 

Number +( Number v1, Number v2 )

Number ++( NumberVariable v1 )

Number ++!( NumberVariable v1 )

 

Number +=( NumberVariable dst, Number src )

Number -( Number v1 )

Number -( Number v1, Number v2 )

Number --( NumberVariable v1 )

Number --!( NumberVariable v1 )

Number -=( NumberVariable dst, Number src )

Number /( Number v1, Number v2 )

Number /=( NumberVariable dst, Number src )

ImageReference :=( ImageVariable image, ! )


Boolean <( Number v1, Number v2 )

Boolean <=( Number v1, Number v2 )

SurfacePlotImageDisplay =( SurfacePlotImageDisplay dst, ImageDisplay id )

SurfacePlotImageDisplay =( SurfacePlotImageDisplay dst, ! )

SurfacePlotImageDisplay =( SurfacePlotImageDisplay dst, SurfacePlotImageDisplay spid )

DocumentWindow =( DocumentWindow, ! )

DocumentWindow =( DocumentWindow, DocumentWindow )


ImageDisplay =( ImageDisplay, Component )

ImageDisplay =( ImageDisplay, ! )

ImageDisplay =( ImageDisplay, ImageDisplay )

Component =( Component, ! )

Component =( Component, Component )

 
ImageExpression =( lvalue ImageExpression, ImageExpression )

ImageExpression =( lvalue BasicImage, ImageExpression )

Number =( NumberVariable dst, Number src )

 

 

 
Throwable =( Throwable dst, ! )
Assigns NULL to dst throwable.

Throwable =( Throwable dst, Throwable src )
Assigns src throwable to dst throwable.

Function =( Function dst, ! )
Assigns NULL to dst function.

Function =( Function dst, Function src )
Assigns src function to dst function.

ScriptObject =( ScriptObject scriptObject1, ! )

ScriptObject =( ScriptObject scriptObject1, ScriptObject scriptObject2 )



RasterImageDisplay =( RasterImageDisplay dst, ! )

RasterImageDisplay =( RasterImageDisplay dst, RasterImageDisplay rid )
 

Boolean ==( Number v1, Number v2 )

Boolean ==( String, String )
Returns true if the two strings are equal character-by-character.

 

Number ?( Boolean cond, Number trueval, Number falseval )

Number [( String, Number index )
Returns the numeric value in the string's encoding of the first character of the string.
 

 
BasicImage [( BasicImage, Number x, Number y )
Returns a pixel in the given real image at the position [x,y]. This operator is equivalent to Index(image,x,y).

BasicImage [( BasicImage, Number x, Number y, Number z )
Returns a pixel in the given real image at the position [x,y,z]. This operator is equivalent to Index(image,x,y,z).

BasicImage [( BasicImage, Number top, Number left, Number bottom, Number right )
Returns the sub-area image specified by the coordinates [top,left,bottom,right].

BasicImage [( BasicImage, Number y1, Number x1, Number z1, Number y2, Number x2, Number z2 )
Returns the sub-area image specified by the coordinates [x,y] where x and y are 3-D positions.

 

Boolean ||( Boolean v1, Boolean v2 )

Number AddDaemonHack( ImageReference, Number table )
Add a daemon component for the image. See the SDK documentation for more information.

ScriptObject alloc( String class_name )



Number average( RealImageExpression image )
Return the average pixel value of the image expression.

Number ceil( Number v1 )


Boolean ChooseMenuItem( String menu, String subMenu, String item )
Choose the given menu item.

Function ClassAddMethod( String class_name, Function method )

ScriptObject ClassNewObject( String class_name )


Number clip( Number val, Number min_, Number max_ )

Boolean ClipboardGetAsPicture( NumberVariable picture )
Gets the contents of the clipboard as a picture, if possible, and returns true if successful.

Boolean ClipboardGetAsString( String str )
Gets the contents of the clipboard as a string with the given encoding, if possible, and returns true if successful.

Boolean CommandDown( )
Returns 1 if the command key is down and 0 otherwise.

Component ComponentAddNewComponent( Component parent, Number type, Number f1, Number f2, Number f3, Number f4 )
Creates a new annotaiton of type 'type' and adds it to 'parent'

Component ComponentClone( Component comp, Boolean doDeepCopy )
Returns a identical copy of the component and all its sub-components, copying associated images if 'doDeepCopy' is true.




Boolean ComponentGetControlPoint( Component comp, Number loc, NumberVariable x, NumberVariable y )
Returns the value '(x,y)' associated with the control point, and returns 'true' if the control point is valid

Component ComponentGetDescendentByID( Component comp, Number ID )
Returns the component child of 'comp' with id 'ID'.

Number ComponentGetDrawingMode( Component comp )
Gets the drawing mode of the image doucment component.

Number ComponentGetFillMode( Component comp )
Gets the fill mode of the image doucment component.

Number ComponentGetFontAttributes( Component comp )
Gets the attributes of the component's font.


Number ComponentGetFontSize( Component comp )
Gets the point size of the component's font.

Number ComponentGetID( Component annot )
Gets the unique identifier of the annotation in the image document.



Component ComponentGetNthChildOfType( Component comp, Number type, Number index )
Returns the nth sub-component of type 'type'.

Component ComponentGetParentComponent( Component comp )
Gets the parent component of 'comp', if any.

ImageDisplay ComponentGetParentImageDisplay( Component comp )
Gets the parent image display of the 'comp', if any.

Number ComponentGetType( Component annot )
Gets the type of the annotation.

Boolean ComponentIsOfType( Component annot, Number type )
Gets the type of the annotation.

Boolean ComponentIsSelected( Component comp )
Returns whether the component is selected.

Boolean ComponentIsValid( Component annot )
Returns true if 'annot' points to a valid object.

Component ComponentNullify( ! )

 
Boolean ControlDown( )
Returns 1 if the control key is down and 0 otherwise.

ImageDisplay Convert_Component_ImageDisplay( Component annot )

 

ImageExpression ConvertBiNie( BasicImage )

ImageExpression ConvertBiNieLValue( BasicImage )

 
BasicImage ConvertNieNi( ImageExpression )

Number cos( Number v1 )

Number cosh( Number v1 )

Number CountAllImages( )
Returns the number of images.



Number CountDocumentWindows( )
Returns the number of document windows.




Number CountFloatingWindows( )
Returns the number of floating windows.


Number CountListEntries( ImageReference, String tagPath )
Returns the number of tags within the given image tag list or group indicated by tagPath.

Number CountPersistentListEntries( String tagPath )
Returns the number of tags within the given persistent tag list or group indicated by tagPath.
 
Number CountScreens( )
Returns the number of screens.
 
Number CountScriptFunctions( String fnName )
Returns the number of script functions having name 'fnName'.
 

ImageReference CreateMaskFromAnnotations( RasterImageDisplay rid, Number filter_length, Boolean is_opaque, NumberVariable has_mask )


Number CreatePictureAnnotation( ImageReference, Number top, Number left, Number bottom, Number right, ! PicHandle )
Create a picture annotation in the image with the coordinates [top, left, bottom, right] from the picHandle. Return the new annotation's ID.


Boolean DoesClassExist( String class_name )

Boolean DoesDirectoryExist( String dirName )
Returns 'true' if the named directory exists

Boolean DoesFileExist( String dirName )
Returns 'true' if the named file exists

Boolean DoesFunctionExist( String fnName )
Determines if the given function exists.

Boolean DoesImageExist( Number imageID )
Determine if the image with imageID exists and returns 1 if it does; return 0 otherwise.

Boolean EditorWindowPrint( DocumentWindow window )
Prints the editor window.

 
ImageExpression EvaluateXneEtc_NneFnToXieEtc_NieFn( NumberExpression, ImageExpression... )


Number ExecuteScriptFile( String fileName, Number script_index )
Executes the script file indicated by fileName and returns the exit value of that script. A script may specify a specific exit value by exiting with the exit(n) function. If a script does not use the exit() function the exit value will be 0.

Number ExecuteScriptFile( String fileName )
Executes the script file indicated by fileName and returns the exit value of that script. A script may specify a specific exit value by exiting with the exit(n) function. If a script does not use the exit() function the exit value will be 0.


Number ExecuteScriptString( String text )
Executes the script text and returns the exit value of that script. A script may specify a specific exit value by exiting with the exit(n) function. If a script does not use the exit() function the exit value will be 0.


Number exp( Number v1 )

Number exp1( Number v1 )

Number exp10( Number v1 )

Number exp2( Number v1 )



ImageReference FindFrontImage( )
Returns the front image. Doesn't throw exceptions.

Function FindFunctionBySignature( String signature )
Looks for a function that matches the given signature.

ImageReference FindImageByID( Number id )
Returns the image having the given id, or an invalid image of no image has that id.


ImageReference FindImageByLabel( String label )
Returns the image having the given label, or an invalid image if no such image exists.

ImageReference FindImageByName( String name )
Returns the image having the given name, or an invalid image of no image has that name.

ImageReference FindNextImage( ImageReference )
Find the next image.

ImageReference FirstImage( )
Find the first image.


Number floor( Number v1 )


Number FM_GetVarianceFloat( ImageReference )
Return the variance of the image. No data type checking is performed. This function uses the array processor if present.

Boolean FontManagerLookupFont( String base_name, Number text_encoding, Number kind, String face_name, NumberVariable size )
Tries to match a font to the 'base_name', 'text_encoding', and 'kind' specified.

Number FPClassify( Number v )
Returns the class of the floating point number.


Number FunctionCountParameters( Function func )
Returns the number of parameters of the function.

Boolean FunctionIsValid( Function func )
Returns true if 'func' is a valid object.

Function FunctionNullify( ! )
Assigns NULL to dst function.

Boolean GetAnnotationComplexNumberNote( ImageReference, Number annotationID, String noteLabel, ComplexNumberVariable noteValue )
Stores the value of the annotation note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetAnnotationNumberNote( ImageReference, Number annotationID, String noteLabel, NumberVariable noteValue )
Stores the value of the annotation note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetAnnotationRGBNumberNote( ImageReference, Number annotationID, String noteLabel, RGBNumberVariable noteValue )
Stores the value of the annotation note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetAnnotationStringNote( ImageReference, Number annotationID, String noteLabel, String noteValue )
Copies the value of the annotation note with the label noteLabel into the noteBuffer variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetApplicationInfo( Number info_kind, NumberVariable info )
Get application info. For 'info_kind == 0', bit 2 of '*info' is set for demo versions.


Boolean GetBoolean( String prompt, Boolean initalValue, NumberVariable result )
Puts up a dialog with the given prompt and allows the user to enter Boolean. The initial value is passed as a parameter and the result in stored in result. Returns 1 for OK and 0 for Cancel.

Boolean GetCalibrationDialog( Number aw, Number ah, NumberVariable xs, NumberVariable ys, String initialUnitString, String unitString )
Present the calibration dialog to the user. The calibrating pixel dimensions are passed as the [aw,ah] parameters. The resulting calibration is stored into the [xs,ys] parameters. The initial unit string is passed in and the resulting unit string is stored into the unitString variable.Returns 1 for OK and 0 for Cancel.



Number GetDaemonComponent( ImageReference )
Return the daemon component for the image. See the SDK documentation for more information.

 

 
Number GetFileSize( Number file )
Returns the size of the file.

DocumentWindow GetFloatingWindow( Number index )
Gets the 'index'th floating window.

Boolean GetFourImages( String title, ImageVariable image1, ImageVariable image2, ImageVariable image3, ImageVariable image4 )
Puts up a dialog and allows the user to choose four images. Returns 1 for Ok and 0 for Cancel.

Boolean GetFourImagesWithPrompt( String prompt, String title, ImageVariable image1, ImageVariable image2, ImageVariable image3, ImageVariable image4 )
Puts up a dialog with the given prompt and allows the user to choose four images. Returns 1 for Ok and 0 for Cancel.

Boolean GetFourLabeledImagesWithPrompt( String prompt, String title, String label1, ImageVariable image1, String label2, ImageVariable image2, String label3, ImageVariable image3, String label4, ImageVariable image4 )
Puts up a dialog with the given prompt and allows the user to choose four images. Returns 1 for Ok and 0 for Cancel.


ImageReference GetImageFromID( Number imageID )
Return the image corresponding the imageID.

Boolean GetImageFromID( ImageVariable, Number imageID )
Store the image corresponding the imageID into the image variable. Return 1 if one is found; return 0 otherwise.

Number GetImageID( ImageReference )
Return the id of the image.

Boolean GetInteger( String prompt, Number initalValue, NumberVariable result )
Puts up a dialog with the given prompt and allows the user to enter an integer. The initial value is passed as a parameter and the result in stored in result. Returns 1 for OK and 0 for Cancel.

Boolean GetInversionMode( ImageReference )
Return the contrast inversion mode of the image (1=inverted, 0=not inverted).

Number GetKey( )
Returns the key that was last pressed.

ImageReference GetNamedImage( String name )
Return the image with the image document name.

Boolean GetNamedImage( ImageVariable, String name )
Store the image with the image document name into the image variable. Return 1 if one is found; return 0 otherwise.

Number GetNextImageID( Number id )
Return the id of the image window following the image with the given id.

Boolean GetNoteState( ImageReference, String noteLabel, NumberVariable hidden )
Stores whether the image note with the label noteLabel is in the copy-to-image list into the copyToImage parameter. The hidden parameter is no longer used.

 

 



DocumentWindow GetNthDocumentWindowOfType( Number type, Number index )
Returns the 'index'th document window of type 'type'.

Number GetNthImageID( Number n )
Return the id of the nth image (number from 0). The images are in no particular order.

Boolean GetNthPersistentNoteTitle( String tagPath, Number index, StringVariable noteValue )
Stores the title of the tag with the given index from the persistent tag group indicated by tagPath into noteValue.


Boolean GetNumber( String prompt, Number initalValue, NumberVariable result )
Puts up a dialog with the given prompt and allows the user to enter a number. The initial value is passed as a parameter and the result in stored in result. Returns 1 for OK and 0 for Cancel.


Number GetOSTickCount( )
Return a tick count appropriate for the operating system.

Number GetOSTicksPerSecond( )
Return the number of ticks per second of a tick count appropriate for the operating system.

 
Boolean GetPersistentComplexNumberNote( String noteLabel, ComplexNumberVariable noteValue )
Stores the value of the persistent note with label noteLabel into the noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentLongNote( String noteLabel, NumberVariable noteValue )
Stores the value of the persistent note with label noteLabel into the noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentNoteState( String noteLabel, NumberVariable copyToImage, NumberVariable hidden )
Stores whether the note with the label noteLabel is in the copy-to-image list into the copyToImage parameter. The hidden parameter is no longer used.


Boolean GetPersistentPointNote( String noteLabel, NumberVariable x, NumberVariable y )
Gets the value of the persistent note with label noteLabel into the x and y variables. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentRectNote( String noteLabel, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right )
Gets the value of the persistent note with label noteLabel into the top, left, bottom, and right variables. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentRGBNumberNote( String noteLabel, RGBNumberVariable noteValue )
Stores the value of the persistent note with label noteLabel into the noteValue variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetPersistentStringNote( String noteLabel, String noteBuffer )
Copies the value of the persistent note with the label noteLabel into the noteBuffer variable. Returns 1 if the note exists returns 0 otherwise.

 

Number GetPixel( RealImage, Number x, Number y )
Return the pixel in the image at [x,y].

Number GetPlatformInfo( Number info )
Return platform info. info=1 is general platform (1=MacOS,2=Windows).

Boolean GetPointNote( ImageReference, String noteLabel, NumberVariable x, NumberVariable y )
Gets the value of the image note with label noteLabel into the x and y variables. Returns 1 if the note exists returns 0 otherwise.

Number GetProcessID( )
Returns the current process id.

 

 
Boolean GetRectNote( ImageReference, String noteLabel, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right )
Gets the value of the image note with label noteLabel into the top, left, bottom, and right variables. Returns 1 if the note exists returns 0 otherwise.


Boolean GetRGBColorDialog( String prompt, RGBNumber defaultColor, RGBNumberVariable result )
Puts up the Color Picker dialog with the given prompt and allows the user to choose a color. The default color is passed in and the resulting color is stored in the result parameter. Returns 1 for OK and 0 for Cancel.

Boolean GetRGBNumberNote( ImageReference, String noteLabel, RGBNumberVariable noteValue )
Stores the value of the image note with label noteLabel into noteValue variable. Returns 1 if the note exists returns 0 otherwise.



ScriptObject GetScriptObjectFromID( Number id )
Returns the script object associated with the ID or NULL if the object does not exist.

Boolean GetSelection( ImageReference, NumberVariable top, NumberVariable left, NumberVariable bottom, NumberVariable right )
Stores the coordinates (in pixels) of the image's selection into the top, left, bottom, and right variables. Returns 1 if there was a selection and 0 if there wasn't.

Number GetSpecialWindow( Number index )
Return one of the special windows. On Windows, 0=frame window, 1=top-most dialog.

Boolean GetString( String prompt, String initalValue, String result )
Puts up a dialog with the given prompt and allows the user to enter a string. The initial value is passed as a parameter and the result in stored in result. Returns 1 for OK and 0 for Cancel.

Boolean GetStringFromList( ImageReference, String tagPath, Number index, String noteBuffer )
Copies the string with the given index from the image tag list indicated by tagPath to noteBuffer.

Boolean GetStringFromPersistentList( String tagPath, Number index, String noteBuffer )
Copies the string with the given index from the persistent tag list indicated by tagPath to noteBuffer.

Boolean GetStringNote( ImageReference, String noteLabel, String noteValue )
Copies the value of the image note with the label noteLabel into the noteBuffer variable. Returns 1 if the note exists returns 0 otherwise.

Boolean GetThreeImages( String title, ImageVariable image1, ImageVariable image2, ImageVariable image3 )
Puts up a dialog and allows the user to choose three images. Returns 1 for Ok and 0 for Cancel.

Boolean GetThreeImagesWithPrompt( String prompt, String title, ImageVariable image1, ImageVariable image2, ImageVariable image3 )
Puts up a dialog with the given prompt and allows the user to choose three images. Returns 1 for Ok and 0 for Cancel.

Boolean GetThreeLabeledImagesWithPrompt( String prompt, String title, String label1, ImageVariable image1, String label2, ImageVariable image2, String label3, ImageVariable image3 )
Puts up a dialog with the given prompt and allows the user to choose three images. Returns 1 for Ok and 0 for Cancel.

Number GetTicks( )
Return the MacOS system tick count.

Number GetTicksPerSecond( )
Return the number of ticks per second.

Boolean GetTwoImages( String title, ImageVariable image1, ImageVariable image2 )
Puts up a dialog and allows the user to choose two images. Returns 1 for Ok and 0 for Cancel.

Boolean GetTwoImagesWithPrompt( String prompt, String title, ImageVariable image1, ImageVariable image2 )
Puts up a dialog with the given prompt and allows the user to choose two images. Returns 1 for Ok and 0 for Cancel.

Boolean GetTwoLabeledImagesWithPrompt( String prompt, String title, String label1, ImageVariable image1, String label2, ImageVariable image2 )
Puts up a dialog with the given prompt and allows the user to choose two images. Returns 1 for Ok and 0 for Cancel.

Number GetUnitsH( ImageReference, Number x )
Return the horizontal pixels x in calibrated units.

Number GetUnitsV( ImageReference, Number y )
Return the vertical pixels y in calibrated units.

 

 
Number GetZoom( ImageReference )
Return the zoom of the image display.
 
 
Boolean HasAcquisitionDaemon( ImageReference )
Returns 1 if the image has an attached daemon and returns 0 otherwise.
 



ImageDisplay ImageCreateImageDisplay( ImageReference, Number displayType )
Creates a new image display of type 'displayType' for the image.

Number ImageData_GetSeed( Number imageDataID )
Ask the array processor manager for the data seed of the image. See the SDK documentation for more information.

Boolean ImageData_IsLocalCopyValid( Number imageDataID )
Ask the array processor manager if the local copy is valid or not. See the SDK documentation for more information.




ImageReference ImageDisplayGetBufferedImage( ImageDisplay imgDisp )
Gets the image resulting from the contrast transformation.

Number ImageDisplayGetComplexMode( ImageDisplay imgDisp )
Gets the complex mode of the display.

Number ImageDisplayGetComplexModeRange( ImageDisplay imgDisp )
Gets the parameter used in converting complex to real.


Number ImageDisplayGetContrastMode( ImageDisplay imgDisp )
Returns the contrast mode.


ImageReference ImageDisplayGetDisplayedImage( ImageDisplay imgDisp )
Gets the image that is actually displayed in the image display.



Boolean ImageDisplayGetDoAutoSurvey( ImageDisplay imgDisp )
Determines whether min and max are determined automatically.

ImageReference ImageDisplayGetExportImage( ImageDisplay imgDisp, Number mode, ImageDisplay clut_display )
Gets the image representation of the image as it appears on the screen at full resolution.

ImageReference ImageDisplayGetImage( ImageDisplay imgDisp )
Returns the single image displayed by the image display.

ImageReference ImageDisplayGetInputColorTable( ImageDisplay imgDisp )
Gets the input color table for the display.

ImageReference ImageDisplayGetIntensityTransformation( ImageDisplay imgDisp )
Gets the ITT of the display.

Number ImageDisplayGetMinimumContrast( ImageDisplay imgDisp )
Gets the minimum contrast of the display.

ImageReference ImageDisplayGetOutputColorTable( ImageDisplay imgDisp )
Gets the output color table for the display.




Number ImageDisplayGetSurveyTechnique( ImageDisplay imgDisp )
Gets the survey technique of the display.

Boolean ImageDisplayIsCaptionOn( ImageDisplay imgDisp )
Returns true if captions are drawn.

Boolean ImageDisplayIsROISelected( ImageDisplay imgDisp, ROI roi )
Determines whether the given ROI is selected on this image display.

Boolean ImageDisplayIsValid( ImageDisplay imgDisp )
Returns true if 'imageDisplay' points to a valid object.



ImageDisplay ImageDisplayNullify( ! )





ImageReference ImageDocumentCreateRGBImageFromDocument( ImageDocument imgDoc, Number width, Number height, Number extract_style, Number constraints )
Creates an image by scaling the image document into ( width, height ).

Boolean ImageDocumentDoesImageWithIDExist( ImageDocument imgDoc, Number id )
Determines whether the image with the given id exists within this image document.


Number ImageDocumentGetAsPICT( ImageDocument imgDoc )
Returns this image as a PICT.

Component ImageDocumentGetComponentByID( ImageDocument imgDoc, Number id )
Returns an annotation contained in this image document by id.

Number ImageDocumentGetID( ImageDocument imgDoc )
Gets the id of the image document.


Component ImageDocumentGetRootComponent( ImageDocument imgDoc )
Gets the root annotation of the image document.

DocumentWindow ImageDocumentGetWindow( ImageDocument imgDoc )
Returns the window displaying the document.

Boolean ImageDocumentHasBeenPlacedOnPage( ImageDocument imgDoc )
Returns 'true' if the document has been layed out within the physical page.

Boolean ImageDocumentIsInImageMode( ImageDocument imgDoc )
Returns true if the view of the document is in image mode.

Boolean ImageDocumentIsInPageMode( ImageDocument imgDoc )
Returns true if the view of the document is in page mode.

Boolean ImageDocumentIsValid( ImageDocument imgDoc )
Returns true if 'imageDocument' points to a valid object.


Boolean ImageDocumentPrint( ImageDocument imgDoc )
Print the image document, returning 'true' if successful.


Number ImageGetDataElementBitSize( ImageReference img )
Returns the size of the data elements in bits.

Number ImageGetDataElementByteSize( ImageReference img )
Returns the smallest number of bytes that can hold a data element.

Number ImageGetDataSeed( ImageReference img )
Gets the seed of the image data.

Number ImageGetDataType( ImageReference img )
Returns a long representing the data type.


Number ImageGetDimensionOrigin( ImageReference, Number dimension )
Returns the origin of the given dimension of image.

Number ImageGetDimensionScale( ImageReference, Number dimension )
Returns the scale of the given dimension of image.

Number ImageGetDimensionSize( ImageReference, Number dimension )
Gets the size of the given dimension.



Number ImageGetIntensityOrigin( ImageReference )
Returns the origin of image's intensity.

Number ImageGetIntensityScale( ImageReference )
Returns the scale of image's intensity.


ScriptObject ImageGetUniqueID( ImageReference image )
Returns the unique ID for this image. This id is globally unique across sessions and locations.

Boolean ImageIsDataTypeBinary( ImageReference img )
Returns true if the data in the image is binary.

Boolean ImageIsDataTypeComplex( ImageReference img )
Returns true if the data in the image is complex.

Boolean ImageIsDataTypeFloat( ImageReference img )
Returns true if the data in the image is floating point.

Boolean ImageIsDataTypeInteger( ImageReference img )
Returns true if the data in the image is integral.

Boolean ImageIsDataTypePackedComplex( ImageReference img )
Returns true if the data in the image is complex.

Boolean ImageIsDataTypeReal( ImageReference img )
Returns true if the data in the image is real.

Boolean ImageIsDataTypeRGB( ImageReference img )
Returns true if the data in the image is rgb.

Boolean ImageIsDataTypeSignedInteger( ImageReference img )
Returns true if the data in the image is integral and signed.

Boolean ImageIsDataTypeUnsignedInteger( ImageReference img )
Returns true if the data in the image is integral and unsigned.

Boolean ImageIsDimensionCalibrationDisplayed( ImageReference im, Number dim )
Returns 'true' if the calibration of the 'dim'th dimension is displayed.

Boolean ImageIsIntensityCalibrationDisplayed( ImageReference im )
Returns 'true' if the calibration of the intensity is displayed.

 
ImageReference ImageNullify( ! )
 
Number InstallScriptLibraryFile( String fileName )
Loads the script file indicated by fileName, executes it, and publishes any functions contained inside. Always returns 0.
 

Number integrate( RealImageExpression )
Return the sum of all pixel values of the image expression.


Number len( String )
Returns the length of a string.

 

Number LinePlotImageDisplayGetBaseIntensity( LinePlotImageDisplay lpid )
Returns the base intensity of the line plot.


Number LinePlotImageDisplayGetSlice( LinePlotImageDisplay lpid )
Returns slice currently displayed at the bottom.


Number LinePlotImageDisplayGetSliceDrawingStyle( LinePlotImageDisplay lpid, Number slice_index )
Returns the drawing style of the 'slice_index'th slice.


Boolean LinePlotImageDisplayIsBackgroundOn( LinePlotImageDisplay lpid )
Returns true if the background is erased.

Boolean LinePlotImageDisplayIsFilled( LinePlotImageDisplay lpid )
Returns true if the line plot is filled.

Boolean LinePlotImageDisplayIsFrameOn( LinePlotImageDisplay lpid )
Returns true if the frame is drawn.

Boolean LinePlotImageDisplayIsGridOn( LinePlotImageDisplay lpid )

Returns true if the grid is displayed on.

 

 

 

 

 







Number log( Number v1 )

Number log1( Number v1 )

Number log10( Number v1 )

Number log2( Number v1 )

Number MatrixDeterminant( RealImage a )
Return the matrix determinant number of matrix image a.

 

Number max( RealImageExpression, NumberVariable x, NumberVariable y )
Finds the maximum pixel in the image, stores the coordinates of that pixel into x and y, and returns the value of the pixel.

Number max( RealImageExpression )
Return the maxmimum pixel within the image expression.

Number max( Number v1, Number v2 )



Number MeanSquare( RealImageExpression )
Return the mean square of all pixel values of the image expression.

Number min( Number v1, Number v2 )

Number min( RealImageExpression, NumberVariable x, NumberVariable y )
Finds the minimum pixel in the image, stores the coordinates of that pixel into x and y, and returns the value of the pixel.

Number min( RealImageExpression )
Return the minimum pixel within the image expression.


Number mod( Number v1, Number v2 )

Number Nan( String tag, Boolean is_signaling )
Returns a nan containing the specified tag.

Number nearest( Number v1 )

Function NewAbstractMethod( String method_name, String method_signature )
Returns an abstract method with name 'method_name' and signature 'method_signature'.

Component NewArrowAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new arrow annotation.

Component NewBoxAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new box annotation.

Function NewCallbackFunction( String method_signature, ! callback, Number linkage_style )
Creates a function representing a callback to a C function 'callback'.

Component NewComponent( Number type, Number f1, Number f2, Number f3, Number f4 )
Creates a new annotaiton of type 'type'

Component NewDoubleArrowAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new double arrow annotation.

Function NewFunctionFromScript( String script, String signature )
Compiles script and returns the function matching signature.

Component NewGroupAnnotation( )
Creates a new group annotation.

ImageReference NewImage( String title, Number type, Number d0, Number d1, Number d2, Number d3 )
Creates a 4D image of type 'type' and size [d0,d1,d2,d3] with the given title.

ImageReference NewImage( String title, Number type, Number d0, Number d1, Number d2 )
Creates a 3D image of type 'type' and size [d0,d1,d2] with the given title.

ImageReference NewImage( String title, Number type, Number d0, Number d1 )
Creates a 2D image of type 'type' and size [d0,d1] with the given title.

ImageReference NewImage( String title, Number type, Number d0 )
Creates a 1D image of type 'type' and size [d0] with the given title.


ImageReference NewImageFromFile( String file_path )
Opens a file and reads it as an image.

Component NewLineAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new line annotation.


Component NewOvalAnnotation( Number top, Number left, Number bottom, Number right )
Creates a new oval annotation.

Component NewPictureAnnotation( Number top, Number left, Number bottom, Number right, Number picture )
Creates a new picture annotation.



DocumentWindow NewScriptWindow( String title, Number top, Number left, Number bottom, Number right )
Creates a new editor window.

DocumentWindow NewScriptWindowFromFile( String file_name, String font_name, Number attributes, Number size, Number encoding, Number top, Number left, Number bottom, Number right )
Opens a file into a script window.

DocumentWindow NewScriptWindowFromFile( String file_name )
Opens a file into a script window.

DocumentWindow NewScriptWindowFromFile( String file_name, Number top, Number left, Number bottom, Number right )
Opens a file into a script window.

DocumentWindow NewScriptWindowFromFile( String file_name, String font_name, Number attributes, Number size, Number encoding )
Opens a file into a script window.

Number NewSemaphore( )
Create a semaphore. Used only with background processing.

 

 

Component NewTextAnnotation( Number left, Number top, String text, Number size )
Creates a new text annotation.

ImageReference NextImage( ImageReference )
Find the next image.

Boolean OkCancelDialog( String prompt )
Puts up a dialog with the given prompt. Returns 1 for OK and 0 for Cancel.

 

 
ImageReference OpenImage( String fileName )
Open the image with the filename. Returns the opened image.


Boolean OptionDown( )
Returns 1 if the option key is down and 0 otherwise.

Number Pi( )
Return an approximation of pi.


Number Polynomial( RealImageExpression, Number x )
Return the polynomial a0 + a1*x + a2*x*x ... where x is the free variable and a0 ... aN are the pixels of the image.



Number product( RealImageExpression )
Return the product of all pixel values of the image expression.


Boolean RasterImageDisplayIsThresholdOn( RasterImageDisplay rid )
Determines whether the thresholding overlay is on or off.

RasterImageDisplay RasterImageDisplayNullify( ! )

Number RegisterCustomMenu( Number menuHandler )
Register a custom menu. See the SDK documentation for more information.


Number RegisterObjectListener( Number object, Number proc, Number refCon )
Add object listener to OM object. See the SDK documentation for more information.


Number ReinterpretComponentAsLong( Component comp )

Number ReinterpretImageAsLong( ImageReference img )

Number ReinterpretImageDisplayAsLong( ImageDisplay imgDisp )

Number ReinterpretImageDocumentAsLong( ImageDocument id )

Component ReinterpretLongAsComponent( Number l )

Component ReinterpretLongAsComponentPtr( Number l )

ImageReference ReinterpretLongAsImage( Number l )

ImageDisplay ReinterpretLongAsImageDisplay( Number l )

ImageDisplay ReinterpretLongAsImageDisplayPtr( Number l )

ImageVariable ReinterpretLongAsImagePtr( Number l )




 
ScriptObject ReinterpretLongAsScriptObject( Number l )

DocumentWindow ReinterpretLongAsWindow( Number l )

DocumentWindow ReinterpretLongAsWindowPtr( Number l )

Number ReinterpretRegionOfInterestAsLong( ROI tg )

Number ReinterpretROIAsLong( ROI tg )

Number ReinterpretScriptObjectAsLong( ScriptObject tg )

 
Number ReinterpretWindowAsLong( DocumentWindow id )




Boolean ROIContainsPoint( ROI roi, Number x, Number y )
Returns whether the region of interest encloses the given point.

Number ROICountVertices( ROI roi )
Return the number of vertices comprising the region of interest.


Boolean ROIGetDeletable( ROI roi )
Return whether the region of interest is deletable or not.

Number ROIGetID( ROI roi )
Return the ID for the region of interest.


Boolean ROIGetMoveable( ROI roi )
Return whether the region of interest is moveable or not.


Boolean ROIGetResizable( ROI roi )
Return whether the region of interest is resizable or not.


Boolean ROIGetVolatile( ROI roi )
Return whether the region of interest is volatile or not.


Boolean ROIIsClosed( ROI roi )
Returns whether the region of interest is a closed loop or not.

Boolean ROIIsLine( ROI roi )
Return whether the region of interest is a line.

Boolean ROIIsPoint( ROI roi )
Return whether the region of interest is a point.

Boolean ROIIsRange( ROI roi )
Returns whether the region of interest is a range.

Boolean ROIIsRectangle( ROI roi )
Return whether the region of interest is a rectangle.

Boolean ROIIsValid( ROI roi )
Returns 'true' if the region of interest is a valid object.




Number round( Number v1 )

Number ScriptObjectGetClassToken( ScriptObject scriptObject, String class_name )
Gets the token in 'scriptObject' corresponding to the class 'class_name'.

Number ScriptObjectGetID( ScriptObject scriptObject )
Returns a unique ID for this object. The object can be recovered by using GetScriptObjectFromID function.

Boolean ScriptObjectIsValid( ScriptObject scriptObject )
Returns true if 'scriptObject' references a valid object.

Function ScriptObjectLookupMethod( ScriptObject scriptObject, Function meth_abs, String class_name )
Returns the method of this object corresponding to the abstract method 'meth_abs' and class 'class_name'.

Function ScriptObjectLookupMethod( ScriptObject scriptObject, Function meth_abs )
Returns the specific method of this object corresponding to the abstract method 'meth_abs'.

ScriptObject ScriptObjectNullify( ! )


Number sgn( Number v1 )


Boolean ShiftDown( )
Returns 1 if the shift key is down and 0 otherwise.

Number sin( Number v1 )

Number sinh( Number v1 )

BasicImage slice3( BasicImage, Number x, Number y, Number z, Number d0, Number l0, Number s0, Number d1, Number l1, Number s1, Number d2, Number l2, Number s2 )
Returns the subslice [(x,y,z),(d0,l0,s0),(d1,l1,s1),(d2,l2,s2)].

Number StringCompare( String s1, String s2 )
Compares strings 's1' and 's2', returning -1,0, or 1 if s1 is less, equal, or greater than s2.

Boolean StringIsValid( String str )
Returns true if 'str' is a valid object.

Number sum( RealImageExpression )
Return the sum of all pixel values of the image expression.


Boolean SurfacePlotImageDisplayIsShadingOn( SurfacePlotImageDisplay spid )
Determines whether shading is on or off.

SurfacePlotImageDisplay SurfacePlotImageDisplayNullify( ! )

Number tan( Number v1 )

Number tanh( Number v1 )

Number tert( Boolean cond, Number trueval, Number falseval )


Number Test_BananaEggs( Number one, Number two, Number three )


ImageReference Test_CallFunction_ImageReturn( Function func )


Function Test_CompileScriptFunction( String sig, String script )

Number Test_ConvertDate( String date )

Number Test_CountGlobalObjects( String name )

ImageReference Test_CreateImageFromCPP( String name, Number type, Number x_size, Number y_size )

Function Test_GetGlobalFunction( )


Number Test_IncCounter( Number period )

Boolean Test_IsInBackground( )

Function Test_LookupPlugInFunction( String sig )


Number Test_OperatorNew( Number )

Boolean Test_SetTestFlag( Number index, Boolean val )

Number Test_SizeofData( Number index )


Number TextAnnotationGetAlignment( Component comp )
Gets the alignment of the text in the text annotation.


Number TextAnnotationGetResizeStyle( Component comp )
Gets the resize style of the text annotation.


Boolean ThrowableIsValid( Throwable throw_ )
Returns true if 'throw_' is a valid object.

Throwable ThrowableNullify( ! )
Assigns NULL to dst throwable.

Number TickCount( )
Return the MacOS system tick count.


Number trunc( Number v1 )

ImageReference TryToUse( String name, Number width, Number height, Number dataType, Number h, Number v, NumberVariable fresh )
Look for an image with the given name, width, height, dataType, and position [h,v]. Return it if found and create it if not. Store 1 into fresh if it was created and 0 if not.

Boolean TwoButtonDialog( String prompt, String acceptLabel, String rejectLabel )
Puts up a dialog with the given prompt and two buttons labeled according to the parameters. Returns 1 for the acceptLabel button and false for the other one.

Number unc( String, Number index )
Returns the unicode value of the first character of the string.


Number val( String )
Returns the numeric value of a string.


Number variance( ImageReference )
Return the variance of the image.



Boolean WindowIsOpen( DocumentWindow window )
Returns true if the window has not been closed.

Boolean WindowIsShown( DocumentWindow window )
Returns true if the window is shown.


DocumentWindow WindowNullify( ! )

Number XX_GetProcessKey( Number pid )
Return a keystroke associated with the background process indicated by pid.

Table 2597c. Examples of DM script commands interacting with microscopes and cameras.

Command Function Example
cm_abortautoexposure    
cm_autoexpose_acquireimage    

Table 2597d. Other DM script examples.

Script functions Example
Display/list all the names of the opened images in the Output window on DM and show the total number of opened images Example
Analysis of rectangle ROI Example
Set pixel values to zero if the values are lower (or higher) than a threshold and modify the values of other pixels by multiplying a factor Example
Replace a letter (or symbol) by another in ".txt" files Example
Calculate an area above a given intensity-threshold on the image Example
Calculate the area of a ROI above a given intensity-threshold on the image Example
Smoothen an image Example
Align two images using CrossCorrelate Command by shifting the second image Example
Set the pixel value in an image to zero if the value is negative Example
Sum the counts of a ROI area in a given image Example
Sum the counts of a ROI area in a given spectrum Example
Live histogram Example
Read, name and display the selected ROI, or create, name and display a rectangle ROI, including the entire image, if there is no ROI Example
Particle analysis: FilledArea (The number of on pixels in FilledImage), Area (the actual number of pixels in the region), CenterX (X-coordinate of intensity-weighted), CenterY (Y-coordinate of intensity-weighted), ConvexArea (the number of pixels in 'ConvexImage'), Eccentricity (the eccentricity of the ellipse), Solidity (the proportion of the pixels in the convex hull that are also in the region), etc. This script provides similar functions as Analysis > Particles > FindParticles on GMS 3.x. Example
Reflection/diffraction angles of BCC and FCC, wavelength of incident electrons at various accelerating voltages
 

 

 

 


 

 

 

 

[1] Kimoto, K., Matsui, Y., 2002. Software techniques for EELS to realize about 0.3 eV energy resolution using 300 kV FEG-TEM. J. Microsc. 208, 224–228.
[2] Koji Kimoto, Kazuo Ishizuka, Toru Asaka, Takuro Nagai, Yoshio Matsui, 0.23 eV energy resolution obtained using a cold field-emission gun and a streak imaging technique, Micron 36 (2005) 465–469. 
[3] Ishizuka, K., 2003. DeConvEELS, HREM Research Inc., http://www.hremresearch.com. 
[4] Kimoto K and Matsui Y (2002) Software techniques for EELS to realize about 0.3 eV energy resolution using 300 kV FEG-TEM. J. Microsc. 208: 224–228. 
[5] Koji Kimoto, Kazuo Ishizuka, Teruyasu Mizoguchi, Isao Tanaka and Yoshio Matsui, The study of Al-L23 ELNES with resolution-enhancement software and first-principles calculation, Journal of Electron Microscopy 52(3): 299–303 (2003). 
 
 
 
 
 
 

 

 

=================================================================================