docstr: Computes the voxel sizes of an image from the affine.
  
  Checks that the affine does not have any shear because local_tracker
  assumes that the data is sampled on a regular grid.
docstr_tok: ["Computes","the","voxel","sizes","of","an","image","from","the","affine",".","Checks","that","the","affine","does","not","have","any","shear","because","local_tracker","assumes","that","the","data","is","sampled","on","a","regular","grid","."]
code: def _get_voxel_size(affine):
      """Computes the voxel sizes of an image from the affine.
  
      Checks that the affine does not have any shear because local_tracker
      assumes that the data is sampled on a regular grid.
  
      """
      lin = affine[:3, :3]
      dotlin = np.dot(lin.T, lin)
      # Check that the affine is well behaved
      if not np.allclose(np.triu(dotlin, 1), 0.0, atol=1e-5):
          msg = (
              "The affine provided seems to contain shearing, data must "
              "be acquired or interpolated on a regular grid to be used "
              "with `LocalTracking`."
          )
          raise ValueError(msg)
      return np.sqrt(dotlin.diagonal())
  
file_path: dipy/dipy/tracking/local_tracking.py
imports: import random
  from collections.abc import Iterable
  from warnings import warn
  import numpy
  from dipy.tracking.localtrack import local_tracker, pft_tracker
  from dipy.tracking.stopping_criterion import AnatomicalStoppingCriterion, StreamlineStatus
  from dipy.tracking import utils
  from dipy.utils import fast_numpy
label_desc: Use image node_id 1 for calling the LocalTracking obj's underlying member method code with example usage: obj._get_voxel_size(affine) and returns: np