Remove deprecated depth parameter in random_walker

This has been supplanted by the `spacing` parameter.
This commit is contained in:
Juan Nunez-Iglesias
2014-04-09 23:41:37 +10:00
parent 0af070b92f
commit 264ca6ebd9
2 changed files with 6 additions and 19 deletions
-1
View File
@@ -14,7 +14,6 @@ Version 0.10
------------
* Remove backwards-compatability of `skimage.measure.regionprops`
* Remove deprecated `out` parameter of `skimage.morphology.binary_*`
* Remove deprecated parameter `depth` in `skimage.segmentation.random_walker`
* Remove deprecated logger function in `skimage/__init__.py`
* Remove deprecated function `filter.median_filter`
* Enable doctests of experimental `skimage.feature.brief`
@@ -190,8 +190,7 @@ def _build_laplacian(data, spacing, mask=None, beta=50,
def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
multichannel=False, return_full_prob=False, depth=1.,
spacing=None):
multichannel=False, return_full_prob=False, spacing=None):
"""Random walker algorithm for segmentation from markers.
Random walker algorithm is implemented for gray-level or multichannel
@@ -203,8 +202,8 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
Image to be segmented in phases. Gray-level `data` can be two- or
three-dimensional; multichannel data can be three- or four-
dimensional (multichannel=True) with the highest dimension denoting
channels. Data spacing is assumed isotropic unless depth keyword
argument is used.
channels. Data spacing is assumed isotropic unless the `spacing`
keyword argument is used.
labels : array of ints, of same shape as `data` without channels dimension
Array of seed markers labeled with different positive integers
for different phases. Zero-labeled pixels are unlabeled pixels.
@@ -249,13 +248,6 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
return_full_prob : bool, default False
If True, the probability that a pixel belongs to each of the labels
will be returned, instead of only the most likely label.
depth : float, default 1. [DEPRECATED]
Correction for non-isotropic voxel depths in 3D volumes.
Default (1.) implies isotropy. This factor is derived as follows:
depth = (out-of-plane voxel spacing) / (in-plane voxel spacing), where
in-plane voxel spacing represents the first two spatial dimensions and
out-of-plane voxel spacing represents the third spatial dimension.
`depth` is deprecated as of 0.9, in favor of `spacing`.
spacing : iterable of floats
Spacing between voxels in each spatial dimension. If `None`, then
the spacing between pixels/voxels in each dimension is assumed 1.
@@ -357,19 +349,15 @@ def random_walker(data, labels, beta=130, mode='bf', tol=1.e-3, copy=True,
'random walker functions. You may also install pyamg '
'and run the random walker function in cg_mg mode '
'(see the docstrings)')
if depth != 1.:
warnings.warn('`depth` kwarg is deprecated, and will be removed in the'
' next major release. Use `spacing` instead.')
# Spacing kwarg checks
if spacing is None:
spacing = (1., 1.) + (depth, )
elif len(spacing) == 2:
spacing = tuple(spacing) + (depth, )
spacing = (1., 1., 1.)
elif len(spacing) == 3:
pass
else:
raise ValueError('Input argument `spacing` incorrect, see docstring.')
raise ValueError('Input argument `spacing` incorrect, should be an '
'iterable of length 3.')
# Parse input data
if not multichannel: