export {espadon}R Documentation

Export espadon objects in dicom format

Description

The export function exports struct class objects and volume class objects with CT or RTDOSE modality in DICOM format.

Usage

export(
  obj,
  format = "dcm",
  ref.obj.list = NULL,
  use.original.UIs = FALSE,
  use.original.ref.UIs = TRUE,
  file.prefix = "",
  file.dirname = ".",
  file.name = NULL,
  tag.dictionary = dicom.tag.dictionary(),
  ...
)

Arguments

obj

espadon object of rtstruct, ct or rtdose modality to be exported.

format

Format of the export. For next use.

ref.obj.list

List of espadon objects which are referenced objects of obj. See Details.

use.original.UIs, use.original.ref.UIs

Booleans. If TRUE, study instance UID, serie instance UID and image type attribute are those indicated in $object.info item. Otherwise,They are regenerated. See Details.

file.prefix

String. Prefix added to the generated filename, in case of file.name is NULL.

file.dirname

String. Name of the directory in which files are generated.

file.name

String. Base name of the generated files. in CT modality, a slice number is added as a suffix.

tag.dictionary

Dataframe, by default equal to dicom.tag.dictionary, whose structure it must keep. This dataframe is used to parse DICOM files.

...

Additional settings such as NAvalue (for "volume" data), '(0020,000D)', '(0020,000E)', '(0008,0008)'

Details

The object you want to export may be known in a TPS thanks to these Unique Identifiers (UIs). If you want to create a DICOM object that is different and recognised by your TPS, it is important that the DICOM files you want to create have new UIs: in this case, set the use.original.UIs argument to FALSE. Otherwise, UIs in $object.info item of your object will be used.

Your object may have been created from another DICOM object (i.e. a reference object). You can, for example, see these links with the function display.obj.links.

If you want to keep this links, you must indicate which objects are references in the ref.obj.list argument, in the form of a list of espadon objects. If these reference objects have their own identifier and you wish to keep them, you must set the use.original.ref.UIs argument to TRUE.

Otherwise (use.original.ref.UIs=FALSE), the UIs of the reference objects will be regenerated. It is therefore important that the reference objects contain all their data such as vol3D.data or roi.data.

It may be useful to impose a study number (tag '(0020,000D)'), serial number (tag '(0020,000E)'), or your Image Type Attribute (tag '(0008,0008)'). In this case, you need to add the arguments '(0020,000D)' = your_study_UID, '(0020,000E)' = your_serial_UID, '(0008,0008)' = your_image_type_attribute.

Value

Returns nothing, but generate DICOM files if conditions are required, and indicates the name or number of files created

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", "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)


[Package espadon version 1.7.2 Index]