Skip to content

ita: import correct gaussian_filter - #69

Open
ns-rse wants to merge 1 commit into
masterfrom
ns-rse/ita-gaussian_filter
Open

ns-rse wants to merge 1 commit into
masterfrom
ns-rse/ita-gaussian_filter

Conversation

@ns-rse

@ns-rse ns-rse commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

I noticed the ITA.py module has the deprecated method ITA.ITA_collection.stitch_correction() which imported

from scipy.ndimage.filters import gaussian_filter

This is deprecated...

DeprecationWarning: Please import `gaussian_filter` from the `scipy.ndimage` namespace; the `scipy.ndimage.filters` namespace is deprecated and will be removed in SciPy 2.0.0.

This has already been corrected in other places of the pySPM code base but not in the ITA import...

(.venv) ❱ rg gaussian_filter .
./pySPM/align.py
12:from scipy.ndimage import gaussian_filter
185:        im1 = gaussian_filter(Ref, gauss)
186:        im2 = gaussian_filter(Img, gauss)
259:        im1 = gaussian_filter(Ref, gauss)
260:        im2 = gaussian_filter(Img, gauss)

./pySPM/SPM.py
1591:            self.pixels = scipy.ndimage.gaussian_filter(
1596:            C.pixels = scipy.ndimage.gaussian_filter(C.pixels, sigma=sigma, **kwargs)

./pySPM/ITA.py
1140:        from scipy.ndimage.filters import gaussian_filter
1153:            S = gaussian_filter(S, gauss)

The method itself is marked as being deprecated but figured there was no harm in updating it in case people still use it.

I noticed the `ITA.py` module has the deprecated method `ITA.ITA_collection.stitch_correction()` which imported

```shell
from scipy.ndimage.filters import gaussian_filter
```

This is deprecated...

```shell
DeprecationWarning: Please import `gaussian_filter` from the `scipy.ndimage` namespace; the `scipy.ndimage.filters` namespace is deprecated and will be removed in SciPy 2.0.0.
```

This has already been corrected in other places of the `pySPM` code base but not in the ITA import...

```
(.venv) ❱ rg gaussian_filter .
./pySPM/align.py
12:from scipy.ndimage import gaussian_filter
185:        im1 = gaussian_filter(Ref, gauss)
186:        im2 = gaussian_filter(Img, gauss)
259:        im1 = gaussian_filter(Ref, gauss)
260:        im2 = gaussian_filter(Img, gauss)

./pySPM/SPM.py
1591:            self.pixels = scipy.ndimage.gaussian_filter(
1596:            C.pixels = scipy.ndimage.gaussian_filter(C.pixels, sigma=sigma, **kwargs)

./pySPM/ITA.py
1140:        from scipy.ndimage.filters import gaussian_filter
1153:            S = gaussian_filter(S, gauss)
```

The method itself is marked as being deprecated but figured there was no harm in updating it in case people still use it.
@ns-rse
ns-rse requested a review from scholi October 26, 2026 10:16

This branch had an error being deployed

1 failed deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant