You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The gradient function in the reconstruction/tv_denoising.py file fails due to slicing problem.
Cell In[60], line 23, in gradient(img)
21 slice_all = [0, slice(None, -1),]
22 for d in range(img.ndim):
---> 23 gradient[slice_all] = np.diff(img, axis=d)
24 slice_all[0] = d + 1
25 slice_all.insert(1, slice(None))
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
Converting the list to a tuple gradient[tuple(slice_all)] = np.diff(x, axis=d) seems to work fine.
The text was updated successfully, but these errors were encountered:
The
gradient
function in thereconstruction/tv_denoising.py
file fails due to slicing problem.Converting the list to a tuple
gradient[tuple(slice_all)] = np.diff(x, axis=d)
seems to work fine.The text was updated successfully, but these errors were encountered: