# For testing, save first toy.dicom.raw () raw data to a temporary file, and
# convert it in Rdcm fie
pat.src.dir <- file.path (tempdir(), "PM_dcm")
dir.create (pat.src.dir, recursive = TRUE)
dcm.filename <- tempfile (pattern = "PM_rtplan", tmpdir = pat.src.dir,
fileext = ".dcm")
zz <- file (dcm.filename, "wb")
writeBin (toy.dicom.raw (), zz, size = 1)
close (zz)
pat.dir <- file.path (tempdir(), "PM_Rdcm")
dicom.to.Rdcm.converter (pat.src.dir, pat.dir, update = TRUE)
lf <- list.files (pat.dir, pattern = "[.]Rdcm$", full.names = TRUE)
lf
# Inspect Rdcm raw data
L <- load.Rdcm.raw.data (lf[1])
str (L, max.level =3)
# Cleaning temporary directory
unlink (pat.src.dir, recursive = TRUE)
Run the code above in your browser using DataLab