The current implementation of Anisotropic Diffusion gives two FutureWarnings (from numpy):
FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
matrices[i][slicer] = numpy.diff(matrices[i], axis=i)
This occurs at both usages of slicer. The solution seems to be to change slicer to a tuple.
I changed both slicers like this:
from
slicer = [slice(1, None) if j == i else slice(None) for j in range(out.ndim)]
to
slicer = tuple([slice(1, None) if j == i else slice(None) for j in range(out.ndim)])
The current implementation of Anisotropic Diffusion gives two FutureWarnings (from numpy):
This occurs at both usages of
slicer
. The solution seems to be to changeslicer
to a tuple. I changed both slicers like this: fromslicer = [slice(1, None) if j == i else slice(None) for j in range(out.ndim)]
toslicer = tuple([slice(1, None) if j == i else slice(None) for j in range(out.ndim)])
Hope it helps!