code: def zoom_3d(image, ratio, interp_order):
      """
      Taking 5D image as input, and zoom each 3D slice independently
      """
      assert image.ndim == 5, "input images should be 5D array"
      output = []
      for time_pt in range(image.shape[3]):
          output_mod = []
          for mod in range(image.shape[4]):
              zoomed = scipy.ndimage.zoom(
                  image[..., time_pt, mod],
                  ratio[:3],
                  order=interp_order,
              )
              output_mod.append(zoomed[..., np.newaxis, np.newaxis])
          output.append(np.concatenate(output_mod, axis=-1))
      return np.concatenate(output, axis=-2)
  
file_path: NiftyNet/niftynet/engine/sampler_resize_v2.py
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import scipy.ndimage
  import tensorflow
  from niftynet.engine.image_window_dataset import ImageWindowDataset
  from niftynet.engine.image_window import LOCATION_FORMAT
label_desc: Use image node_id 1 for calling a global function with example usage: zoom_3d(image, ratio, interp_order) and returns: np