Change import to silence import errors in docs.

`import skimage` in submodules seems to cause issues with Sphinx autodocs. (Maybe some sort of circular import issue.) Note the `ImportErrors` fixed by this commit don't actually cause sphinx build errors; Sphinx seems to capture the errors, but it's annoyingly noisy, nonetheless.
This commit is contained in:
Tony S Yu
2012-09-02 12:23:52 -04:00
parent bd0d47a183
commit 8b15656feb
2 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import numpy as np
import skimage
from skimage import img_as_float
from skimage.util.dtype import dtype_range
@@ -101,7 +101,7 @@ def equalize(image, nbins=256):
.. [2] http://en.wikipedia.org/wiki/Histogram_equalization
"""
image = skimage.img_as_float(image)
image = img_as_float(image)
cdf, bin_centers = cumulative_distribution(image, nbins)
out = np.interp(image.flat, bin_centers, cdf)
return out.reshape(image.shape)
+7 -7
View File
@@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en'
import warnings
import numpy as np
import skimage
from skimage import img_as_ubyte
from . import cmorph
@@ -63,8 +63,8 @@ def erosion(image, selem, out=None, shift_x=False, shift_y=False):
if image is out:
raise NotImplementedError("In-place erosion not supported!")
image = skimage.img_as_ubyte(image)
selem = skimage.img_as_ubyte(selem)
image = img_as_ubyte(image)
selem = img_as_ubyte(selem)
return cmorph.erode(image, selem, out=out,
shift_x=shift_x, shift_y=shift_y)
@@ -115,8 +115,8 @@ def dilation(image, selem, out=None, shift_x=False, shift_y=False):
if image is out:
raise NotImplementedError("In-place dilation not supported!")
image = skimage.img_as_ubyte(image)
selem = skimage.img_as_ubyte(selem)
image = img_as_ubyte(image)
selem = img_as_ubyte(selem)
return cmorph.dilate(image, selem, out=out,
shift_x=shift_x, shift_y=shift_y)
@@ -262,7 +262,7 @@ def white_tophat(image, selem, out=None):
"""
if image is out:
raise NotImplementedError("Cannot perform white top hat in place.")
image = skimage.img_as_ubyte(image)
image = img_as_ubyte(image)
out = opening(image, selem, out=out)
out = image - out
@@ -312,7 +312,7 @@ def black_tophat(image, selem, out=None):
if image is out:
raise NotImplementedError("Cannot perform white top hat in place.")
image = skimage.img_as_ubyte(image)
image = img_as_ubyte(image)
out = closing(image, selem, out=out)
out = out - image