LinearConv2 {cellmigRation} | R Documentation |
Performs a linear convolution of a Numeric Matrix, using a user-supplied linear kernel. The convolution can be executed in a column-wise fashion by setting the col.wise argument to TRUE. Alternatively, the convolution is performed in a row-wise fashion.
LinearConv2(x, krnl, col.wise = TRUE)
x |
numeric matrix that will be used as input for the convolution; this matrix typically corresponds to an image where signal (high values) indicates the presence of a cell or a cell-like particle |
krnl |
numeric vector corresponding to the kernel that will be used for the convolution. Briefly, the kernel includes the weights that will be used to compute a weighted sum at each position of the input numeric matrix |
col.wise |
logical; shall the linear convolution be performed in a column-wise or row-wise fashion? |
Linearly convoluted numeric matrix. The resulting matrix has the same dimensions of the inut matrix
Damiano Fantini, damiano.fantini@gmail.com
https://www.data-pulse.com/dev_site/cellmigration/
graphics::par(mfrow = c(1, 2)) tmp <- vapply( seq_len(12), function(i) {(6 + abs(i - 6)) * c(seq(1,10,by=1), seq(10,1,by=-1))}, FUN.VALUE = numeric(20) ) cnv.tmp <- cellmigRation:::LinearConv2(tmp, c(-3, 0, 3)) graphics::image(tmp); graphics::image(cnv.tmp)