mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-20 12:40:31 +08:00
Merge pull request #1936 from ahojnnes/depr
Fix some remaining TODO items
This commit is contained in:
@@ -41,14 +41,5 @@ Version 0.12
|
||||
------------
|
||||
* Change `label` to mark background as 0, not -1, which is consistent with
|
||||
SciPy's labelling.
|
||||
* Remove deprecated `reverse_map` parameter of `skimage.transform.warp`
|
||||
* Change deprecated `enforce_connectivity=False` on skimage.segmentation.slic
|
||||
and set it to True as default
|
||||
* Remove deprecated `skimage.measure.fit.BaseModel._params` attribute
|
||||
* Remove deprecated `skimage.measure.fit.BaseModel._params`,
|
||||
`skimage.transform.ProjectiveTransform._matrix`,
|
||||
`skimage.transform.PolynomialTransform._params`,
|
||||
`skimage.transform.PiecewiseAffineTransform.affines_*` attributes
|
||||
* Remove deprecated functions `skimage.filters.denoise_*`
|
||||
* Add 3D phantom in `skimage.data`
|
||||
* Add 3D test case of `skimage.feature.phase_correlate`
|
||||
|
||||
@@ -4,6 +4,14 @@ Version 0.12
|
||||
the ``ntiles_*`` arguments.
|
||||
- The functions ``blob_dog``, ``blob_log`` and ``blob_doh`` now return float
|
||||
arrays instead of integer arrays.
|
||||
- `reverse_map` parameter in `skimage.transform.warp` has been removed.
|
||||
- `enforce_connectivity` in `skimage.segmentation.slic` defaults to ``True``.
|
||||
- `skimage.measure.fit.BaseModel._params`,
|
||||
`skimage.transform.ProjectiveTransform._matrix`,
|
||||
`skimage.transform.PolynomialTransform._params`,
|
||||
`skimage.transform.PiecewiseAffineTransform.affines_*` attributes
|
||||
have been removed.
|
||||
- `skimage.filters.denoise_*` have moved to `skimage.restoration.denoise_*`.
|
||||
|
||||
Version 0.11
|
||||
------------
|
||||
|
||||
@@ -15,12 +15,7 @@ from .rank import median
|
||||
|
||||
from .._shared.utils import deprecated, copy_func
|
||||
from .. import restoration
|
||||
denoise_bilateral = deprecated('skimage.restoration.denoise_bilateral')\
|
||||
(restoration.denoise_bilateral)
|
||||
denoise_tv_bregman = deprecated('skimage.restoration.denoise_tv_bregman')\
|
||||
(restoration.denoise_tv_bregman)
|
||||
denoise_tv_chambolle = deprecated('skimage.restoration.denoise_tv_chambolle')\
|
||||
(restoration.denoise_tv_chambolle)
|
||||
|
||||
gaussian_filter = copy_func(gaussian, name='gaussian_filter')
|
||||
gaussian_filter = deprecated('skimage.filters.gaussian')(gaussian_filter)
|
||||
gabor_filter = copy_func(gabor, name='gabor_filter')
|
||||
|
||||
@@ -24,11 +24,6 @@ class BaseModel(object):
|
||||
def __init__(self):
|
||||
self.params = None
|
||||
|
||||
@property
|
||||
def _params(self):
|
||||
warn('`_params` attribute is deprecated, use `params` instead.')
|
||||
return self.params
|
||||
|
||||
|
||||
class LineModel(BaseModel):
|
||||
|
||||
|
||||
@@ -301,14 +301,5 @@ def test_ransac_invalid_input():
|
||||
residual_threshold=0, stop_probability=1.01)
|
||||
|
||||
|
||||
def test_deprecated_params_attribute():
|
||||
model = LineModelND()
|
||||
model.params = ((0, 0), (1, 1))
|
||||
x = np.arange(-10, 10)
|
||||
y = model.predict_y(x)
|
||||
with expected_warnings(['`_params`']):
|
||||
assert_equal(model.params, model._params)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
np.testing.run_module_suite()
|
||||
|
||||
@@ -13,7 +13,7 @@ from ..color import rgb2lab
|
||||
|
||||
def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0,
|
||||
spacing=None, multichannel=True, convert2lab=None,
|
||||
enforce_connectivity=False, min_size_factor=0.5, max_size_factor=3,
|
||||
enforce_connectivity=True, min_size_factor=0.5, max_size_factor=3,
|
||||
slic_zero=False):
|
||||
"""Segments image using k-means clustering in Color-(x,y,z) space.
|
||||
|
||||
@@ -53,7 +53,7 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0,
|
||||
segmentation. The input image *must* be RGB. Highly recommended.
|
||||
This option defaults to ``True`` when ``multichannel=True`` *and*
|
||||
``image.shape[-1] == 3``.
|
||||
enforce_connectivity: bool, optional (default False)
|
||||
enforce_connectivity: bool, optional
|
||||
Whether the generated segments are connected or not
|
||||
min_size_factor: float, optional
|
||||
Proportion of the minimum segment size to be removed with respect
|
||||
@@ -110,10 +110,6 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=0,
|
||||
>>> segments = slic(img, n_segments=100, compactness=20)
|
||||
|
||||
"""
|
||||
if enforce_connectivity is None:
|
||||
warn('Deprecation: enforce_connectivity will default to'
|
||||
' True in future versions.')
|
||||
enforce_connectivity = False
|
||||
|
||||
image = img_as_float(image)
|
||||
is_2d = False
|
||||
|
||||
@@ -181,11 +181,6 @@ class ProjectiveTransform(GeometricTransform):
|
||||
raise ValueError("invalid shape of transformation matrix")
|
||||
self.params = matrix
|
||||
|
||||
@property
|
||||
def _matrix(self):
|
||||
warn('`_matrix` attribute is deprecated, use `params` instead.')
|
||||
return self.params
|
||||
|
||||
@property
|
||||
def _inv_matrix(self):
|
||||
return np.linalg.inv(self.params)
|
||||
@@ -778,11 +773,6 @@ class PolynomialTransform(GeometricTransform):
|
||||
raise ValueError("invalid shape of transformation parameters")
|
||||
self.params = params
|
||||
|
||||
@property
|
||||
def _params(self):
|
||||
warn('`_params` attribute is deprecated, use `params` instead.')
|
||||
return self.params
|
||||
|
||||
def estimate(self, src, dst, order=2):
|
||||
"""Set the transformation matrix with the explicit transformation
|
||||
parameters.
|
||||
|
||||
@@ -249,17 +249,6 @@ def test_invalid_input():
|
||||
assert_raises(ValueError, PolynomialTransform, np.zeros((3, 3)))
|
||||
|
||||
|
||||
def test_deprecated_params_attributes():
|
||||
for t in ('projective', 'affine', 'similarity'):
|
||||
tform = estimate_transform(t, SRC, DST)
|
||||
with expected_warnings(['`_matrix`.*deprecated']):
|
||||
assert_equal(tform._matrix, tform.params)
|
||||
|
||||
tform = estimate_transform('polynomial', SRC, DST, order=3)
|
||||
with expected_warnings(['`_params`.*deprecated']):
|
||||
assert_equal(tform._params, tform.params)
|
||||
|
||||
|
||||
def test_degenerate():
|
||||
src = dst = np.zeros((10, 2))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user