code: def resample_array(src_imgs, src_spacing, target_spacing):
      src_spacing = np.round(src_spacing, 3)
      target_shape = [
          int(
              src_imgs.shape[ix]
              * src_spacing[::-1][ix]
              / target_spacing[::-1][ix]
          )
          for ix in range(len(src_imgs.shape))
      ]
      for i in range(len(target_shape)):
          try:
              assert target_shape[i] > 0
          except:
              raise AssertionError(
                  "AssertionError:",
                  src_imgs.shape,
                  src_spacing,
                  target_spacing,
              )
  
      img = src_imgs.astype(float)
      resampled_img = resize(
          img, target_shape, order=1, clip=True, mode="edge"
      ).astype("float32")
  
      return resampled_img
  
file_path: medicaldetectiontoolkit/experiments/lidc_exp/preprocessing.py
imports: import os
  import SimpleITK
  import numpy
  from multiprocessing import Pool
  import pandas
  import numpy.testing
  from skimage.transform import resize
  import subprocess
  import pickle
  import configs
label_desc: Use image node_id 1 for calling a global function with example usage: resample_array(src_imgs, src_spacing, target_spacing) and returns: resampled_img