For an ijtiff_img-style array img (indexed as img[y, x, channel, frame]), 3-dimensional array mat3d, pillar xy of channel ch is defined as img[y, x, ch, ]. This function computes the brightness, of each pillar.

brightness_pillars(img, parallel = FALSE)

Arguments

img

A 4-dimensional array in the style of an ijtiff_img (indexed by img[y, x, channel, frame]) or a 3-dimensional array which is a single channel of an ijtiff_img (indexed by img[y, x, frame]).

parallel

Would you like to use multiple cores to speed up this function? If so, set the number of cores here, or to use all available cores, use parallel = TRUE.

Value

An ijtiff_img-style array arr with one frame. arr[y, x, ch, 1] is equal to var(img[y, x, ch, ]) / mean(img[y, x, ch, ]).

Examples

aaa <- array(1:16, dim = c(2, 2, 4))
brightness_pillars(aaa)
#> , , 1, 1
#> 
#>          [,1]     [,2]
#> [1,] 3.809524 2.962963
#> [2,] 3.333333 2.666667
#>