Wraps a widget for the Papaya JavaScript library

papaya(img = NULL, elementId = NULL, width = NULL, height = NULL,
  options = NULL)

Arguments

img

Vector of character file names or list of nifti images

elementId

ID for the element in the DOM

width

Width of the widget

height

height of the widget

options

to pass to papaya widget. Should be a list with the same number of elements as images passed in. Options can be generated using papayaOptions

Examples

img = kirby21.t1::get_t1_filenames()[1] papaya(img, options = papayaOptions(min = 0, max = 5e5))
#> Input to asJSON(keep_vec_names=TRUE) is a named vector. In a future version of jsonlite, this option will not be supported, and named vectors will be translated into arrays instead of objects. If you want JSON object output, please use a named list instead. See ?toJSON.
papaya(c(img, img), options = list(papayaOptions(alpha = 0.5), papayaOptions(alpha = 0.5, lut = "Red Overlay")) )
#> Input to asJSON(keep_vec_names=TRUE) is a named vector. In a future version of jsonlite, this option will not be supported, and named vectors will be translated into arrays instead of objects. If you want JSON object output, please use a named list instead. See ?toJSON.