bartorch.prox.nlmeans

Contents

bartorch.prox.nlmeans#

bartorch.prox.nlmeans(input, axes, *, patch_length=None, patch_distance=None, h=None, a=None)#

Non-local means filter along axes.

Each voxel becomes sum_j w_ij y_j / sum_j w_ij over the j within patch_distance of it along every axis in axes, with w_ij = exp(-sum_o g_o |y_(i+o) - y_(j+o)|^2 / (2 h^2 ||g||_2)): o runs over a patch of patch_length per axis and g is a Gaussian of standard deviation a over it. The image is reflected at its edges.

Parameters:
  • patch_length (int, optional) – Odd patch length per axis (-p); BART’s default is 5.

  • patch_distance (int, optional) – Search radius per axis (-d); BART’s default is 5. Zero returns input.

  • h (float, optional) – Filter strength in the units of input’s values (-H); BART’s default is 0.04. A large h makes the filter a box mean.

  • a (float, optional) – Standard deviation of g, in voxels (-a); BART’s default is (patch_length - 1) / 4.