All code for this document is located here.
In many image analyses, you would like to see a set of images. These images may be an image with an overlay or a set of overlays, or multiple sequences of the data, or multiple sequences with sets of overlays. Either way, we can display them with the papayaWidget
package. Many instances, however, we’d like to keep the cursor the same when viewing areas.
Here we will use the MNITemplate
package to get the MNI data into R, including the T1-weighted image and a segmentation:
library(MNITemplate)
library(papayaWidget)
img1 = MNITemplate::readMNI()
img2 = MNITemplate::readMNISeg()
## Label 0: Background
## Label 1: CSF
## Label 2: GM
## Label 3: WM
Here we view the images using a static orthographic view using neurobase::ortho2
library(neurobase)
## Loading required package: oro.nifti
## oro.nifti 0.11.0
ortho2(img1)
ortho2(img2)
Using papayaWidget::papaya
, however, we can view the images dynamically, which works within Shiny as well as RMarkdown!
papaya(img1)