mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-12 12:50:49 +08:00
Update viewer for PyQt5 compatibility
Conflicts: skimage/viewer/tests/test_plugins.py skimage/viewer/tests/test_tools.py
This commit is contained in:
@@ -1,28 +1,17 @@
|
||||
import warnings
|
||||
|
||||
import numpy as np
|
||||
from skimage.viewer.qt import QtGui
|
||||
import matplotlib as mpl
|
||||
from matplotlib.figure import Figure
|
||||
from matplotlib import _pylab_helpers
|
||||
from matplotlib.colors import LinearSegmentedColormap
|
||||
|
||||
from ..qt import qt_api
|
||||
|
||||
try:
|
||||
import matplotlib as mpl
|
||||
from matplotlib.figure import Figure
|
||||
from matplotlib import _pylab_helpers
|
||||
from matplotlib.colors import LinearSegmentedColormap
|
||||
if not qt_api is None:
|
||||
from matplotlib.backends.backend_qt4 import FigureManagerQT
|
||||
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
|
||||
if 'agg' not in mpl.get_backend().lower():
|
||||
print("Recommended matplotlib backend is `Agg` for full "
|
||||
"skimage.viewer functionality.")
|
||||
else:
|
||||
FigureCanvasQTAgg = object
|
||||
LinearSegmentedColormap = object
|
||||
except ImportError:
|
||||
FigureCanvasQTAgg = object # hack to prevent nosetest and autodoc errors
|
||||
LinearSegmentedColormap = object
|
||||
|
||||
from ..qt import QtGui
|
||||
from matplotlib.backends.backend_qt4 import FigureManagerQT
|
||||
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg
|
||||
if 'agg' not in mpl.get_backend().lower():
|
||||
warnings.warn("Recommended matplotlib backend is `Agg` for full "
|
||||
"skimage.viewer functionality.")
|
||||
|
||||
|
||||
__all__ = ['init_qtapp', 'start_qtapp', 'RequiredAttr', 'figimage',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
from ..qt import QtGui
|
||||
from skimage.viewer.qt import QtGui
|
||||
|
||||
|
||||
__all__ = ['open_file_dialog', 'save_file_dialog']
|
||||
|
||||
Reference in New Issue
Block a user