bin.sum {espadon}R Documentation

Sum of two binaries


The bin.sum function creates a "volume" class object of "binary" modality, representing the sum (logical OR) of two binary objects.


bin.sum(vol1, vol2, alias = "", description = NULL)


vol1, vol2

"volume" class objects of "binary" modality.


Character string, $alias of the created object.


Character string, describing the created object. If description = NULL (default value), it will be set to paste (vol1$object.alias, "+", vol2$object.alias).


Returns a "volume" class object of "binary" modality (see espadon.class for class definitions), with the same grid as vol1 and vol2, sum of vol1 and vol2.


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

z.leye<- S$$Gz[S$$roi.pseudo == "lefteye"]

# 'left eye' et 'right eye' binaries
bin.left.eye <- bin.from.roi (CT, struct = S, roi.sname = "lefteye",
                              alias = "left eye")
bin.right.eye <- bin.from.roi (CT, struct = S, = "righteye",
                               alias = "right eye")
bin.eyes <- bin.sum (bin.left.eye, bin.right.eye, alias = "eyes")

display.plane (CT, top = bin.eyes, struct = S, roi.sname = "eye",
               view.coord = z.leye, legend.shift = -90 ,
               interpolate = FALSE)

[Package espadon version 1.2.0 Index]