# First, save toy.dicom.raw () raw data to a temporary file pat.dir for testing.
pat.dir <- file.path (tempdir(), "PM_dcm")
dir.create (pat.dir, recursive = TRUE)
dcm.filename <- tempfile (pattern = "PMrtplan", tmpdir = pat.dir, fileext = ".dcm")
zz <- file (dcm.filename, "wb")
writeBin (toy.dicom.raw (), zz, size = 1)
close (zz)
list.files (pat.dir)
# Creating an Excel file
xlsx.fnames <- file.path (pat.dir,
paste (basename (dcm.filename),"xlsx", sep = "."))
xlsx.from.dcm (dcm.filename, xlsx.fnames)
list.files (pat.dir)
# Cleaning temporary directory
unlink (pat.dir, recursive = TRUE)
Run the code above in your browser using DataLab