Learn R Programming

espadon (version 1.11.3)

ref.add: Adding a frame of reference in T.MAT

Description

The ref.add function adds the transfer matrices from or to a new frame of reference defined from 2 unit vectors and an origin point.

Usage

ref.add(
  src.ref,
  orientation = c(1, 0, 0, 0, 1, 0),
  origin = c(0, 0, 0),
  new.ref.pseudo = "newref",
  T.MAT = NULL
)

Value

Returns a "t.mat" class object, which contains the transfer matrices from or to new.ref.pseudo pseudonym of the new frame of reference. If the T.MAT is NULL, then the returned object will contain only 4 matrices: "src.ref<-src.ref", "src.ref<-new.ref.pseudo", "new.ref.pseudo<- new.ref.pseudo", "new.ref.pseudo<-src.ref".

Returns a NULL if orientation is not well defined.

Arguments

src.ref

Character string, pseudonym of the frame of reference in which the orientation vector and the origin point origin are defined.

orientation

Vector of 6 or 9 elements, composed of the coordinates of the 2 orthonormal vectors (i, j), or of the 3 orthonormal vectors (i, j, k) of the new coordinate system, in the src.ref frame of reference.

origin

Vector of the x, y, z coordinates of the origin point of the new frame of reference in the src.ref frame of reference. Default to c (0, 0, 0).

new.ref.pseudo

Character string, pseudonym of the new frame of reference to add.

T.MAT

"t.mat" class object created by load.patient.from.dicom, load.patient.from.Rdcm or load.T.MAT. If T.MAT = NULL, then only the link between src.ref and new.ref.pseudo is computed.

See Also

ref.cutplane.add, ref.remove, ref.srctodest.add.

Examples

Run this code
# Adding of the reference frame "ref1_60", which is a 60 degree rotation of 
# reference frame "ref1".
orientation <- c (cos (pi / 3), sin (pi / 3), 0, 
                  -sin (pi / 3), cos (pi / 3), 0)

local.Tmat <- ref.add (src.ref = "ref1", orientation = orientation,
                  new.ref.pseudo = "ref1_60")

str(local.Tmat)

Run the code above in your browser using DataLab