bin.from.roi {espadon} | R Documentation |
Creation of a binary volume according to RoI
Description
The bin.from.roi
function creates a "volume" class
object, of "binary" modality, in which all the voxels of a RoI are set to TRUE
.
Usage
bin.from.roi(
vol,
struct,
roi.name = NULL,
roi.sname = NULL,
roi.idx = NULL,
T.MAT = NULL,
within = TRUE,
alias = "",
description = NULL,
...
)
Arguments
vol |
"volume" class object. |
struct |
"struct" class object. |
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 |
T.MAT |
"t.mat" class object, created by
load.patient.from.Rdcm or load.T.MAT. If
|
within |
Boolean, defaults to |
alias |
Character string, |
description |
Character string, describing the created object. If
|
... |
additional argument such as verbose |
Details
roi.name
, roi.sname
, and roi.idx
must select
only one RoI.
Value
Returns a "volume" class object of "binary" modality (see
espadon.class for class definitions), with the same grid as
vol
, in which the voxels in the RoI are set to TRUE.
See Also
Examples
# loading of toy-patient objects (decrease dxyz for better result)
step <- 3
patient <- toy.load.patient (modality = c("ct", "rtstruct"),
roi.name = c("eye", "optical nerve", "brain"),
dxyz = rep (step, 3))
CT <- patient$ct[[1]]
S <- patient$rtstruct[[1]]
# "optical nerve" binary without inclusions management
bin <- bin.from.roi (CT, struct = S, roi.sname = "left optical",
alias = "left_optical_nerve", verbose = FALSE)
display.plane (CT, top = bin, struct = S,
view.coord = S$roi.info[S$roi.info$roi.pseudo == "leftopticalnerve",]$Gz,
legend.shift = -80, interpolate = FALSE, main = "Left nerve selection")
## Not run:
# with a smaller step
step <- 1
patient <- toy.load.patient (modality = c("ct", "rtstruct"),
roi.name = c("eye", "optical nerve", "brain"),
dxyz = rep (step, 3))
CT <- patient$ct[[1]]
S <- patient$rtstruct[[1]]
# "optical nerve" binary without inclusions management
bin <- bin.from.roi (CT, struct = S, roi.sname = "left optical",
alias = "left_optical_nerve", within = FALSE,
verbose = FALSE)
display.plane (CT, top = bin, struct = S,
view.coord = S$roi.info[S$roi.info$roi.pseudo == "leftopticalnerve",]$Gz,
legend.shift = -80, interpolate = FALSE, main = "Left nerve selection")
# "optical nerve" binary with inclusions management
bin <- bin.from.roi (CT, struct = S, roi.sname = "left optical",
alias = "left_optical_nerve", within = TRUE,
verbose = FALSE)
display.plane (CT, top = bin, struct = S,
view.coord = S$roi.info[S$roi.info$roi.pseudo == "leftopticalnerve",]$Gz,
legend.shift = -80, interpolate = FALSE, main = "Left nerve selection")
## End(Not run)