code: def test_trilinear_interp_cubic_voxels():
      def stepped_1d(arr_1d):
          # Make a version of `arr_1d` which is not contiguous
          return np.vstack((arr_1d, arr_1d)).ravel(order="F")[::2]
  
      A = np.ones((17, 17, 17))
      B = np.zeros(3)
      strides = np.array(A.strides, np.intp)
      A[7, 7, 7] = 2
      points = np.array([[0, 0, 0], [7.0, 7.5, 7.0], [3.5, 3.5, 3.5]])
      map_coordinates_trilinear_iso(A, points, strides, 3, B)
      npt.assert_array_almost_equal(B, np.array([1.0, 1.5, 1.0]))
      # All of the input array, points array, strides array and output array must
      # be C-contiguous.  Check by passing in versions that aren't C contiguous
      npt.assert_raises(
          ValueError,
          map_coordinates_trilinear_iso,
          A.copy(order="F"),
          points,
          strides,
          3,
          B,
      )
      npt.assert_raises(
          ValueError,
          map_coordinates_trilinear_iso,
          A,
          points.copy(order="F"),
          strides,
          3,
          B,
      )
      npt.assert_raises(
          ValueError,
          map_coordinates_trilinear_iso,
          A,
          points,
          stepped_1d(strides),
          3,
          B,
      )
      npt.assert_raises(
          ValueError,
          map_coordinates_trilinear_iso,
          A,
          points,
          strides,
          3,
          stepped_1d(B),
      )
  
file_path: dipy/dipy/core/tests/test_interpolation.py
imports: import numpy
  import numpy.testing
  import warnings
  from scipy.ndimage import map_coordinates
  from dipy.core.subdivide_octahedron import create_unit_sphere
  from dipy.core.interpolation import trilinear_interpolate4d, interpolate_scalar_2d, interpolate_scalar_3d, interpolate_vector_2d, interpolate_vector_3d, interpolate_scalar_nn_2d, interpolate_scalar_nn_3d, NearestNeighborInterpolator, TriLinearInterpolator, OutsideImage, map_coordinates_trilinear_iso, interp_rbf
  from dipy.align import floating
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 10 for calling a global function with example usage: test_trilinear_interp_cubic_voxels() and returns: np