papaya: Creating a Papaya widget

Description Usage Arguments Examples

View source: R/papayaWidget.R

Description

Wraps a widget for the Papaya JavaScript library

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
papaya(
  img = NULL,
  elementId = NULL,
  width = NULL,
  height = NULL,
  options = NULL,
  sync_view = FALSE,
  hide_toolbar = FALSE,
  hide_controls = FALSE,
  orthogonal = TRUE,
  interpolation = TRUE,
  title = 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

sync_view

should the view be synced to other Papaya viewers?

hide_toolbar

Hide the toolbar for this viewer?

hide_controls

Hide the controls (increment) for this viewer?

orthogonal

Should an orthogonal view be displayed (TRUE) versus just a slice (FALSE).

interpolation

Should smoothing/interpolation be done in the viewer? This can be overridden if individual image options set interpolation as well

title

the title for the overlay itself

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
papaya(interpolation = TRUE)
papaya(interpolation = FALSE)

img = kirby21.t1::get_t1_filenames()[1]

papaya(img, options = papayaOptions(min = 0, max = 8e5))
papaya(c(img, img),
options = list(papayaOptions(alpha = 0.5),
papayaOptions(alpha = 0.5, lut = "Red Overlay"))
)

## Not run: 
papaya(img, options = papayaOptions(min = 0, max = 8e5))
papaya(c(img, img),
options = list(papayaOptions(alpha = 0.5),
papayaOptions(alpha = 0.5, lut = "Red Overlay"))
)
nii = neurobase::readnii(img)
nii = nii < 3e5 & nii > 1e5
papaya(list(img, nii), options = list(list(), papayaOptions(interpolation = FALSE)))

## End(Not run)

muschellij2/papayaWidget documentation built on Aug. 20, 2021, 1:55 a.m.