histo.2D | R Documentation |
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.
histo.2D(
x.vol,
y.vol,
x.breaks = NULL,
y.breaks = NULL,
include.outer = TRUE,
alias = "",
description = ""
)
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 |
alias |
Character string, |
description |
Character string, describing the created object. |
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
.
Returns a "histo2D" class object. This is a list including:
$patient
: set to x.vol$patient
.
$patient.name
: set to x.vol$patient.name
.
$patient.bd
: set to x.vol$patient.bd
.
$patient.sex
: set to x.vol$patient.sex
.
$file.basename
: set to "".
$file.dirname
: set to "".
$object.name
: set to "".
$object.alias
: alias of the histo2D object.
$frame.of.reference
: set to x.vol$frame.of.reference
.
$ref.pseudo
: set to x.vol$ref.pseudo
.
$modality
: set to "histo2D"
.
$description
: description of the histo2D object.
$creation.date
: set to Sys.Date
.
$nb.pixels
: number of elements in the density.map
.
$x.file.src
: set to x.vol$object.alias
$y.file.src
: set to y.vol$object.alias
x.breaks
: vector of x-axis breakpoints.
y.breaks
: vector of y-axis breakpoints.
x.mids
: vector of x-axis cell centers.
y.mids
: vector of y-axis cell centers.
density.map
: array of densities.
total.counts
: number of counted voxels.
display.2D.histo.
# 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",
verbose = FALSE)
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.