code: def add_inference_args(parser):
      """
      keywords defined for inference action
  
      :param parser:
      :return:
      """
      parser.add_argument(
          "--spatial_window_size",
          type=spatial_atleast3d,
          help="Specify the spatial size of the input data (ndims <= 3)",
          default=(),
      )
  
      parser.add_argument(
          "--inference_iter",
          metavar="",
          help="[Inference only] Use the checkpoint at this iteration for "
          "inference",
          type=int,
          default=-1,
      )
  
      parser.add_argument(
          "--dataset_to_infer",
          metavar="",
          help="[Inference only] which data set to compute inference for",
          choices=list(SUPPORTED_PHASES) + [""],
          default="",
      )
  
      parser.add_argument(
          "--save_seg_dir",
          metavar="",
          help="[Inference only] Prediction directory name",  # without '/'
          default=DEFAULT_INFERENCE_OUTPUT,
      )
  
      parser.add_argument(
          "--output_postfix",
          metavar="",
          help="[Inference only] Prediction filename postfix",
          default="_niftynet_out",
      )
  
      parser.add_argument(
          "--output_interp_order",
          metavar="",
          help="[Inference only] interpolation order of the network output",
          type=int,
          default=0,
      )
  
      parser.add_argument(
          "--border",
          metavar="",
          help="[Inference only] Width of borders to crop for segmented patch",
          type=spatialnumarray,
          default=(0, 0, 0),
      )
  
      parser.add_argument(
          "--fill_constant",
          help="[Inference only] Output fill value "
          "used fill borders of output images.",
          type=float,
          default=0.0,
      )
  
      return parser
  
file_path: NiftyNet/niftynet/utilities/user_parameters_default.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import os
  from niftynet.engine.image_window_dataset import SMALLER_FINAL_BATCH_MODE
  from niftynet.io.image_loader import SUPPORTED_LOADERS
  from niftynet.io.image_sets_partitioner import SUPPORTED_PHASES
  from niftynet.utilities.user_parameters_helper import float_array, int_array, spatial_atleast3d, spatialnumarray, str2boolean, str_array
  from niftynet.utilities.util_import import require_module
label_desc: Use image node_id 2 for calling a global function with example usage: add_inference_args(parser) and returns: parser