code: def resample3d(
      image, label, image_spacings, target_spacing=(1.6, 1.2, 1.2)
  ):
      if image_spacings != target_spacing:
          spc_arr, targ_arr, shp_arr = (
              np.array(image_spacings),
              np.array(target_spacing),
              np.array(image.shape[1:]),
          )
          new_shape = (
              (spc_arr / targ_arr * shp_arr).astype(int).tolist()
          )
          image = F.interpolate(
              torch.from_numpy(np.expand_dims(image, axis=0)),
              size=new_shape,
              mode="trilinear",
              align_corners=True,
          )
          label = F.interpolate(
              torch.from_numpy(np.expand_dims(label, axis=0)),
              size=new_shape,
              mode="nearest",
          )
          image = np.squeeze(image.numpy(), axis=0)
          label = np.squeeze(label.numpy(), axis=0)
      return image, label
  
file_path: tinygrad/extra/datasets/kits19.py
imports: import random
  import functools
  from pathlib import Path
  import numpy
  import nibabel
  from scipy import signal
  import torch
  import torch.nn.functional
  from tinygrad.tensor import Tensor
  from tinygrad.helpers import fetch
label_desc: Use image node_id 3 for calling a global function with example usage: resample3d(image, label, image_spacings, target_spacing) and returns: image,  label