WriteFile
This function saves the specified text to a file. If the file does not exist, it will be created automatically.
Syntax:
$WriteFile( "filePath", anyText )
| Parameter | Type | Description |
|---|---|---|
filePath | STRING | Path relative to the attachments folder, or a path in the format global://globalPathToFile. |
CopyFile
This function copies a file to the specified directory.
Syntax:
$CopyFile( "srcFilePath", "dstFilePath" )
| Parameter | Type | Description |
|---|---|---|
srcFilePath | STRING | Path of the file to be copied relative to the attachments folder, or a path in the format global://globalPathToFile. |
dstFilePath | STRING | Path of the copied file relative to the attachments folder, or a path in the format global://globalPathToFile. |
ImportFile
This function copies a file to the specified directory.
Syntax:
$ImportFile( "srcFilePath", "dstFilePath" )
| Parameter | Type | Description |
|---|---|---|
srcFilePath | STRING | Global path or path relative to the work folder. |
dstFilePath | STRING | Path of the copied file relative to the attachments folder, or a path in the format global://globalPathToFile. |
Ifdef
This function outputs the specified text only if the input variable is defined.
Syntax:
$Ifdef( variable, anyText )
Example:
$Ifdef( dateTime, $(dateTime) )Ifndef
This function outputs the specified text only if the input variable is not defined.
Syntax:
$Ifndef( variable, anyText )
Example:
$Ifndef( dateTime, dateTime variable is not defined )If
Outputs the specified text only if the condition is met using numerical and logical expressions.
Syntax:
$If( expression operator expression, anyText )
Example:
$If( 1 > 0, One is more than zero. )
$If( 1, One is more than zero. )
$If( isGeoreferenced == 1, The selected component is georeferenced. )
$If( "$(units)" == "meter", The measurement unit of the selected component is meter. )For
Allows the enclosed code to be executed repeatedly.
Syntax:
$For( "iteratorVariable", start, step, end, anyText )
iteratorVariable | Variable that holds the current iteration index, taking values from the right-open interval [start, end) with increments or decrements defined by step. |
start | Starting value of the iteratorVariable. |
step | Value by which the iteratorVariable is incremented or decremented in each loop iteration. |
end | Value at which the loop stops when the iteratorVariable reaches it . |
Example:
$For( "cameraIndex", 0, 1, cameraCount,
cameraIndex: $(cameraIndex),
)Declare
Declares (defines) a new variable.
Syntax:
Syntax: $Declare( "variable", value )
variable | The name of the new variable. |
value | A new value for the new variable. |
Example:
$Declare( "myVariable1", 0 )
$Declare( "myVariable2", "test" )Set
Used to assign a new value to a variable.
Syntax:
$Set( "variable", value )
variable | The name of the variable. |
value | A new value for the specified variable. |
Example:
$Declare( "myVariable", 1 )
$Set( "myVariable", myVariable + 1 )Min
Finds and saves the minimal value from the given values as a new value for the specified variable.
Syntax:
$Min( "outputVar", var1, var2, ..., varN )
outputVar | The name of the variable. |
var1, var2, ..., varN | A new value for the specified variable. |
Example:
$Declare( "sqrtVar", 0)
$Sqrt( "sqrtVar", 25)Max
Finds and saves the maximum value from the given values as a new value for the specified variable.
| Parameter | Description |
|---|---|
outputVar | The name of the variable. |
var1, var2, ..., varN | A new value for the specified variable. |
Example:
$Declare( "sqrtVar", 0)
$Sqrt( "sqrtVar", 25)Sqrt
Calculates the square root of the given value and stores it in the specified variable.
Syntax:
$Sqrt( "outputVar", var )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var | A number or numeric variable. |
Example:
$Declare( "sqrtVar", 0)
$Sqrt( "sqrtVar", 25)Abs
Returns the absolute value of the given value and stores it in the specified variable.
Syntax:
$Abs( "outputVar", var )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var | A number or numeric variable. |
Example:
$Declare( "absVar", 0)
$Abs( "absVar", -12)Floor
Returns the largest lower integer of the given value and stores it in the specified variable.
Syntax:
$Floor( "outputVar", var )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var | A number or numeric variable. |
Example:
$Declare( "floorVar", 0)
$Floor( "floorVar", 2.6)Ceil
Returns the largest higher integer of the given value and stores it in the specified variable.
Syntax:
$Ceil( "outputVar", var )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var | A number or numeric variable. |
Example:
$Declare( "ceilVar", 0)
$Ceil( "ceilVar", 2.6)Log
Returns the natural logarithmic value of the given value and stores it in the specified variable.
Syntax:
$Log( "outputVar", var )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var | A number or numeric variable. |
Example:
$Declare( "logVar", 0)
$Log( "logVar", 2.6)Log10
Returns the natural logarithmic value of 10 of the given value and stores it in the specified variable.
Syntax:
$Log10( "outputVar", var )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var | A number or numeric variable. |
Example:
$Declare( "logVar", 0)
$Log10( "logVar", 2.6)ATan
Returns the arctangent (inverse tangent) of the given value and stores it in the specified variable.
Syntax:
$ATan( "outputVar", var )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var | A number or numeric variable. |
Example:
$Declare( "atanVar", 0)
$ATan( "atanVar", 2.6)Pow
Calculates the value raised to the power of the exponent and stores the result as the specified variable.
Syntax:
$Pow( "outputVar", base, exponent )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
base | A number or numeric variable. |
exponent | A number or numeric variable. |
Example:
$Declare( "powVar", 0)
$Pow( "powVar", 4 , 3)Sum
Returns the sum of the given values and stores it in the specified variable.
Syntax:
$Sum( "outputVar", var1, var2, ..., varN )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var1, var2, ..., varN | Numeric variables or values separated by commas. |
Example:
$Declare( "sum", 0 )
$Sum( "sum", 1, 2 )Prod
Returns the product (multiplied values) of the given values and stores it in the specified variable.
Syntax:
$Prod( "outputVar", var1, var2, ..., varN )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var1, var2, ..., varN | Numeric variables or values separated by commas. |
Example:
$Declare( "prod", 0 )
$Prod( "prod", 1, 2 )Mean
Returns the mean value of the given values and stores it in the specified variable.
Syntax:
$Mean( "outputVar", var1, var2, ..., varN )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var1, var2, ..., varN | Numeric variables or values separated by commas. |
Example:
$Declare( "mean", 0 )
$Mean( "mean", 1, 2, 3)StdDevS
Calculates the sample standard deviation of the given values and stores the result in the specified variable. Use this function when the values represent a sample rather than the entire population.
Syntax:
$
StdDevS( "outputVar", var1, var2, ..., varN )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var1, var2, ..., varN | Numeric variables or values separated by commas. |
Example:
$Declare( "stddevs", 0 )
$StdDevS( "stddevs", 1, 2, 3, 4)StdDevP
Calculates the population standard deviation of the given values and stores the result in the specified variable. Use this function when the values represent the entire population.
Syntax:
$
StdDevP( "outputVar", var1, var2, ..., varN )
| Parameter | Description |
|---|---|
outputVar | The name of the variable where the result will be stored. |
var1, var2, ..., varN | Numeric variables or values separated by commas. |
Example:
$Declare( "stddevp", 0 )
$StdDevP( "stddevp", 1, 2, 3)Map
Compares all variables to the given expression and returns the one that best matches the comparison. The comparison follows these rules:
Returns R[i] if t[i] ≤ expression < t[i+1]; returns R0 if expression < t1; returns Rn if expression > tn.
Syntax:
$Map( expression, "text0", t1, "text1", t2, "text2", ..., tN, "textN" )
| Parameter | Type | Description |
|---|---|---|
expression | DOUBLE | The name of the variable where the result will be stored. |
R1, ..., RN | STRING | The values that may be returned based on the comparison. |
t1, ..., tN | DOUBLE | Specify the values or expressions used for comparison with the defined expression parameter. |
Example:
$Declare( "lvl1", 1 ) $Declare( "lvl1Color", "#fff040" )
$Declare( "lvl2", 1.5 ) $Declare( "lvl2Color", "#ff8040" )
$Declare( "lvl3", 2 ) $Declare( "lvl3Color", "#ff1040" )
$Declare("cpxStd", 3)
$Declare("cpxMeanAcc", 1.5)
"$Map(Abs(cpxStd),"",lvl1*cpxMeanAcc,"$(lvl1Color)",lvl2*cpxMeanAcc,"$(lvl2Color)",lvl3*cpxMeanAcc,"$(lvl3Color)")"Include
Outputs the content of the specified file.
Syntax:
$Include( "filePath" )
| Parameter | Description |
|---|---|
filePath | A path to the file whose content will be output. |
Example:
$Include( "Reports\style.css" )EscapeBackslashes
Replaces backslashes ( \ ) with double backslashes ( \\ ).
Syntax:
$EscapeBackslashes( noParametersJustAnyText )
Example:
$EscapeBackslashes( D:\project\data\images )EscapeSpaces
Syntax:
$EscapeSpaces( noParametersJustAnyText )
Example:
$EscapeSpaces(D:\Project 01\Data\Images HDR)Replace
Replaces the specified string with a new string within the given text.
Syntax:
$Replace( "search", "replace", subject )
| Parameter | Description |
|---|---|
search | The string to be found and replaced. |
replace | The replacement string that will replace the found occurrences. |
subject | The text in which the search and replacement will be performed. |
Example:
$Replace( "world", "my friend", Hello world! )Append
Concatenates the given strings into a single string.
Syntax:
$Append( "variable", var1, var2, ..., varN )
| Parameter | Description |
|---|---|
variable | Name of the variable to which the remaining parameters are appended. |
var1, var2, ..., varN | Variables or values, separated by commas, that will be concatenated. |
Example:
$Declare( "text", "The measurement unit" )
$Declare( "text2", " of the selected component is " )
$Append( "text", text2, "$(units)", "." )Echo
The parameters of this function will be displayed in the report.
Syntax:
$Echo( anyDeclaration )
Example:
$Echo(
$Declare( "lvl1", 0.025 ) $Declare( "lvl1Color", "#fff040")
$Declare( "lvl1ColorBright", "#fff0a0")
)EchoOff
The parameters of this function will not be displayed in the report.
Syntax:
$EchoOff( anyDeclaration )
Example:
$EchoOff(
$Declare( "lvl1", 0.025 ) $Declare( "lvl1Color", "#fff040")
$Declare( "lvl1ColorBright", "#fff0a0")
)ProgressSection
Marks a block of template code so the report generator can estimate completion time. Wrap the longest-running operations inside ProgressSection, and you may nest these sections. At each nesting level, the sum of all fractionOfOne values must equal 1.
Syntax:
$ProgressSection( fractionOfOne, anyText )
| Parameter | Description |
|---|---|
fractionOfOne | A decimal number between zero and one. |
Example:
$ProgressSection( 0.3,
call some function that takes long time to execute, e.g. IterateOrthoMapTiles
)
$ProgressSection( 0.7,
$ProgressSection( 0.2,
call another function that takes long time to execute
)
$ProgressSection( 0.3,
call another function
)
IfFileExists
Writes out the written text or executes a function if the defined file exists.
Syntax:
$IfFileExists( "filePath", anyText )
| Parameter | Description |
|---|---|
filePath | A path to the file whose existence is tested. |
anyText | Any text, expression, or function. |
Example:
$Declare("Var", 0)
$IfFileExists("D:\Test\file.xml", $Max("var", 1, 4, 3))IfFileNotExists
Writes out the written text or executes a function if the defined file does not exist.
Syntax:
$IfFileNotExists( "filePath", anyText )
| Parameter | Description |
|---|---|
filePath | A path to the file whose existence is tested. |
anyText | Any text, expression, or function. |
Example:
$Declare("Var", 0)
$IfFileNotExists("D:\Test\file.xml", $Max("var", 1, 4, 3))Sleep
Creates a pause for the specified duration in milliseconds.
Syntax:
$Sleep( timeSec )
| Parameter | Description |
|---|---|
timeSec | Time in milliseconds. |
Example:
$Sleep( 100 )Strip
Remove the last characters from the output.
Syntax:
$Strip( count )
| Parameter | Description |
|---|---|
count | Number of characters that will be removed. |
Example:
$Strip( 4 )Nop
Ignores the given content.
Syntax:
$Nop( anyText )
Example:
$Nop( This text will be ignored. )WriteInterleaved
Syntax:
$WriteInterleaved(stride, anyText )
| Parameter | Description |
|---|---|
stride | Stride, which will be used to interleave the given content. |
Example:
$WriteInterleaved( 3 , This text will be interleaved. )ShellExecute
Executes the given parameters using Shell.
Syntax:
$ShellExecute( "filePath" )
or$ShellExecute( "filePath", "arguments" )
or$ShellExecute( "filePath", "arguments", "workDir" )
| Parameter | Description |
|---|---|
filePath | Global path to an external file. |
Example:
$ShellExecute( "cmd.exe", "/c cd /d \"$(cmdStartDir)\" && python hardMasks.py" )QuaternionFromMatrix
Calculates the quaternion rotation from an orthonormal orientation matrix, where Rij represents the element in the i-th row and j-th column of the input matrix.
Syntax:
$QuaternionFromMatrix( R00, R01, R02, R10, R12, R13, R20, R21, R22, anyText )
| Parameter | Description |
|---|---|
R00, ..., R22 | Elements of the rotation matrix. |
Available Variables
| Variable | Type | Description |
|---|---|---|
qx | DOUBLE | The x component of the quaternion. |
qy | DOUBLE | The y component of the quaternion. |
qz | DOUBLE | The z component of the quaternion. |
qw | DOUBLE | The w (scalar) component of the quaternion. |
Mat44Inv
Calculates the inverse matrix of a given 4x4 matrix.
Syntax:
$Mat44Inv( M00,M01,M02,M03,...,M33, anyText )
| Parameter | Description |
|---|---|
M00, ..., M33 | Values of the matrix. |
Available Variables
| Variable | Type | Description |
|---|---|---|
MInv00, ..., MInv33 | DOUBLE | The elements of the resulting inverted 4×4 matrix. |
ParentFolder
Outputs the parent folder name—the substring between the second-to-last and last path separators (\ or /).
Syntax:
$ParentFolder( path )
| Parameter | Description |
|---|---|
path | Global path to an external file. |
Example:
$ParentFolder( D:\Project\Images\FolderName\file.ext )FileName
Outputs the file name if it exists.
Syntax:
$FileName( path )
| Parameter | Description |
|---|---|
path | Global path to an external file. |
Example:
$ParentFolder( D:\Project\Images\FolderName\file.ext )FileExt
$FileExt( path )
| Parameter | Description |
|---|---|
path | Global path to an external file. |
Example:
$ParentFolder( D:\Project\Images\FolderName\file.ext )