plot {espadon} | R Documentation |
plot a 2D cut of a 3D object
Description
The plot
function displays the requested map
of espadon objects of class "volume", "struct", "mesh".
Usage
## S3 method for class 'volume'
plot(
x,
...,
view.type = "trans",
view.coord = NULL,
flip = FALSE,
flop = FALSE,
cut.interpolate = TRUE,
display.interpolate = FALSE,
col = grey.colors(255, start = 0, end = 1),
breaks = NULL,
sat.transp = FALSE
)
## S3 method for class 'struct'
plot(
x,
...,
view.type = "trans",
view.coord = NULL,
flip = FALSE,
flop = FALSE,
roi.name = NULL,
roi.sname = NULL,
roi.idx = NULL,
back.dxyz = c(0.5, 0.5, x$thickness)
)
## S3 method for class 'mesh'
plot(
x,
...,
view.type = "trans",
view.coord = NULL,
flip = FALSE,
flop = FALSE,
col = "#ff0000"
)
Arguments
x |
object of class "volume", "struct" or "mesh". See espadon.class |
... |
others parameters of plot functions. See details |
view.type |
character string among the values 'ij', 'ji', 'ik', 'ki', 'jk', 'kj', 'yx', 'xz', 'zx', 'yz', 'zy', 'trans', 'front' or 'sagi" representing the map to be displayed. |
view.coord |
value representing the coordinate where the map is displayed.
This parameter can be a 3D-vector, representing the coordinate of the point on
the displayed map. If |
flip |
Boolean defaults to |
flop |
Boolean defaults to |
cut.interpolate |
Boolean, indicating whether to calculate the volume cut using linear interpolation. |
display.interpolate |
Boolean, indicating whether to apply linear interpolation when displaying the cut. |
col |
Vector, representing the color palette of the image, if |
breaks |
One of :
|
sat.transp |
Boolean. If |
roi.name |
Vector of exact names of the RoI in the |
roi.sname |
Vector of names or parts of names of the RoI in the |
roi.idx |
Vector of indices of the RoI that belong to the |
back.dxyz |
3D vector of voxel size, used to calculate contours in frontal or sagittal view. |
Details
... can be xlim, ylim, add, bg etc. If view.type
is egal to
'trans' or 'front' or 'sagi', the direction of xlim and ylim is ignored.
If roi.name
, roi.sname
, and roi.idx
are
all set to NULL
, all closed planar or point RoI, present at view.coord
are selected.
Value
Returns a display of the \(k^{th}\) image plane of x
.
See Also
display.plane, display.kplane, display.palette, pal.RVV, pal.rainbow.
Examples
# loading of toy-patient objects (decrease dxyz and increase beam.nb for
# better result)
step <- 5
patient <- toy.load.patient (modality = c("ct","mr", "rtdose", "rtstruct"),
dxyz = rep (step, 3), beam.nb = 3)
MR <- patient$mr[[1]]
CT <- patient$ct[[1]]
D <- patient$rtdose[[1]]
S <- patient$rtstruct[[1]]
# display 1
layout (matrix(c(1,1,2,3), ncol=2), widths=c(1,0.2))
plot (CT, view.coord = 0, col = pal.RVV(255))
S_plot <- plot (S, view.coord = 0, add = TRUE, lwd = 2)
display.palette (col = pal.RVV(255), main="HU")
display.legend (S_plot, bg="white", text.col="black", lwd = 2, cex = 1.1)
# display 2
layout (matrix(c (1, 1, 2, 3), ncol = 2), widths = c (1, 0.2))
# Coordinates of the PTV barycenter in CT frame of reference
G <- as.numeric (S$roi.info[S$roi.info$roi.pseudo == "ptv",
c ("Gx", "Gy", "Gz")])
# Coordinates of the PTV baricenter in MR frame of reference
G_MR <- as.numeric (c(G, 1) %*%
t(get.rigid.M(CT$ref.pseudo, MR$ref.pseudo,
T.MAT = patient$T.MAT)))[1:3]
plot (MR, view.type = "sagi", view.coord = G_MR,
col = grey.colors (255, start = 0, end = 1),
breaks = seq (0, 500, length.out = 256) , bg = "darkblue")
plot (vol.in.new.ref(D, MR$ref.pseudo, T.MAT = patient$T.MAT),
view.type = "sagi", view.coord = G_MR,
col = pal.rainbow(255), add = TRUE)
display.palette (col = grey.colors (255, start = 0, end = 1),
breaks = seq (0, 500, length.out = 256), main="MR")
display.palette (col = pal.rainbow(255),
breaks = seq (D$min.pixel, D$max.pixel, length.out = 256),
main="Gy")
layout(1)