View source: R/xlsx_from_dcm.R
xlsx.from.dcm | R Documentation |
The xlsx.from.dcm
function creates an Excel file from
DICOM files.
xlsx.from.dcm(
dcm.filenames,
xlsx.filenames,
multipage = TRUE,
txt.sep = "\\",
txt.length = 100,
tag.dictionary = dicom.tag.dictionary()
)
dcm.filenames |
String vector, representing the list of full names of DICOM files. |
xlsx.filenames |
String vector, representing the list of full names of
created *.xlsx files. If |
multipage |
Boolean. If TRUE, all |
txt.sep |
String. Used if |
txt.length |
Positive integer. Used if |
tag.dictionary |
Dataframe, by default equal to dicom.tag.dictionary, whose structure it must keep. This dataframe is used to parse DICOM files. |
Returns a boolean vector, establishing the existence of the created Excel files.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.