Image Position (Patient) and Image Orientation (Patient) are the two only attributes you should ever used when computing distance between slices.