Skip to content

Commit

Permalink
Update for scikit-image>=0.20 (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-gould authored Sep 2, 2024
1 parent 69d0514 commit 7f0c077
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions ashlar/thumbnail.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ def calculate_image_offset(img1, img2, upsample_factor=1):
ref,
test,
upsample_factor=upsample_factor,
normalization=None,
return_error=False,
)
normalization=None
)[0]
return shift


Expand Down
10 changes: 6 additions & 4 deletions ashlar/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import itertools
import warnings
import skimage
import skimage.restoration.uft
import scipy.ndimage
import numpy as np

Expand Down Expand Up @@ -35,14 +36,15 @@ def window(img):
def register(img1, img2, sigma, upsample=10):
img1w = window(whiten(img1, sigma))
img2w = window(whiten(img2, sigma))

shift = skimage.registration.phase_cross_correlation(
img1w,
img2w,
upsample_factor=upsample,
normalization=None,
return_error=False,
)
# At this point we may have a shift in the wrong quadrant since the FFT
normalization=None
)[0]

# At this point we may have a shift in the wrong quadrant since the FFT
# assumes the signal is periodic. We test all four possibilities and return
# the shift that gives the highest direct correlation (sum of products).
shape = np.array(img1.shape)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'matplotlib>=3.1.2',
'networkx>=2.4',
'scipy>=1.4.1',
'scikit-image>=0.19.2,<0.20', # The v1.0 API promises breaking changes.
'scikit-image>=0.19.2',
'scikit-learn>=0.21.1',
'tifffile>=2023.3.15',
'zarr>=2.11.3',
Expand Down

0 comments on commit 7f0c077

Please sign in to comment.