histo.2D {espadon}R Documentation

2D histograms of 2 volumes

Description

The histo.2D function creates a "histo2D" class object, containing the two-dimensional array of histograms of two "volume" class objects that have the same grid.

Usage

histo.2D(
  x.vol,
  y.vol,
  x.breaks = NULL,
  y.breaks = NULL,
  include.outer = TRUE,
  alias = "",
  description = ""
)

Arguments

x.vol, y.vol

"volume" class objects. The 2 volumes must have the grid (i.e. share the same voxels location).

x.breaks, y.breaks

Vectors giving the breakpoints of x and y axes. See Details.

include.outer

Boolean. If include.outer = TRUE, the values out the x.breaks and y.breaks of each volume are counted in the first and the last cell of the histograms. They are not taken into account otherwise.

alias

Character string, $alias of the created object

description

Character string, describing the created object.

Details

The arguments x.breaks and y.breaks represent the scales of the x and y axes of 2D-histogram graph. If they are NULL, the histo.2D function defaults to 256 cells between the values vol$min.pixel and vol$max.pixel.

Value

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

See Also

display.2D.histo.

Examples

# loading of toy-patient objects (decrease dxyz for better result)
step <- 4
patient <- toy.load.patient (modality = c("ct", "mr", "rtstruct"), 
                             roi.name =  "brain", 
                             dxyz = rep (step, 3))
CT <- patient$ct[[1]]
MR <- patient$mr[[1]]
S <- patient$rtstruct[[1]]
T.MAT <- patient$T.MAT

# restriction of the volume around the RoI
CT.on.roi <- nesting.roi (CT, S, roi.name = "brain", vol.restrict = TRUE,
                          xyz.margin = c (1, 1, 1), alias = CT$description)
MR.on.CT <- vol.regrid (vol = MR, back.vol = CT.on.roi, interpolate = TRUE,
                        T.MAT = T.MAT, alias = CT$description,
                        description = NULL)
# selection of voxels included in the RoI.
roi.bin <- bin.from.roi (vol = CT.on.roi, struct = S, roi.sname = "brain")
MR.select <- vol.from.bin (MR.on.CT, roi.bin, alias = MR$description)
CT.select <- vol.from.bin (CT.on.roi, roi.bin, alias = CT$description)
# 2D histogram
H2D <- histo.2D (MR.select, CT.select, x.breaks = seq (50, 400, 10),
			  y.breaks = seq (50, 400, 10), alias = "H2D MR CT")
str (H2D)

[Package espadon version 1.6.0 Index]