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 data = TRUE, either the values of the voxels when modality is (ct, mr, rtdose), or the coordinates of the RoI when modality is rtstruct, are loaded into memory.

nb

Vector of integers, active only if data = TRUE, and only operating on rtstruct. If nb = NULL, all the RoI of rtstruct are loaded into memory. Otherwise only data of the RoI indices defined by the vector nb are loaded.

upgrade.to.latest.version

Boolean. If TRUE, the function attempts to upgrade to the latest version, parsing the DICOM data. It may take longer to load the data. Consider using the Rdcm.upgrade function.

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)  

[Package espadon version 1.7.0 Index]