Learn R Programming

IFC (version 0.1.2)

buildMask: IFC Mask Coercion

Description

Helper to build a mask.

Usage

buildMask(
  masks,
  images,
  definition = TRUE,
  to_match_mask = NULL,
  to_replace_mask = NULL,
  to_match_image = NULL,
  to_replace_image = NULL,
  ...
)

Arguments

masks

an `IFC_masks` object or a data.frame containing masks definition and name. Default is missing.

images

a data.frame containing images definition. Default is missing.

definition

whether to compute masks definition or masks names. Default is TRUE, to compute definition.

to_match_mask

a vector of masks names to use for matching 'masks' names. Default is NULL

to_replace_mask

a vector of masks names to use for replacing 'masks' names. Default is NULL

to_match_image

a vector of images names to use for matching 'images' names. Default is NULL

to_replace_image

a vector of images names to use for replacing 'images' names. Default is NULL

...

Other arguments to be passed.

Value

a vector of masks definition or names depending on 'definition' parameter.

Details

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