Learn R Programming

espadon (version 1.11.3)

struct.from.bin: Creation of struct class object from a binary volume

Description

The struct.from.bin function creates a struct object with a unique RoI, defined by the contours of binary volume.

Usage

struct.from.bin(
  vol,
  roi.name = vol$description,
  roi.nb = 1,
  roi.color = "#379DA2",
  roi.type = c("", "EXTERNAL", "PTV", "CTV", "GTV", "TREATED_VOLUME", "IRRAD_VOLUME",
    "OAR", "BOLUS", "AVOIDANCE", "ORGAN", "MARKER", "REGISTRATION", "ISOCENTER",
    "CONTRAST_AGENT", "CAVITY", "BRACHY_CHANNEL", "BRACHY_ACCESSORY", "BRACHY_SRC_APP",
    "BRACHY_CHNL_SHLD", "SUPPORT", "FIXATION", "DOSE_REGION", "CONTROL",
    "DOSE_MEASUREMENT"),
  external.only = FALSE,
  alias = "",
  description = paste("RoI from", vol$object.alias)
)

Value

Returns a "struct" class object (see espadon.class

for class definition), including the unique roi.name as region of interest.

Arguments

vol

"volume" class object, of binary modality.

roi.name

Character string, representing the name of created RoI.

roi.nb

Positive integer, representing the number of created RoI.

roi.color

Color of the created RoI, in hex code format ("#RRGGBB").

roi.type

Type of RoI, from among "", "EXTERNAL", "PTV", "CTV", "GTV", "TREATED_VOLUME", "IRRAD_VOLUME", "OAR", "BOLUS", "AVOIDANCE", "ORGAN", "MARKER", "REGISTRATION", "ISOCENTER", "CONTRAST_AGENT", "CAVITY", "BRACHY_CHANNEL", "BRACHY_ACCESSORY", "BRACHY_SRC_APP", "BRACHY_CHNL_SHLD", "SUPPORT", "FIXATION", "DOSE_REGION","CONTROL" and "DOSE_MEASUREMENT"

external.only

Boolean. If TRUE, only external contours are kept.

alias

Character string, $alias of the created object.

description

Character string, describing the created object.

Examples

Run this code
# Contours of a sphere of 10 mm radius
b.sphere <- vol.create (n.ijk = c (40, 40, 40), dxyz = c(1,1,1), 
                        mid.pt = c (0, 0, 0), modality = "binary", 
                        default.value = FALSE)
xyz <- expand.grid (-20:19, -20:19, -20:19)
R <- 10
Sphere.flag <- (xyz[, 1]^2 + xyz[, 2]^2 + xyz[, 3]^2) <= R^2
b.sphere$vol3D.data[Sphere.flag] <- TRUE
b.sphere$max.pixel <- TRUE
S.sphere <- struct.from.bin (b.sphere, roi.name = "sphere", external.only = TRUE)
str (S.sphere$roi.info)                 

Run the code above in your browser using DataLab