Converts an 'EBImage' class object back into the 'BioThermR' framework. This function is designed to integrate results from external morphological operations (e.g., watershed segmentation, filtering) back into the standard BioThermR analytical workflow.
Arguments
- eb_img
An
Imageobject (from the 'EBImage' package).- template_obj
Optional. An existing 'BioThermR' object to update. Providing this ensures that original metadata (like filenames and original raw data) is retained. Default is
NULL.- name
String. The name assigned to the new object (used only if
template_objisNULL). Default is "Imported_EBImage".- mask_zero
Logical. If
TRUE, converts values of 0 in the imported matrix toNA. This is particularly useful when importing binary masks where 0 represents the background, as BioThermR usesNAto exclude background pixels from statistical calculations. Default isFALSE.
Details
This function supports two modes:
Update Mode: If
template_objis provided, the input image replaces theprocessedmatrix of the template. Metadata (filename, path) is preserved. Statistics are reset toNULLas the data has changed.Create Mode: If
template_objisNULL, a new 'BioThermR' object is created from scratch using the input matrix.
If the input eb_img has more than 2 dimensions (e.g., color/RGB), only the first channel
is utilized, and a warning is issued.