code: def split_marker(marker, fg_id=1, bg_id=2):
      """
      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.
      """
      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
  
file_path: medpy/medpy/graphcut/wrapper.py
imports: import multiprocessing
  import itertools
  import math
  import scipy
  from .energy_label import boundary_stawiaski
  from .generate import graph_from_labels
  from ..core.exceptions import ArgumentError
  from ..core.logger import Logger
  from ..filter import relabel, relabel_map
label_desc: Use image node_id 1 for calling a global function with example usage: split_marker(marker, fg_id, bg_id) and returns: img_fgmarker,  img_bgmarker