code: def test_to_voxel_coordinates_precision():
      # To simplify tests, use an identity affine. This would be the result of
      # a call to _mapping_to_voxel with another identity affine.
      transfo = np.array(
          [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
      )
  
      # Offset is computed by _mapping_to_voxel. With a 1x1x1 dataset
      # having no translation, the offset is half the voxel size, i.e. 0.5.
      offset = np.array([0.5, 0.5, 0.5])
  
      # Without the added tolerance in _to_voxel_coordinates, this streamline
      # should raise an Error in the call to _to_voxel_coordinates.
      failing_strl = [
          np.array(
              [[-0.5000001, 0.0, 0.0], [0.0, 1.0, 0.0]],
              dtype=np.float32,
          )
      ]
  
      indices = _to_voxel_coordinates(failing_strl, transfo, offset)
  
      expected_indices = np.array([[[0, 0, 0], [0, 1, 0]]])
      npt.assert_array_equal(indices, expected_indices)
  
imports: import warnings
  import numpy
  import pytest
  from dipy.tracking import metrics
  from dipy.tracking.streamline import transform_streamlines
  from dipy.tracking.utils import connectivity_matrix, density_map, length, ndbincount, reduce_labels, seeds_from_mask, random_seeds_from_mask, target, target_line_based, unique_rows, near_roi, reduce_rois, path_length, _min_at, max_angle_from_curvature, min_radius_curvature_from_angle
  from dipy.tracking._utils import _to_voxel_coordinates
  from dipy.tracking.vox2track import streamline_mapping
  import numpy.testing
  from dipy.testing import assert_true
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 3 for calling a global function with example usage: test_to_voxel_coordinates_precision() without return types