code: def do_resampling(data_array, pixdim_init, pixdim_fin, interp_order):
      """
      Performs the resampling
      Perform the resampling of the data array given the initial and final pixel
      dimensions and the interpolation order
      this function assumes the same interp_order for multi-modal images
  
      :param data_array: 5D Data array to resample
      :param pixdim_init: Initial pixel dimension
      :param pixdim_fin: Targeted pixel dimension
      :param interp_order: Interpolation order applied
      :return data_resampled: Array containing the resampled data
      """
      if data_array is None:
          return None
      if np.array_equal(pixdim_fin, pixdim_init):
          return data_array
      try:
          assert len(pixdim_init) <= len(pixdim_fin)
      except (TypeError, AssertionError):
          tf.logging.fatal(
              "unknown pixdim format original %s output %s",
              pixdim_init,
              pixdim_fin,
          )
          raise
      to_multiply = np.divide(
          pixdim_init, pixdim_fin[: len(pixdim_init)]
      )
      data_shape = data_array.shape
      if len(data_shape) != 5:
          raise ValueError(
              "only supports 5D array resampling, "
              "input shape {}".format(data_shape)
          )
      data_resampled = []
      for time_point in range(0, data_shape[3]):
          data_mod = []
          for mod in range(0, data_shape[4]):
              data_new = scipy.ndimage.zoom(
                  data_array[..., time_point, mod],
                  to_multiply[0:3],
                  order=interp_order,
              )
              data_mod.append(data_new[..., np.newaxis, np.newaxis])
          data_resampled.append(np.concatenate(data_mod, axis=-1))
      return np.concatenate(data_resampled, axis=-2)
  
imports: from __future__ import absolute_import, print_function, unicode_literals
  import errno
  import importlib
  import logging
  import os
  import re
  import sys
  import warnings
  import nibabel
  import numpy
  import pandas
  import scipy.ndimage
  import tensorflow
  from tensorflow.core.framework import summary_pb2
  from niftynet.io.image_loader import load_image_obj
  from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig
  from niftynet.utilities.util_import import require_module
label_desc: Use image node_id 10 for calling a global function with example usage: do_resampling(data_array, pixdim_init, pixdim_fin, interp_order) and returns: np, None, data_array