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

# S3 method for class '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 (47 obs.);	Bandwidth 'bw' = 0.2311
#> 
#>        x                 y            
#>  Min.   :-0.6807   Min.   :0.0004293  
#>  1st Qu.: 0.2679   1st Qu.:0.0553559  
#>  Median : 1.2165   Median :0.1982771  
#>  Mean   : 1.2165   Mean   :0.2632513  
#>  3rd Qu.: 2.1651   3rd Qu.:0.4592083  
#>  Max.   : 3.1138   Max.   :0.6834727