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)
  
      # laod input image
      data_input, header_input = load(args.input)
  
      #    # check if output image exists
      #    if not args.force:
      #        if os.path.exists(image_gradient_name):
      #            logger.warning('The output image {} already exists. Skipping this step.'.format(image_gradient_name))
      #            continue
  
      # prepare result image
      data_output = scipy.zeros(data_input.shape, dtype=scipy.float32)
  
      # apply the gradient magnitude filter
      logger.info(
          "Computing the gradient magnitude with Prewitt operator..."
      )
      generic_gradient_magnitude(
          data_input, prewitt, output=data_output
      )  # alternative to prewitt is sobel
  
      # save resulting mask
      save(data_output, args.output, header_input, args.force)
  
      logger.info("Successfully terminated.")
  
file_path: medpy/bin/medpy_gradient.py
imports: import argparse
  import logging
  import scipy
  from scipy.ndimage import generic_gradient_magnitude, prewitt
  from medpy.io import load, save
  from medpy.core import Logger
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types