def imslic(img, n_segments=<NUM_LIT:100>, aspect=None):
from skimage.segmentation import (slic, mark_boundaries)<EOL>from skimage.morphology import (dilation)<EOL>if img.ndim == <NUM_LIT:2> or img.ndim == <NUM_LIT:3> and img.shape[-<NUM_LIT:1>] == <NUM_LIT:1>:<EOL><INDENT>imz = np.stack([img, img, img], <NUM_LIT:2>)<EOL><DEDENT>else:<EOL><INDENT>imz = img<EOL><DEDENT>slics = slic(imz, n_segments=n_segments)<EOL>boundaries = mark_boundaries(imz, slics)<EOL>return plt.imshow(boundaries, aspect=aspect)<EOL>
slic args :
n_segments=100, compactness=10., max_iter=10,
sigma=0, spacing=None,
multichannel=True, convert2lab=None, enforce_connectivity=True,
min_size_factor=0.5, max_size_factor=3, slic_zero=False

mark_boundaries args:
label_img, color=(1, 1, 0), outline_color=None, mode='outer', background_label=0

imshow args:
cmap=None, norm=None, aspect=None, interpolation=None,
alpha=None, vmin=None, vmax=None, origin=None,
extent=None, shape=None, filternorm=1, filterrad=4.0,
imlim=None, resample=None, url=None, hold=None, data=None,

:param img:
:param slicarg:
:param slickw:
:return: