docs: def getArguments(parser):
      "Provides additional validation of the arguments collected by argparse."
      args = parser.parse_args()
      # get the number of dimensions in the image
      if args.example:
          args.example_image, args.example_header = load(args.example)
          dimensions = args.example_image.ndim
      else:
          dimensions = len(args.shape)
      
      # check and, if required, modify the spacing argument
      if isinstance(args.spacing, int):
          args.spacing = [args.spacing] * dimensions
      elif len(args.spacing) != dimensions:
          raise argparse.ArgumentTypeError('the grid spacing ({}) must contain the same number of elements as the output image has dimensions ({})'.format(','.join(map(str, args.spacing)), dimensions))
      
      # check further arguments
      if args.offset and len(args.offset) != dimensions:
          raise argparse.ArgumentTypeError('the offset ({}) must contain the same number of elements as the output image has dimensions ({})'.format(','.join(map(str, args.offset)), dimensions))
      if args.pixelspacing and len(args.pixelspacing) != dimensions:
          raise argparse.ArgumentTypeError('the supplied pixel spacing ({}) must contain the same number of elements as the output image has dimensions ({})'.format(','.join(map(str, args.pixelspacing)), dimensions))
      
      return args