Given a set of diffusion signal profiles {S(xj, qg d) : (xj , qO e V_{i;k}, d = 1,... , D}, we want to determine the modal profile S’(x_{i}, q_{k}). This is achieved using a mean shift algorithm [4] that is modified to take advantage of the patch matching mechanism described above. Mean shift is a non-parametric algorithm for locating the maxima of a density function and is hence a mode-seeking algorithm. It is an iterative algorithm where the mean is progressively updated by using the mean computed in the previous iteration as the reference for computing sample similarity.

We first note that the weights computed using (5) is dependent on the signal vector S(P) of a patch P. To explicitly express this dependency, we write w_{i},_{k}j,i(d) := w (s(P_{i;k}), S(Vj,i(d))^j. Note that we have made here the mean signal

vector S(P_{i;k}) the reference for weight computation. Our implementation of the mean shift algorithm involves the following steps. For iteration t = 1,2,..., T,

1. Update weights wflj i(d) = w (S^{(t}~^{r)}(P_{i;k}), S(Pj,_{l}(d))^ based on (5).

2. Update the mean at each location (x_{i}, q,-) using (6) with weights {wff_{l}(d)} and {S(xj, qi; d)} for (xj, qi) e Vi,k.