code: def _extract_feature(fun, image, mask=slice(None), **kwargs):
      """
      Convenient function to cope with multi-spectral images and feature normalization.
  
      Parameters
      ----------
      fun : function
          The feature extraction function to call
      image : array_like or list/tuple of array_like
          A single image or a list/tuple of images (for multi-spectral case).
      mask : ndarray
          The binary mask to select the voxels for which to extract the feature
      kwargs : sequence
          Additional keyword arguments to be passed to the feature extraction function
      """
      if not type(mask) is slice:
          mask = numpy.array(mask, copy=False, dtype=numpy.bool_)
  
      if type(image) == tuple or type(image) == list:
          return join(*[fun(i, mask, **kwargs) for i in image])
      else:
          return fun(image, mask, **kwargs)
  
imports: import numpy
  from scipy.ndimage import gaussian_filter, median_filter
  from scipy.ndimage import gaussian_gradient_magnitude
  from scipy.interpolate.interpolate import interp1d
  from scipy.ndimage import distance_transform_edt
  from scipy.ndimage._ni_support import _get_output
  from .utilities import join
  from ..core import ArgumentError
  from ..filter import sum_filter
label_desc: Use image node_id 23 for calling a global function with example usage: _extract_feature(fun, image, mask) and returns: join, fun