mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-28 11:25:42 +08:00
Address travis failures
This commit is contained in:
@@ -69,7 +69,7 @@ class LineTool(CanvasToolBase):
|
||||
|
||||
@property
|
||||
def end_points(self):
|
||||
return self._end_pts
|
||||
return self._end_pts.astype(int)
|
||||
|
||||
@end_points.setter
|
||||
def end_points(self, pts):
|
||||
|
||||
@@ -32,8 +32,8 @@ def test_line_profile():
|
||||
scan_data.size]:
|
||||
assert_equal(inp, 172)
|
||||
assert_equal(line_image.shape, (512, 512))
|
||||
assert_allclose(scan_data.max(), 0.9139, rtol=1e-3)
|
||||
assert_allclose(scan_data.mean(), 0.2828, rtol=1e-3)
|
||||
assert_allclose(scan_data.max(), 0.9176, rtol=1e-3)
|
||||
assert_allclose(scan_data.mean(), 0.2812, rtol=1e-3)
|
||||
|
||||
|
||||
@skipif(qt_api is None)
|
||||
@@ -43,12 +43,12 @@ def test_line_profile_rgb():
|
||||
for i in range(6):
|
||||
plugin.line_tool._thicken_scan_line()
|
||||
line_image, scan_data = plugin.output()
|
||||
assert_equal(line_image[line_image == 128].size, 755)
|
||||
assert_equal(line_image[line_image == 128].size, 750)
|
||||
assert_equal(line_image[line_image == 255].size, 151)
|
||||
assert_equal(line_image.shape, (300, 451))
|
||||
assert_equal(scan_data.shape, (152, 3))
|
||||
assert_equal(scan_data.shape, (151, 3))
|
||||
assert_allclose(scan_data.max(), 0.772, rtol=1e-3)
|
||||
assert_allclose(scan_data.mean(), 0.4355, rtol=1e-3)
|
||||
assert_allclose(scan_data.mean(), 0.4359, rtol=1e-3)
|
||||
|
||||
|
||||
@skipif(qt_api is None)
|
||||
@@ -64,7 +64,7 @@ def test_line_profile_dynamic():
|
||||
line = lp.get_profiles()[-1][0]
|
||||
assert line.size == 129
|
||||
assert_almost_equal(np.std(viewer.image), 0.208, 3)
|
||||
assert_almost_equal(np.std(line), 0.226, 3)
|
||||
assert_almost_equal(np.std(line), 0.229, 3)
|
||||
assert_almost_equal(np.max(line) - np.min(line), 0.725, 1)
|
||||
|
||||
viewer.image = skimage.img_as_float(median(image,
|
||||
@@ -85,7 +85,7 @@ def test_measure():
|
||||
|
||||
m.line_changed([(0, 0), (10, 10)])
|
||||
assert_equal(str(m._length.text), '14.1')
|
||||
assert_equal(str(m._angle.text[:5]), u'135.0')
|
||||
assert_equal(str(m._angle.text[:5]), '135.0')
|
||||
|
||||
|
||||
@skipif(qt_api is None)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from skimage import data
|
||||
from skimage.viewer import ImageViewer, CollectionViewer
|
||||
from skimage.transform import pyramid_gaussian
|
||||
from skimage.viewer.plugins import OverlayPlugin
|
||||
from skimage.viewer.plugins import OverlayPlugin, recent_mpl_version
|
||||
from skimage.filter import sobel
|
||||
from skimage.viewer.qt import qt_api, QtGui, QtCore
|
||||
from numpy.testing import assert_equal
|
||||
@@ -52,7 +52,7 @@ def test_collection_viewer():
|
||||
view._format_coord(10, 10)
|
||||
|
||||
|
||||
@skipif(qt_api is None)
|
||||
@skipif(qt_api is None or not recent_mpl_version())
|
||||
def test_viewer_with_overlay():
|
||||
img = data.coins()
|
||||
ov = OverlayPlugin(image_filter=sobel)
|
||||
@@ -74,4 +74,4 @@ def test_viewer_with_overlay():
|
||||
assert_equal(ov.filtered_image, img)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ from skimage import data, img_as_float, io
|
||||
from skimage.viewer import ImageViewer
|
||||
from skimage.viewer.widgets import (
|
||||
Slider, OKCancelButtons, SaveButtons, ComboBox, Text)
|
||||
from skimage.viewer.utils import init_qtapp
|
||||
from skimage.viewer.plugins.base import Plugin
|
||||
|
||||
from skimage.viewer.qt import qt_api, QtGui, QtCore
|
||||
|
||||
Reference in New Issue
Block a user