histo.from.roi {espadon}R Documentation

Histogram according to a RoI

Description

The histo.from.roi function calculates the histogram of the volume voxels belonging to a RoI.

Usage

histo.from.roi(
  vol,
  struct,
  roi.name = NULL,
  roi.sname = NULL,
  roi.idx = NULL,
  T.MAT = NULL,
  breaks = NULL,
  MC = NULL,
  sd = c(1, 1, 1),
  offset = c(0, 0, 0),
  over.sampling.factor = 1,
  alias = "",
  description = NULL
)

Arguments

vol

"volume" class object

struct

"struct" class object.

roi.name

Exact name of a RoI in struct object. By default roi.name = NULL. See Details.

roi.sname

Name or part of name of a RoI in struct object. By default roi.sname = NULL. See Details.

roi.idx

Value of the index of a RoI that belong to the struct object. By default roi.idx = NULL. See Details.

T.MAT

"t.mat" class object, created by load.patient.from.Rdcm, load.patient.from.dicom or load.T.MAT. If T.MAT = NULL, struct$ref.pseudo must be equal to vol$ref.pseudo.

breaks

Vector giving the breakpoints between histogram cells. If breaks = NULL, the chosen breakpoints are those used by the hist function by default. If breaks are specified, outside values of vol$vol3D.data are not taken into account.

MC

If different from NULL (default value), number of calculations that will be performed, by Monte-Carlo, by randomly moving the chosen RoI over a random distance, generated according to a normal distribution with mean translation defined by offset and standard deviation sd.

sd

Vector representing the standard deviation of distances in the 3 directions x, y and z.

offset

Vector representing the translation of the RoI in the 3 directions x, y and z.

over.sampling.factor

Strictly positive integer, or a vector of 3 strictly positive integers, default to 1. Defined to oversample grids of vol. Oversampling can be very time consuming.

alias

Character string, $alias of the created object

description

Character string, describing the the created object. If the description = NULL (default value), it will be set to struct$roi.info$roi.pseudo[roi.idx]

Details

roi.name, roi.sname, and roi.idx must select only one RoI.

Value

Returns "histo" class object. This is a list including:

Note

Using Monte-Carlo can be time consuming for large RoI.

If you only want the result just for a translation, use the arguments MC = 1, sd = 0 and offset = desired translation vector.

See Also

histo.vol, histo.from.bin, display.histo, display.dV_dx

Examples

# loading of toy-patient objects (decrease dxyz and increase beam.nb for better
# result)
step <- 5
patient <- toy.load.patient (modality = c("rtdose", "rtstruct"), 
                             roi.name = "gizzard", dxyz = rep (step, 3), 
                             beam.nb = 3)

# Calculation of the histogram
H <- histo.from.roi (patient$rtdose[[1]], patient$rtstruct[[1]], 
                     roi.name = "gizzard", 
                     breaks = seq (0, 60, by = 1))
str (H)

[Package espadon version 1.6.0 Index]