Skielex / structure-tensor

Structure tensor 2D and 3D implementation for Python.
MIT License
47 stars 14 forks source link

package cupyx.scipy.ndimage.filters deprecated #14

Closed choROPeNt closed 9 months ago

choROPeNt commented 9 months ago

Hello I just ran in the following error when I wanted to test my installation with tests/test_strucutre_tensor.py:

DeprecationWarning: Please use `gaussian_filter` from the `scipy.ndimage` namespace, the `scipy.ndimage.filters` namespace is deprecated.
WARNING:root:Could not load CuPy: cannot import name 'filters' from 'cupyx.scipy.ndimage'

found a description of the problem in the IMAGE.sc forum

Build

Solution

change in ./structure-tensor/cp/st3dcp.py line 6 and .structure-tensor/st3d.py line 5

from cupyx.scipy.ndimage import filters

to

import cupyx.scipy.ndimage as filters

as a workaround.

Hope this could help anyone who encounters the same problem

Skielex commented 9 months ago

Thanks for raising the issue. I'll fix the import and make a new release.

choROPeNt commented 9 months ago

small mistake in my solution. In 'st3d.py' you have to replace

from scipy.ndimage import filters

to

import scipy.ndimage as filters

Test works smoothly now:

..........
----------------------------------------------------------------------
Ran 10 tests in 2.268s

OK