BUG: Clean up imports

This commit is contained in:
Tony S Yu
2012-11-15 23:53:47 -05:00
parent 0d411e21dc
commit 9d653fec78
4 changed files with 21 additions and 6 deletions
+6 -2
View File
@@ -1,6 +1,10 @@
import numpy as np
import matplotlib as mpl
from matplotlib import lines
try:
import matplotlib as mpl
from matplotlib import lines
except ImportError:
print("Could not import matplotlib -- skimage.viewer not available.")
__all__ = ['CanvasToolBase', 'ToolHandles']
+5 -1
View File
@@ -1,5 +1,9 @@
import numpy as np
from matplotlib import lines
try:
from matplotlib import lines
except ImportError:
print("Could not import matplotlib -- skimage.viewer not available.")
from base import CanvasToolBase, ToolHandles
+10 -2
View File
@@ -1,7 +1,14 @@
import numpy as np
from PyQt4 import QtGui
import matplotlib.pyplot as plt
try:
from PyQt4 import QtGui
except ImportError:
print("Could not import PyQt4 -- skimage.viewer not available.")
try:
import matplotlib.pyplot as plt
except ImportError:
print("Could not import matplotlib -- skimage.viewer not available.")
from ..utils import MatplotlibCanvas
from .base import Plugin
@@ -18,6 +25,7 @@ class PlotCanvas(MatplotlibCanvas):
super(PlotCanvas, self).__init__(parent, self.fig, **kwargs)
self.setMinimumHeight(150)
class PlotPlugin(Plugin):
"""Plugin for ImageViewer that contains a plot canvas.
@@ -18,7 +18,6 @@ home/end keys
First/last image in collection.
"""
import numpy as np
from skimage import data
from skimage.viewer import CollectionViewer
from skimage.transform import pyramid_gaussian