Template Tags
Template Tag Reference
Important note: if a tag is broken up by formatting, revision tracking, or spell checking, it will not be processed. It is usually best to turn off all change tracking and spelling/grammar checking in your word processor.
Basics
To insert a text tag, place the tag and any parameters, separated by commas, inside braces. The tag will be replaced by the appropriate value without changing the font, position, etc. For example, {@VIC_RIG_TX}.
To insert a graphic tag, create a blank or placeholder image and then add the tag and any parameters as the alternative text. The image will be replaced by the requested plot. For example, {@VIC_PLOT_3D,var=e1,idx=-1}.
Format specifiers:
Many tags have format specifier flags.
fmt: floating point format
- 'f': display as [-]7.7
- 'g': display as [-]7.7E[+|-]777 when more concise
prec: precision specifier (number of digits after decimal for 'f' or total number of floating point digits for 'g')
Spreadsheet column specifiers have the format COL_ID:FMT:PREC, where
COL_ID: spreadsheet column (A, B, C, ..., AA, AB etc.)
FMT: number format 'f', 'g' (optional)
PREC: number of digits (optional)
List indeces:
Any time a list index idx is present, you may specify integer values starting from 0, or negative values to count down from the end; e.g., -1 refers to the last element. Alternatively, indeces can be specified as a percentage, e.g., 33.33%. If indeces are specified as percentages, the closest integer value is used.
Tag categories
VIC_ADATA:
Used to insert data from the project's analog data file (CSV) for time, load, etc.
idx: Index value
col: column (A, B, C, ..., AA, AB)
fmt: floating point format ('g', 'f')
prec: precision specifier (number of digits)
Example: {@VIC_ADATA, idx=100%, col=B, fmt='f', prec=1} - shows the second column (normally Time_0) from the analog data file for the last image in the test, floating point, 1 digit of precision.
Example: {@VIC_ADATA, idx=10, col=H} - show the 8th column (i.e., Load, in a given setup) from the 10th image in the test.
VIC_CSV_DATA:
Used to insert data from external csv files. Can be used either to look up spreadsheet cell entries (e.g., cell=B3) or for key-value pair lookups. In the latter usage, one column in the csv file is used as the key column and should hold unique descriptors of the values in the
value column. For instance, the key column could have entries 'modulus', 'poisson', 'sample_id" and the value column would contain the numerical values for the elastic modulus, the poisson ration and the sample's identification number.
file: path to csv file on disk
cell: spreadsheet cell (e.g., A1, C32)
key_col: column that holds keys for key-value pair lookups
val_col: column that holds values for key-value pair lookups
key: string in key column
fmt: floating point format ('g', 'f')
prec: precision specifier (number of digits)
Example: {@VIC_CSV_DATA, file=testinfo.csv, cell=B3} - shows the value from cell B3 of the specified spreadsheet.
Example: {@VIC_CSV_DATA, file=testinfo.csv, key_col=D, val_col=E, key=modulus} - scans row D for the keyword "modulus" and pulls the matching value from row E.
Calibration values:
The following calibration values support the following options:
cam: camera id (default: 0)
fmt: floating point format ('g', 'f')
prec: precision specifier (number of digits)
VIC_CAM_CX, VIC_CAM_CY: x/y center coordinates (pixels)
VIC_CAM_FX, VIC_CAM_FY: x/y focal length (pixels)
VIC_CAM_S: skew factor
VIC_CAM_K1, VIC_CAM_K2, VIC_CAM_K3: distortion coefficients
VIC_CAM_MAG_AVG, VIC_CAM_MAG_MIN, VIC_CAM_MAG_MAX: average, minimum
and maximum magnification (pixels/mm)
VIC_CAM_ERROR: residual error for calibration (pixels); use cam=-1 for the rig error.
Example: {@VIC_CAM_CX, cam=1, 'f', 2} - shows the center (x) for camera, floating point, 2 digits of precision.
Example: {@VIC_CAM_ERROR} - shows the error score for camera 0 with no formatting.
Example: {@VIC_CAM_ERROR, cam=-1} - shows the overall error score for the rig.
The external camera calibration values support the following options:
fmt: floating point format ('g', 'f')
prec: precision specifier (number of digits)
VIC_RIG_RX, VIC_RIG_RY, VIC_RIG_RZ: rotation angles (degrees)
VIC_RIG_TX, VIC_RIG_TY, VIC_RIG_TZ: translation vector (mm)
Example: {@VIC_RIG_RY} - shows the RY (stereo angle) for the rig.
Analysis Settings:
VIC_STRAIN_FILTER_SIZE: size of strain filter used (pixels)
VIC_STRAIN_TENSOR: type of tensor
VIC_SUBSET_SIZE: subset size (pixels)
VIC_STEP_SIZE: step size (pixels)
Example: {@VIC_SUBSET SIZE} - show the subset size for the analysis.
Tables (VIC_TABLE_CSV):
The template generator supports generation of tables from comma-separated variable files using the tag VIC_TABLE_CSV. This tag has to be added to the name field (ODT) of an existing table. The last row of the table in the template must contain spreadsheet column specifiers.
file: path to csv file on disk
start: integer value for start row
end: integer value for end row, or -1 to use entire table
Plots
@VIC_PLOT_2D: Inserts a 2D plot.
2D plots support the following options:
idx: the image index (default 0)
cam: the camera to view (default 0)
var: the name of the variable to plot (default "W")
c_range: the contour range, separated by a colon
@VIC_PLOT_3D: Inserts a 3D plot.
3D plots support the following options:
idx: the image index (default 0)
cam: the camera to view (default 0)
var: the name of the variable to plot (default "W")
c_range: the contour range, separated by a colon
view_angles: the 3 viewing angles, separated by colons (default 60:0:30)
@VIC_IMG_EXTERNAL: Inserts an arbitrary image.
External images support the following option:
file: the file name
@VIC_IMG_REFERENCE: Inserts the reference speckle image.
The reference image tag supports the following options:
cam: the camera to view (default 0)
@VIC_IMG_SPECKLE: Inserts a speckle image.
The speckle image tag supports the following options:
idx: the actual image number (not a percentage or negative number)
cam: the camera to view (default 0)
@VIC_IMG_AOI: Inserts the reference image with the AOI overlaid.
The AOI image tag supports the following options:
subset: set "subset=true" to show the subset grid overlaid on the AOI.
startpoints: set "starpoints=true" to show start points overlaid on the AOI.
Nick Lovaas
Comments