code: def interp_slice_times(Z, slice_times, tr):
      Z = np.asarray(Z)
      nslices = len(slice_times)
      aux = np.asarray(list(slice_times) + [slice_times[0] + tr])
      Zf = np.floor(Z).astype("int")
      w = Z - Zf
      Zal = Zf % nslices
      Za = Zal + w
      ret = (1 - w) * aux[Zal] + w * aux[Zal + 1]
      ret += Z - Za
      return ret
  
imports: import os
  import warnings
  import numpy
  from nibabel import io_orientation
  from nibabel.affines import apply_affine
  from ...core.image.image_spaces import as_xyz_image, make_xyz_image, xyz_affine
  from ...io.nibcompat import get_header
  from ..slicetiming import timefuncs
  from ._registration import _cspline_sample3d, _cspline_sample4d, _cspline_transform
  from .affine import Affine, Rigid
  from .optimizer import configure_optimizer, use_derivatives
  from .type_check import check_type, check_type_and_shape
label_desc: Use image node_id 1 for calling a global function with example usage: interp_slice_times(Z, slice_times, tr) and returns: ret