powered by
Threshold an object, typically to produce a mask
threshold(x, ...)# S3 method for im3d threshold( x, threshold = 0, mode = c("logical", "integer", "raw", "numeric"), ... )
# S3 method for im3d threshold( x, threshold = 0, mode = c("logical", "integer", "raw", "numeric"), ... )
an oject with attributes matching x and elements with value
x
as.vector(TRUE, mode=mode) i.e. TRUE, 1, 0x01 and
as.vector(TRUE, mode=mode)
TRUE, 1, 0x01
as.vector(FALSE, mode=mode) i.e. FALSE, 0, 0x00 as appropriate.
as.vector(FALSE, mode=mode)
FALSE, 0, 0x00
Object to be thresholded
Additional arguments passed to methods
Either a numeric value that pixels must exceed in order to be included in the mask or a logical vector defining foreground pixels.
logical
The storage mode of the resultant object (see vector
vector
Note that threshold.im3d passes ... arguments on to im3d
threshold.im3d
Other im3d: as.im3d(), boundingbox(), im3d-coords, im3d-io, im3d(), imexpand.grid(), imslice(), is.im3d(), mask(), origin(), projection(), unmask(), voxdims()
as.im3d()
boundingbox()
im3d-coords
im3d-io
im3d()
imexpand.grid()
imslice()
is.im3d()
mask()
origin()
projection()
unmask()
voxdims()
x=im3d(rnorm(1000),dims=c(10,10,10), BoundingBox=c(20,200,100,200,200,300)) stopifnot(all.equal(threshold(x, 0), threshold(x, x>0)))
Run the code above in your browser using DataLab