code: def getParser():
      "Creates and returns the argparse parser object."
      parser = argparse.ArgumentParser(
          description=__description__,
          formatter_class=RawTextHelpFormatter,
      )
  
      parser.add_argument(
          "sigma",
          type=float,
          help="The sigma required for the boundary terms.",
      )
      parser.add_argument(
          "badditional",
          help="The additional image required by the boundary term. See there for details.",
      )
      parser.add_argument(
          "markers",
          help="Image containing the foreground (=1) and background (=2) markers.",
      )
      parser.add_argument(
          "output", help="The output image containing the segmentation."
      )
      parser.add_argument(
          "--boundary",
          default="diff_exp",
          help="The boundary term to use. Note that the ones prefixed with diff_ require the original image, while the ones prefixed with max_ require the gradient image.",
          choices=[
              "diff_linear",
              "diff_exp",
              "diff_div",
              "diff_pow",
              "max_linear",
              "max_exp",
              "max_div",
              "max_pow",
          ],
      )
      parser.add_argument(
          "-s",
          dest="spacing",
          action="store_true",
          help="Set this flag to take the pixel spacing of the image into account. The spacing data will be extracted from the baddtional image.",
      )
      parser.add_argument(
          "-f",
          dest="force",
          action="store_true",
          help="Set this flag to silently override files that exist.",
      )
      parser.add_argument(
          "-v",
          dest="verbose",
          action="store_true",
          help="Display more information.",
      )
      parser.add_argument(
          "-d",
          dest="debug",
          action="store_true",
          help="Display debug information.",
      )
  
      return parser
  
file_path: medpy/bin/medpy_graphcut_voxel.py
imports: from argparse import RawTextHelpFormatter
  import argparse
  import logging
  import os
  import scipy
  from medpy.core import ArgumentError, Logger
  from medpy.io import load, save, header
  from medpy import graphcut
  from medpy.graphcut.wrapper import split_marker
label_desc: Use image node_id 3 for calling a global function with example usage: getParser() and returns: parser