# 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", "rtstruct"), roi.name = "",
dxyz = c (6, 6, 6))
dicom.dir <- file.path (tempdir(), "PM_dcm")
export(patient$rtstruct[[1]], ref.obj.list = list (patient$ct[[1]]),
file.dirname = dicom.dir,file.name="RS")
export(patient$ct[[1]], file.dirname = dicom.dir,file.name="CT")
list.files(dicom.dir)
# check that the links have been preserved.
pat <- load.patient.from.dicom (dicom.dir, verbose = FALSE)
display.obj.links (pat)
# Cleaning temporary directories
unlink (dicom.dir, recursive = TRUE)
Run the code above in your browser using DataLab