Computes the density of values of an image with the option for a mask.

# S3 method for antsImage
density(x, ..., mask)

Arguments

x

Object of class antsImage

...

Arguments passed to density.default

mask

object to subset the image. If missing, then all values of the image are plotted.

Value

Output of density

Examples

img = makeImage(c(10,10),rnorm(100)) mask = img > 0 density(img, mask = mask)
#> #> Call: #> density.default(x = x) #> #> Data: x (55 obs.); Bandwidth 'bw' = 0.1891 #> #> x y #> Min. :-0.5578 Min. :0.0006029 #> 1st Qu.: 0.5066 1st Qu.:0.0315276 #> Median : 1.5709 Median :0.0869372 #> Mean : 1.5709 Mean :0.2346393 #> 3rd Qu.: 2.6352 3rd Qu.:0.4203938 #> Max. : 3.6995 Max. :0.7975956