code: def do_resampling_idx(idx_array, init_pixdim, fin_pixdim):
      """
      Performs the transformation of indices (for csv sampler) when resampling
      is required (change of resolution enforced
      :param idx_array: array of indices to modify
      :param init_pixdim: initial pixdim
      :param fin_pixdim: target pixdim
      :return: new_idx transformed array of indices according to resampling
      """
      if fin_pixdim is None:
          new_idx = idx_array
          return new_idx
      factor_mult = np.asarray(init_pixdim) / np.asarray(fin_pixdim)
      new_idx = idx_array.astype(np.float32) * factor_mult
      new_idx = new_idx.astype(np.int32)
      return new_idx
  
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 7 for calling a global function with example usage: do_resampling_idx(idx_array, init_pixdim, fin_pixdim) and returns: new_idx, new_idx