code: def get_pixels_on_line(self, x1, y1, x2, y2, getvalues=True):
          
          # NOTE: seems to be necessary or we get a non-terminating result
          x1, y1, x2, y2 = int(x1), int(y1), int(x2), int(y2)
  
          dx = abs(x2 - x1)
          dy = abs(y2 - y1)
          if x1 < x2:
              sx = 1
          else:
              sx = -1
          if y1 < y2:
              sy = 1
          else:
              sy = -1
          err = dx - dy
  
          res = []
          x, y = x1, y1
          while True:
              if getvalues:
                  try:
                      val = self.get_data_xy(x, y)
                  except Exception:
                      val = np.NaN
                  res.append(val)
              else:
                  res.append((x, y))
              if (x == x2) and (y == y2):
                  break
              e2 = 2 * err
              if e2 > -dy:
                  err = err - dy
                  x += sx
              if e2 < dx:
                  err = err + dx
                  y += sy
  
          return res
docs: Uses Bresenham's line algorithm to enumerate the pixels along
          a line.
          (see http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm)
  
          If `getvalues`==False then it will return tuples of (x, y) coordinates
          instead of pixel values.