## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
has_python = nzchar(Sys.getenv("OSIRAD_PYTHON"))

## -----------------------------------------------------------------------------
library(osirad)
xml_file = system.file("extdata", "phantom", "ROI.xml", package = "osirad")
pet_dir = system.file("extdata", "phantom", "pet", package = "osirad")

## -----------------------------------------------------------------------------
x = extract_roi_voxels(xml_file, pet_dir)
x
head(x$voxels)

## -----------------------------------------------------------------------------
x$match

## ----fig.width = 6, fig.height = 6--------------------------------------------
plot_roi_slices(x, image_index = 2:5)

## ----eval = FALSE-------------------------------------------------------------
# write.csv(x$voxels, "roi_voxels.csv", row.names = FALSE)

## ----eval = has_python--------------------------------------------------------
# rad = pyradiomics_features(x, pet_dir, python = Sys.getenv("OSIRAD_PYTHON"))
# head(rad$features)
# rad$check

