code: def resample_image(
      itk_image, out_spacing=(1.0, 1.0, 1.0), is_label=False
  ):
      original_spacing = itk_image.GetSpacing()
      original_size = itk_image.GetSize()
  
      out_size = [
          int(
              np.round(
                  original_size[0]
                  * (original_spacing[0] / out_spacing[0])
              )
          ),
          int(
              np.round(
                  original_size[1]
                  * (original_spacing[1] / out_spacing[1])
              )
          ),
          int(
              np.round(
                  original_size[2]
                  * (original_spacing[2] / out_spacing[2])
              )
          ),
      ]
  
      resample = sitk.ResampleImageFilter()
      resample.SetOutputSpacing(out_spacing)
      resample.SetSize(out_size)
      resample.SetOutputDirection(itk_image.GetDirection())
      resample.SetOutputOrigin(itk_image.GetOrigin())
      resample.SetTransform(sitk.Transform())
      resample.SetDefaultPixelValue(itk_image.GetPixelIDValue())
  
      if is_label:
          resample.SetInterpolator(sitk.sitkNearestNeighbor)
      else:
          resample.SetInterpolator(sitk.sitkBSpline)
  
      return resample.Execute(itk_image)
  
file_path: DLTK/data/IXI_HH/download_IXI_HH.py
imports: from __future__ import unicode_literals
  from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from future.standard_library import install_aliases
  from urllib.request import FancyURLopener
  import os.path
  import tarfile
  import pandas
  import glob
  import SimpleITK
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: resample_image(itk_image, out_spacing, is_label) and returns: resample