Helper to build a mask.
buildMask(
masks,
images,
definition = TRUE,
to_match_mask = NULL,
to_replace_mask = NULL,
to_match_image = NULL,
to_replace_image = NULL,
...
)
a vector of masks definition or names depending on 'definition' parameter.
an `IFC_masks` object or a data.frame containing masks definition and name. Default is missing.
a data.frame containing images definition. Default is missing.
whether to compute masks definition or masks names. Default is TRUE, to compute definition.
a vector of masks names to use for matching 'masks' names. Default is NULL
a vector of masks names to use for replacing 'masks' names. Default is NULL
a vector of images names to use for matching 'images' names. Default is NULL
a vector of images names to use for replacing 'images' names. Default is NULL
Other arguments to be passed.
function that can either change definition or name it will be used in a loop to incorporate new definition. causing name to be changed. allowing new redefinition of mask dependent on other mask to be changed, and so on when a mask or an image name is not found because not yet defined an error is raised and catched TODO maybe this error catching causes some overhead to be improved