polyExtractTo: Shortcut for Batch Images or Masks Extraction

View source: R/ExtractToFuns.R

polyExtractToR Documentation

Shortcut for Batch Images or Masks Extraction

Description

Function to shortcut extraction, normalization and eventually colorization of images or masks to various format.

Usage

polyExtractTo(
  ...,
  objects,
  offsets,
  display_progress = TRUE,
  image_type = "img",
  export = "matrix",
  mode = "raw"
)

Arguments

...

arguments to be passed to objectExtract with the exception of 'ifd' and 'bypass'(=TRUE).
/!\ If not any of 'fileName', 'info' and 'param' can be found in '...' then attr(offsets, "fileName_image") will be used as 'fileName' input parameter to pass to objectParam.

objects

integer vector, IDEAS objects ids numbers to use. This argument is not mandatory, if missing, the default, all objects will be used.

offsets

object of class 'IFC_offset'. This argument is not mandatory but it may allow to save time for repeated image export on same file.
If 'offsets' are not provided, extra arguments can also be passed with '...' to getOffsets.

display_progress

whether to display a progress bar. Default is TRUE.

image_type

(subsetOffsets argument) type of desired object offsets. Default is "img". Allowed are "img" or "msk".

export

(objectParam argument) format mode export. Either "file", "matrix", "base64". Default is "matrix".

mode

(objectParam argument) color mode export. Either "raw", "rgb", "gray". Default is "raw".

Details

If 'param' is provided in '...', 'param$export'<-'export' and 'param$mode'<-'mode' only will be overwritten.

Value

A list (for every extracted objects) of list (for every exported channels) depending on 'param$export' parameter:
-"matrix", a matrix when 'param$mode' is set to "raw" or "gray" OR an array when 'param$mode' is "rgb",
-"base64", a data-uri string,
-"file", an invisible file path corresponding to the location of exported file(s).

Note

Arguments of objectExtract will be deduced from input arguments.


IFC documentation built on Sept. 14, 2023, 1:08 a.m.