Extracts the thermal matrix (raw or processed) from a 'BioThermR' object and converts it into an 'EBImage' class object. This conversion is essential for applying advanced morphological operations (e.g., thresholding, watershed, labeling) provided by the 'EBImage' package.
Arguments
- img_obj
A 'BioThermR' object.
- use_processed
Logical. If
TRUE(default), uses the 'processed' matrix (which might already have masks applied). IfFALSE, uses the 'raw' temperature matrix.- replace_na
Numeric. The value to replace
NAs with, as 'EBImage' does not support missing values. Default is 0 (typically treated as background).- normalize
Logical. If
TRUE, scales the matrix values linearly to the range [0, 1]. This is highly recommended for visualization or standard thresholding algorithms (like Otsu) in 'EBImage'. Default isFALSE(preserves actual temperature values).
Examples
if (FALSE) { # \dontrun{
# Load data
my_obj <- read_thermal_flir("data/mouse.jpg")
# Convert to EBImage format with normalization (for thresholding)
eb_norm <- as_EBImage(my_obj, normalize = TRUE)
# Convert preserving temperature values (for calculation)
eb_temp <- as_EBImage(my_obj, normalize = FALSE)
} # }