scikit-image/scikit-image — pull request #1065 by blink1073 (2014-07-13 01:41:36+00:00)
Title: Multi linetool drawing

This addresses #1029 and #1030. I moved blit handling to a separate class attached to the Axes. This allows all blitting objects to be handled without conflict. Additionally, I factored the event handling behavior out of the LineTool class into a separate class attached to the Axes. The behavior is as follows on a mouse click:

- If the user clicks one of the tool handles, it is selected and set as the active tool.
- If no handles were selected and there is an active tool, redraw it at that point.
- If there is no active tool, use the first tool that does not ignore the event, and redraw it at that point.

Here is what I used to test the behavior:

```python
from skimage import data
from skimage.viewer import ImageViewer
from skimage.viewer.plugins.lineprofile import LineProfile
from skimage.viewer.canvastools import LineTool
import numpy as np

image = data.camera()
viewer = ImageViewer(image)
lp = LineProfile()
viewer += lp

h, w = image.shape[0:2]
x = [w / 3, 2 * w / 3]
y = [h / 3] * 2

new = LineTool(lp.line_tool.ax)
new.end_points = np.transpose([x, y])
line, profile = viewer.show()[0]
```

I did not extend this to the `RectangleTool`, because it inherits from matplotlib's `RectangleSelector`, and it would be messy to interfere with its event-handling mechanism. Once I add in the [image_inspector](https://github.com/blink1073/image_inspector) tools, I can move the `EventManager` integration up to the `CanvasTool` level.