code: def main():
      # parse cmd arguments
      parser = getParser()
      parser.parse_args()
      args = getArguments(parser)
  
      # prepare logger
      logger = Logger.getInstance()
      if args.debug:
          logger.setLevel(logging.DEBUG)
      elif args.verbose:
          logger.setLevel(logging.INFO)
  
      # check if output image exists (will also be performed before saving, but as the smoothing might be very time intensity, a initial check can save frustration)
      if not args.force:
          if os.path.exists(args.output):
              raise parser.error(
                  "The output image {} already exists.".format(
                      args.output
                  )
              )
  
      # loading image
      data_input, header_input = load(args.input)
  
      # apply the watershed
      logger.info(
          "Applying anisotropic diffusion with settings: niter={} / kappa={} / gamma={}...".format(
              args.iterations, args.kappa, args.gamma
          )
      )
      data_output = anisotropic_diffusion(
          data_input,
          args.iterations,
          args.kappa,
          args.gamma,
          get_pixel_spacing(header_input),
      )
  
      # save file
      save(data_output, args.output, header_input, args.force)
  
      logger.info("Successfully terminated.")
  
file_path: medpy/bin/medpy_anisotropic_diffusion.py
imports: import argparse
  import logging
  import os
  from medpy.io import load, save, get_pixel_spacing
  from medpy.core import Logger
  from medpy.filter.smoothing import anisotropic_diffusion
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types