code: def split_marker(marker, fg_id = 1, bg_id = 2):
      
      img_marker = scipy.asarray(marker)
      
      img_fgmarker = scipy.zeros(img_marker.shape, scipy.bool_)
      img_fgmarker[img_marker == fg_id] = True
      
      img_bgmarker = scipy.zeros(img_marker.shape, scipy.bool_)
      img_bgmarker[img_marker == bg_id] = True
      
      return img_fgmarker, img_bgmarker
docs: Splits an integer marker image into two binary image containing the foreground and
      background markers respectively.
      All encountered 1's are hereby treated as foreground, all 2's as background, all 0's
      as neutral marker and all others are ignored.
      This behaviour can be changed by supplying the fg_id and/or bg_id parameters.
      
      Parameters
      ----------
      marker : ndarray
          The marker image.
      fg_id : integer
          The value that should be treated as foreground.
      bg_id : integer
          The value that should be treated as background.
      
      Returns
      -------
      fgmarkers, bgmarkers : nadarray
          The fore- and background markers as boolean images.