def default_selem(func):
 @functools.wraps(func)
 def func_out(image, selem=None, *args, **kwargs):
  if (selem is None):
   selem = _default_selem(image.ndim)
  return func(image, selem=selem, *args, **kwargs)
 return func_out

def default_selem ( func ) : @ functools . wraps ( func ) def func_out ( image , selem = None , * args , ** kwargs ) : if ( selem is None ) : selem = _default_selem ( image . ndim ) return func ( image , selem = selem , * args , ** kwargs ) return func_out
decorator to add a default structuring element to morphology functions .