spectralpython / spectral

Python module for hyperspectral image processing
MIT License
573 stars 139 forks source link

Display of pixel row/col by clicking in ND-window not functioning properly #40

Closed tboggs closed 8 years ago

tboggs commented 8 years ago

When clicking on a pixel with CTRL+SHIFT in the ND-window display (after calling view_nd), the following exception is raised:

Traceback (most recent call last):
  File "/home/thomas/src/spectral/spectral/graphics/ndwindow.py", line 93, in left_down
    self.window.canvas.SetCurrent(self.canvas.context)
AttributeError: MouseHandler instance has no attribute 'canvas'

This is due not accessing the window canvas properly (should be self.window.canvas).

Furthermore, the pixel coordinate returned incorrectly has a floating point row value (should be int):

Pixel 10264 (70.786206896551718, 114) has class 0.

This was likely introduced when the file began using true division (by importing division from __future__).