load.T.MAT: Loading of information about transfer matrices between frames...

load.T.MATR Documentation

Loading of information about transfer matrices between frames of reference of patient Rdcm objects.

Description

The load.T.MAT function lists all the frames of reference of the objects included in the patient directory. It concatenates all the information of the reg matrices of a directory, creating, among other things, a list of 4x4 transfer matrices between frames of reference.

Usage

load.T.MAT(dirname, upgrade.to.latest.version = FALSE)

Arguments

dirname

Full paths of the directories of a single patient, or vector of full.path of Rdcm.files.

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 a "t.mat" class object. It is a list that includes :

  • $ref.info: dataframe giving the correspondence between the frame of reference (column $ref) of the DICOM object (TAG (0020,0052) ) and its pseudonym (column $ref_pseudo).

  • $reg.info:list of dataframes : the first one gives the PID, birthday, and sex of the patient, the second one gives the name of the source file of transfer matrices.

  • $matrix.description: dataframe giving the transfer matrix names (column $t), its source frame of reference (column $src), the destination frame of reference (column $dest), and its type ($type). Note: only the RIGID type is supported.

  • $matrix.list: list of 4X4 transfer matrices. This list contains at least as many Identity matrices as there are ref.pseudo.

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)

T.MAT <- load.T.MAT (pat.dir)
T.MAT

# Cleaning  temporary directory
unlink (pat.dir, recursive = TRUE)

espadon documentation built on April 11, 2025, 5:57 p.m.