Skip to content

Commit

Permalink
FIX: Pass arguments from deprecated function, update examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
JDWarner committed Feb 1, 2016
1 parent b218cfd commit ab7f077
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion doc/examples/transform/plot_ssim.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import matplotlib.pyplot as plt

from skimage import data, img_as_float
from skimage.measure import structural_similarity as ssim
from skimage.measure import compare_ssim as ssim

img = img_as_float(data.camera())
rows, cols = img.shape
Expand Down
2 changes: 1 addition & 1 deletion skimage/io/tests/test_pil.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from PIL import Image
from .._plugins.pil_plugin import (
pil_to_ndarray, ndarray_to_pil, _palette_is_grayscale)
from ...measure import structural_similarity as ssim
from ...measure import compare_ssim as ssim
from ...color import rgb2lab


Expand Down
1 change: 0 additions & 1 deletion skimage/measure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
__all__ = ['find_contours',
'regionprops',
'perimeter',
'structural_similarity',
'approximate_polygon',
'subdivide_polygon',
'LineModel',
Expand Down
7 changes: 4 additions & 3 deletions skimage/measure/_structural_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ def structural_similarity(X, Y, win_size=None, gradient=False,
dynamic_range=None, multichannel=False,
gaussian_weights=False, full=False, **kwargs):
"""""" + compare_ssim.__doc__
return compare_ssim(X, Y, win_size=None, gradient=False,
dynamic_range=None, multichannel=False,
gaussian_weights=False, full=False, **kwargs)
return compare_ssim(X, Y, win_size=win_size, gradient=gradient,
dynamic_range=dynamic_range,
multichannel=multichannel,
gaussian_weights=gaussian_weights, full=full, **kwargs)
2 changes: 1 addition & 1 deletion skimage/measure/tests/test_structural_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_old_name_deprecated():
with expected_warnings('Call to deprecated function '
'``structural_similarity``. Use '
'``compare_ssim`` instead.'):
ssim_result = structural_similarity(cam, cam_noisy, win_size=32)
ssim_result = structural_similarity(cam, cam_noisy, win_size=31)


def test_ssim_patch_range():
Expand Down
4 changes: 2 additions & 2 deletions skimage/restoration/tests/test_denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ def test_denoise_tv_chambolle_weighting():
w = 0.2
denoised_2d = restoration.denoise_tv_chambolle(img2d, weight=w)
denoised_4d = restoration.denoise_tv_chambolle(img4d, weight=w)
assert measure.structural_similarity(denoised_2d,
denoised_4d[:, :, 0, 0]) > 0.99
assert measure.compare_ssim(denoised_2d,
denoised_4d[:, :, 0, 0]) > 0.99


def test_denoise_tv_bregman_2d():
Expand Down

0 comments on commit ab7f077

Please sign in to comment.