Other Inputs
This article describes the different options available when selecting the input for a new variable in the APP Author.
Error code
If Error code is selected as input, no further selections should be made. This option is used to view program errors, e.g. lack of memory during batch calculation. The output is a code signifying a specific error type. Contact program vendor for information on error codes
Measure
Choose a Measurement to use as output.
Analysis protocol name
If analysis protocol name is selected as input, no further selections should be made. This option saves the name of the applied protocol as a variable.
Script
If Run Script is selected as the output variable, Visiopharm will execute an R-script, allowing custom calculations to be created for the output variable. The file follows the standard UTF8 text file format, and uses US locale for all numbers (. As Decimal separator). The file can contain any number of lines and variables in any format. Anything after a # in a line will be regarded as comments. The label, ROI and input image are passed as arguments when running the R script. Extract them with the line:
args <- commandArgs(trailingOnly=TRUE)
Where args[1] contains the label image, args[2] the ROI image and args[3] the input image. Load these images as arrays of type 'double' with the function readTIFF. This requires that the tiff package for R is installed and loaded (used instead of rtiff package). The package is installed and loaded with the following commands:
install.packages("tiff")
library(tiff)
With the tiff package the images are loaded as arrays of type 'double' with the function readTIFF. The pixel values are loaded from the byte format (0..255) to the double range (0..1). For example, a value of 3/255 (~0.012) in the label image indicates that the pixel belongs to the third label type (not including the Clear label, which has value 0). The same applies to the ROI image. This line loads the label image into a variable named label:
label <- readTIFF(args[1])
When using a script for an output variable, the image arguments are read-only, meaning an image cannot be written back using the writeTIFF command. However, the fourth parameter (args[4]) represents the output text file.
Heatmap
If Heatmap is selected as input, there is an option to save an object heatmap feature to the database as an overlay, similar to other overlay types in Visiopharm (e.g., ROIs, Labels, etc.). This is great functionality that ease the visualization of heatmaps.
- Heatmap Source - Select a feature that contains the heatmap to be saved.
- Feature range - Enter a range that the output heatmap should have. The output heatmap will stretch the feature range to a "jet" color scheme (Image_analysis.Calculate.ObejctHeatmap_jet). E.g. if a range [50->100] is selected, all pixels with a feature value below 50 will be set to 50 (blue color), all pixels with a feature value above 100 will be set to 100 (red color) and the values in between will be stretched to the color scheme. If the feature range is left empty, Visiopharm will auto scale the heatmap output to the minimum and maximum feature values of the heatmap source.
- The Heatmap have the option to make lower values transparent. This will make all pixels with a feature value below the minimum feature range value transparent.
APP execution log
To log APP executions to the audit log, a variable must be added in the APP Author. If APP Execution Log is selected as input, no further selections should be made. The APP execution log is not added as an information field measurement in the database. Instead, it is logged to the audit log.