Skip to content

Commit

Permalink
Merge pull request #517 from s-sajid-ali/skimage_api_update
Browse files Browse the repository at this point in the history
skimage.feature.register_translation is deprecated in favor of skimage.registration.phase_cross_correlation.
  • Loading branch information
carterbox committed Sep 8, 2020
2 parents aeee299 + f79bda1 commit 990d583
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion envs/linux-36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- python-coveralls
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
2 changes: 1 addition & 1 deletion envs/linux-37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- python=3.7
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
2 changes: 1 addition & 1 deletion envs/linux-38.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
- python=3.8
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
2 changes: 1 addition & 1 deletion envs/linux-nomkl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- pyctest>0.0.10
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
2 changes: 1 addition & 1 deletion envs/osx-36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
- python-coveralls
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
2 changes: 1 addition & 1 deletion envs/osx-37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
- python=3.7
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
2 changes: 1 addition & 1 deletion envs/win-36.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- python-coveralls
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
2 changes: 1 addition & 1 deletion envs/win-37.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- python=3.7
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
2 changes: 1 addition & 1 deletion envs/win-nomkl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- libopencv
- pywavelets
- scikit-build
- scikit-image
- scikit-image>=0.17
- scipy
- setuptools_scm
- setuptools_scm_git_archive
Expand Down
10 changes: 5 additions & 5 deletions source/tomopy/prep/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import logging

from skimage import transform as tf
from skimage.feature import register_translation
from skimage.registration import phase_cross_correlation
from tomopy.recon.algorithm import recon
from tomopy.sim.project import project
from tomopy.misc.npmath import gauss1d, calc_affine_transform
Expand Down Expand Up @@ -189,8 +189,8 @@ def align_seq(
for m in range(prj.shape[0]):

# Register current projection in sub-pixel precision
shift, error, diffphase = register_translation(
_prj[m], _sim[m], upsample_factor)
shift, error, diffphase = phase_cross_correlation(
_prj[m], _sim[m], upsample_factor)
err[m] = np.sqrt(shift[0]*shift[0] + shift[1]*shift[1])
sx[m] += shift[0]
sy[m] += shift[1]
Expand Down Expand Up @@ -328,8 +328,8 @@ def align_joint(
for m in range(prj.shape[0]):

# Register current projection in sub-pixel precision
shift, error, diffphase = register_translation(
_prj[m], _sim[m], upsample_factor)
shift, error, diffphase = phase_cross_correlation(
_prj[m], _sim[m], upsample_factor)
err[m] = np.sqrt(shift[0]*shift[0] + shift[1]*shift[1])
sx[m] += shift[0]
sy[m] += shift[1]
Expand Down
6 changes: 3 additions & 3 deletions source/tomopy/recon/rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
from scipy import ndimage
from tomopy.util.misc import fft2, write_tiff
from scipy.optimize import minimize
from skimage.feature import register_translation
from skimage.registration import phase_cross_correlation
from tomopy.misc.corr import circ_mask
from tomopy.misc.morph import downsample
from tomopy.recon.algorithm import recon
Expand Down Expand Up @@ -376,7 +376,7 @@ def find_center_pc(proj1, proj2, tol=0.5, rotc_guess=None):
Find rotation axis location by finding the offset between the first
projection and a mirrored projection 180 degrees apart using
phase correlation in Fourier space.
The ``register_translation`` function uses cross-correlation in Fourier
The ``phase_cross_correlation`` function uses cross-correlation in Fourier
space, optionally employing an upsampled matrix-multiplication DFT to
achieve arbitrary subpixel precision. :cite:`Guizar:08`.
Expand Down Expand Up @@ -409,7 +409,7 @@ def find_center_pc(proj1, proj2, tol=0.5, rotc_guess=None):
proj2 = np.fliplr(proj2)

# Determine shift between images using scikit-image pcm
shift = register_translation(proj1, proj2, upsample_factor=1.0 / tol)
shift = phase_cross_correlation(proj1, proj2, upsample_factor=1.0 / tol)

# Compute center of rotation as the center of first image and the
# registered translation with the second image
Expand Down

0 comments on commit 990d583

Please sign in to comment.