ufo-kit/concert — pull request #316 by tomago (2014-09-17 14:34:27+00:00)
Title: Add addons

There is often a compact functionality which operates on experiments but does not depend on their internal implementation, e.g. image-writing to disk, online reconstruction and so on.
This PR adds addons to experiments which deal with the above cases. Now one does not need a special experiment subclass just to write the images on disk but would do the following:
```python
...
from concert.experiments.addons import ImageWriter

# acquisitions don't need to be all of the experiment's acquisitions, unlike before
writer = ImageWriter(acquisitions, walker)
experiment.attach(writer)
# images are written to disk now
experiment.run()
# image writing no longer needed?
experiment.detach(writer)
```

Up to now, the live preview was handled in an ad-hoc way, now one can specify what is shown:
```python
...
from concert.experiments.addons import Consumer

viewer = Consumer(acquisitions, PyplotImageViewer())
experiment.attach(viewer)
# And the images from acquisitions are displayed to us
experiment.run()
```