code: def resample_patient(
      data,
      seg,
      original_spacing,
      target_spacing,
      order_data=3,
      order_seg=0,
      force_separate_z=False,
      order_z_data=0,
      order_z_seg=0,
      separate_z_anisotropy_threshold=3,
  ):
      assert not ((data is None) and (seg is None))
      if data is not None:
          assert len(data.shape) == 4, "Data geometry must be c x y z."
      if seg is not None:
          assert (
              len(seg.shape) == 4
          ), "Segmentation geometry must be c x y z."
  
      if data is not None:
          shape = np.array(data[0].shape)
      else:
          shape = np.array(seg[0].shape)
      new_shape = np.round(
          (
              (
                  np.array(original_spacing) / np.array(target_spacing)
              ).astype(float)
              * shape
          )
      ).astype(int)
  
      if force_separate_z is not None:
          do_separate_z = force_separate_z
          if force_separate_z:
              axis = get_lowres_axis(original_spacing)
          else:
              axis = None
      else:
          if get_do_separate_z(
              original_spacing, separate_z_anisotropy_threshold
          ):
              do_separate_z = True
              axis = get_lowres_axis(original_spacing)
          elif get_do_separate_z(
              target_spacing, separate_z_anisotropy_threshold
          ):
              do_separate_z = True
              axis = get_lowres_axis(target_spacing)
          else:
              do_separate_z = False
              axis = None
  
      if axis is not None:
          if len(axis) == 3:
              do_separate_z = False
          elif len(axis) == 2:
              do_separate_z = False
          else:
              pass
  
      if data is not None:
          data_reshaped = resample_data_or_seg(
              data,
              new_shape,
              False,
              axis,
              order_data,
              do_separate_z,
              order_z=order_z_data,
          )
      else:
          data_reshaped = None
      if seg is not None:
          seg_reshaped = resample_data_or_seg(
              seg,
              new_shape,
              True,
              axis,
              order_seg,
              do_separate_z,
              order_z=order_z_seg,
          )
      else:
          seg_reshaped = None
      return data_reshaped, seg_reshaped
  
imports: import pickle
  import os
  import numpy
  from collections import OrderedDict
  from scipy.ndimage.interpolation import map_coordinates
  from multiprocessing.pool import Pool
  from skimage.transform import resize
  from .image_crop import get_case_identifier_from_npz, ImageCropper
  from .path_utils import join_paths
label_desc: Use image node_id 4 for calling a global function with example usage: resample_patient(data, seg, original_spacing, target_spacing, order_data, order_seg, force_separate_z, order_z_data, order_z_seg, separate_z_anisotropy_threshold) and returns: data_reshaped,  seg_reshaped