code: def spatialnumarray(string_input):
      """
      This function parses a 3-element tuple from a string input
      if the input has less than 3 elements,
      the last element is repeated as padding.
      """
      int_tuple = int_array(string_input) or (0,)
      while len(int_tuple) < 3:
          int_tuple = int_tuple + (int_tuple[-1],)
      int_tuple = int_tuple[:3]
      return int_tuple
  
file_path: NiftyNet/niftynet/utilities/user_parameters_helper.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import argparse
  import re
  from six import string_types
  from niftynet.utilities.user_parameters_regex import match_array
label_desc: Use image node_id 10 for calling a global function with example usage: spatialnumarray(string_input) and returns: int_tuple