mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-12 12:50:49 +08:00
Changed coding style to be compliant with PEP8
This commit is contained in:
@@ -50,10 +50,10 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
|
||||
Synonym for `compactness`. This keyword is deprecated.
|
||||
enforce_connectivity: bool, optional
|
||||
Whether the generated segments are connected or not
|
||||
min_size_factor: float
|
||||
min_size_factor: float, optional
|
||||
proportion of the minimum segment size to be removed with respect
|
||||
to the supposed segment size (depth*width*height/n_segments)
|
||||
max_size_factor: float
|
||||
max_size_factor: float, optional
|
||||
proportion of the maximum connected segment size. A value of 3 works
|
||||
in most of the cases.
|
||||
Returns
|
||||
@@ -169,14 +169,14 @@ def slic(image, n_segments=100, compactness=10., max_iter=10, sigma=None,
|
||||
ratio = float(max((step_z, step_y, step_x))) / compactness
|
||||
image = np.ascontiguousarray(image * ratio)
|
||||
|
||||
labels = _slic_cython(image, segments, max_iter, spacing, enforce_connectivity)
|
||||
labels = _slic_cython(image, segments, max_iter, spacing)
|
||||
|
||||
if (enforce_connectivity):
|
||||
segment_size = depth*height*width/n_segments
|
||||
segment_size = depth * height * width / n_segments
|
||||
labels = _enforce_label_connectivity_cython(labels,
|
||||
n_segments,
|
||||
min_size_factor*segment_size,
|
||||
max_size_factor*segment_size)
|
||||
min_size_factor * segment_size,
|
||||
max_size_factor * segment_size)
|
||||
|
||||
if is_2d:
|
||||
labels = labels[0]
|
||||
|
||||
Reference in New Issue
Block a user