code: def getParser():
      "Creates and returns the argparse parser object."
      parser = argparse.ArgumentParser(description=__description__)
      parser.add_argument("input", help="Source volume.")
      parser.add_argument("output", help="Target volume.")
      parser.add_argument(
          "-t",
          "--type",
          dest="type",
          choices=["erosion", "dilation", "opening", "closing"],
          default="erosion",
          help="The type of the morphological operation.",
      )
      parser.add_argument(
          "-i",
          "--iterations",
          dest="iterations",
          default=0,
          type=int,
          help="The number of iteration to execute. Supply a value of 1 or higher to restrict the effect of the morphological operation. Otherwise it is applied until saturation.",
      )
      parser.add_argument(
          "-s",
          "--size",
          dest="size",
          default=3,
          type=int,
          help="Size of the closing element (>=1). The higher this value, the bigger the wholes that get closed (closing) resp. unconnected elements that are removed (opening). In the 3D case, 1 equals a 6-connectedness, 2 a 12-connectedness, 3 a 18-connectedness, etc.",
      )
      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.",
      )
      parser.add_argument(
          "-f",
          dest="force",
          action="store_true",
          help="Silently override existing output images.",
      )
  
      return parser
  
file_path: medpy/bin/medpy_morphology.py
imports: import argparse
  import logging
  import scipy.ndimage
  from medpy.core import Logger
  from medpy.io import load, save
label_desc: Use image node_id 3 for calling a global function with example usage: getParser() and returns: parser