diff --git a/skimage/viewer/tests/test_widgets.py b/skimage/viewer/tests/test_widgets.py index d83f54ac6d6..a9f84fbd6cc 100644 --- a/skimage/viewer/tests/test_widgets.py +++ b/skimage/viewer/tests/test_widgets.py @@ -16,6 +16,7 @@ def get_image_viewer(): viewer += Plugin() return viewer + @skipif(not viewer_available) def test_check_box(): viewer = get_image_viewer() @@ -43,6 +44,7 @@ def test_combo_box(): assert_equal(str(cb.val), 'c'), assert_equal(cb.index, 2) + @skipif(not viewer_available) def test_text_widget(): viewer = get_image_viewer() diff --git a/skimage/viewer/widgets/core.py b/skimage/viewer/widgets/core.py index 9a99d7e8376..0eebbe8cf0e 100644 --- a/skimage/viewer/widgets/core.py +++ b/skimage/viewer/widgets/core.py @@ -304,6 +304,7 @@ def val(self): @val.setter def val(self, i): - self._check_box.setChecked(i) # setChecked has only two states: - # 0 = unchecked, 2 = checked + # setChecked has only two states: 0 = unchecked, 2 = checked + self._check_box.setChecked(i) + \ No newline at end of file diff --git a/viewer_examples/plugins/tv_denoise.py b/viewer_examples/plugins/tv_denoise.py index e4d06fb2a04..5ad527eca53 100644 --- a/viewer_examples/plugins/tv_denoise.py +++ b/viewer_examples/plugins/tv_denoise.py @@ -4,8 +4,8 @@ from numpy import random, clip from skimage.viewer import ImageViewer -from skimage.viewer.widgets import (Slider, CheckBox, OKCancelButtons, - SaveButtons) +from skimage.viewer.widgets import (Slider, CheckBox, OKCancelButtons, + SaveButtons) from skimage.viewer.plugins.base import Plugin