Gradient fields are smoothed using bilateral filtering, in which the smoothed gradient of each point is computed as the weighted average of the neighbors' gradients, considering both distance in space and also similarity in gradients.
Arguments
- pvec, adj_i, adj_p
A
NxNsparse adjacency matrix in dgCMatrix format:pvec = diff(adj@p),adj_i = adj@i, andadj_p = adj@p- field
A
2xDxNarray in column-major ordering containing the spatial gradient in expression for each ofDlatent variables at every point in space.- coords
A
Nx2matrix of cell coordinates.- distance
Method for computing distance score in weighted average. See description for details. Defaults to
'euclidean'.- similarity
Method for computing similarity score in weighted average. See description for details. Defaults to
'euclidean'.