# First, save toy.dicom.raw () raw data to a temporary file/pats.dir/toy_PM
# for testing.
toy_PM.dir <- file.path (tempdir(), "pats.dir","toy_PM")
dir.create (toy_PM.dir, recursive = TRUE)
dcm.filename <- tempfile (pattern = "toyrtplan", tmpdir = toy_PM.dir,
fileext = ".dcm")
zz <- file (dcm.filename, "wb")
writeBin (toy.dicom.raw (), zz, size = 1)
close (zz)
# function test:
pats.dir <- dirname (toy_PM.dir)
deploy.dir <- file.path (tempdir(), "deploy.dir")
design.matrix <- matrix(TRUE, nrow = length (dir (pats.dir)), ncol=3,
dimnames = list (basename (dir (pats.dir)),
c("Dr Quinn","Dr Who","Dr House")))
design.matrix
study.deployment (pats.dir, deploy.dir, design.matrix,
pid.prefix = c("zz_", "yy_", "xx_"))
# check result
list.files(deploy.dir, recursive = TRUE)
load.patient.from.dicom(deploy.dir)$patient
# Cleaning temporary directory
unlink (pats.dir, recursive = TRUE)
unlink (deploy.dir, recursive = TRUE)
Run the code above in your browser using DataLab