Applies \(I_{log} = \log_2(I / \text{cofactor} + 1)\) to stabilise variance in low-intensity fluorescence signals. The default cofactor of 150 is appropriate for 16-bit images from the Akoya PhenoCycler-Fusion; adjust for other platforms.
Examples
x <- c(0, 100, 500, 2000, 10000, 65535)
log_transform(x)
#> [1] 0.0000000 0.7369656 2.1154772 3.8413023 6.0803734 8.7744576