load.T.MAT | R Documentation |
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.
load.T.MAT(dirname, upgrade.to.latest.version = FALSE)
dirname |
Full paths of the directories of a single patient, or vector of full.path of Rdcm.files. |
upgrade.to.latest.version |
Boolean. If |
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
.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.