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 (50 obs.);	Bandwidth 'bw' = 0.2327
#> 
#>        x                 y            
#>  Min.   :-0.6856   Min.   :0.0003965  
#>  1st Qu.: 0.2654   1st Qu.:0.0512431  
#>  Median : 1.2165   Median :0.2116699  
#>  Mean   : 1.2165   Mean   :0.2623203  
#>  3rd Qu.: 2.1676   3rd Qu.:0.4430592  
#>  Max.   : 3.1187   Max.   :0.6802205