code: def test_track_volumes():
      # simplest case
      vol_dims = (1, 2, 3)
      tracks = ([[0, 0, 0], [0, 1, 1]],)
      tracks = [np.array(t) for t in tracks]
      ex_counts, ex_els = tracks_to_expected(tracks, vol_dims)
      tcs, tes = tvo.track_counts(tracks, vol_dims, [1, 1, 1])
      assert_array_equal(tcs, ex_counts)
      assert_array_equal(tes, ex_els)
      # check only counts returned for return_elements=False
      tcs = tvo.track_counts(tracks, vol_dims, [1, 1, 1], False)
      assert_array_equal(tcs, ex_counts)
  
      # non-unique points, non-integer points, points outside
      vol_dims = (5, 10, 15)
      tracks = (
          [[-1, 0, 1], [0, 0.1, 0], [1, 1, 1], [1, 1, 1], [2, 2, 2]],
          [[0.7, 0, 0], [1, 1, 1], [1, 2, 2], [1, 11, 0]],
      )
      tracks = [np.array(t) for t in tracks]
      ex_counts, ex_els = tracks_to_expected(tracks, vol_dims)
      tcs, tes = tvo.track_counts(tracks, vol_dims, [1, 1, 1])
      assert_array_equal(tcs, ex_counts)
      assert_array_equal(tes, ex_els)
      # points with non-unit voxel sizes
      vox_sizes = [1.4, 2.1, 3.7]
      float_tracks = []
      for t in tracks:
          float_tracks.append(t * vox_sizes)
      tcs, tes = tvo.track_counts(float_tracks, vol_dims, vox_sizes)
      assert_array_equal(tcs, ex_counts)
      assert_array_equal(tes, ex_els)
  
imports: import numpy
  from numpy.testing import assert_array_equal
  import dipy.tracking.vox2track
label_desc: Use image node_id 2 for calling a global function with example usage: test_track_volumes() without return types