struct.from.bin {espadon}R Documentation

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)
)

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.

Value

Returns a "struct" class object (see espadon.class for class definition), including the unique roi.name as region of interest.

Examples

# 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)                 

[Package espadon version 1.6.0 Index]