code: def main():
      parser = getParser()
      args = getArguments(parser)
  
      # prepare logger
      logger = Logger.getInstance()
      if args.debug:
          logger.setLevel(logging.DEBUG)
      elif args.verbose:
          logger.setLevel(logging.INFO)
  
      # loading input images
      img, hdr = load(args.input)
  
      # check spacing values
      if not len(args.spacing) == img.ndim:
          parser.error(
              "The image has {} dimensions, but {} spacing parameters have been supplied.".format(
                  img.ndim, len(args.spacing)
              )
          )
  
      # check if output image exists
      if not args.force:
          if os.path.exists(args.output):
              parser.error(
                  "The output image {} already exists.".format(
                      args.output
                  )
              )
  
      logger.debug("target voxel spacing: {}".format(args.spacing))
  
      # compute zoom values
      zoom_factors = [
          old / float(new)
          for new, old in zip(
              args.spacing, header.get_pixel_spacing(hdr)
          )
      ]
      logger.debug("zoom-factors: {}".format(zoom_factors))
  
      # zoom image
      img = scipy.ndimage.zoom(img, zoom_factors, order=args.order)
      logger.debug("new image shape: {}".format(img.shape))
  
      # set new voxel spacing
      header.set_pixel_spacing(hdr, args.spacing)
  
      # saving the resulting image
      save(img, args.output, hdr, args.force)
  
file_path: medpy/bin/medpy_resample.py
imports: import os
  import argparse
  import logging
  import scipy.ndimage
  from medpy.core import Logger
  from medpy.io import load, save, header
  from medpy.utilities import argparseu
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types