code: def tracks_to_expected(tracks, vol_dims):
      # simulate expected behavior of module
      vol_dims = np.array(vol_dims, dtype=np.int32)
      counts = np.zeros(vol_dims, dtype=np.int32)
      elements = {}
      for t_no, t in enumerate(tracks):
          u_ps = set()
          ti = np.round(t).astype(np.int32)
          for p_no, p in enumerate(ti):
              if np.any(p < 0):
                  p[p < 0] = 0
              too_high = p >= vol_dims
              if np.any(too_high):
                  p[too_high] = vol_dims[too_high] - 1
              p = tuple(p)
              if p in u_ps:
                  continue
              u_ps.add(p)
              val = t_no
              if counts[p]:
                  elements[p].append(val)
              else:
                  elements[p] = [val]
              counts[p] += 1
      return counts, elements
  
imports: import numpy
  from numpy.testing import assert_array_equal
  import dipy.tracking.vox2track
label_desc: Use image node_id 1 for calling a global function with example usage: tracks_to_expected(tracks, vol_dims) and returns: counts,  elements