load.obj.from.Rdcm {espadon} | R Documentation |
Loading an espadon object from *.Rdcm file
Description
The load.obj.from.Rdcm
function loads a DICOM object into
memory, creating a list containing the information necessary for its subsequent
use with the espadon package.
Usage
load.obj.from.Rdcm(
Rdcm.filename,
data = TRUE,
nb = NULL,
upgrade.to.latest.version = FALSE
)
Arguments
Rdcm.filename |
Character string, representing the full name of a *.Rdcm file created by dicom.to.Rdcm.converter. |
data |
Boolean. Only works for objects usable by the espadon package, namely
ct, mr, rtdose, rtstruct, pt... If |
nb |
Vector of integers, active only if |
upgrade.to.latest.version |
Boolean. If |
Value
Returns an espadon object of class "dvh","histo","histo2D","mesh", "rtplan","struct", "undef" or "volume" depending on the object modality. See espadon.class for class definitions.
See Also
load.obj.data and load.obj.from.dicom
Examples
# First, save toy patient objects to a temporary file pat.dir for testing.
pat.dir <- file.path (tempdir(), "PM_Rdcm")
dir.create (pat.dir, recursive = TRUE)
patient <- toy.load.patient (modality = c("ct", "mr"), roi.name = "",
dxyz = c (4, 4, 4))
save.to.Rdcm (patient$ct[[1]], dirname = pat.dir)
save.to.Rdcm (patient$mr[[1]], dirname = pat.dir)
save.T.MAT (patient$T.MAT, dirname = pat.dir)
# Rdcm files in pat.dir
list.files(pat.dir)
CT <- load.obj.from.Rdcm (file.path (pat.dir,
list.files(pat.dir, pattern="ct1[.]Rdcm")[1]),
data=TRUE)
MR <- load.obj.from.Rdcm (file.path (pat.dir,
list.files(pat.dir, pattern="mr1[.]Rdcm")[1]),
data=TRUE)
Reg <-load.obj.from.Rdcm (file.path (pat.dir,"ref1_from_ref2.Rdcm"), data=TRUE)
str(Reg)
# Cleaning temporary directory
unlink (pat.dir, recursive = TRUE)