bugfix: TolerantEditDistance did not clear output image stacks
Merge pull request #7 from JonasKlein/master

Finished MinimalImpactTEDWriter
Added recreation of the pipeline in MinimalImpactTEDWriter to avoid accumulation of memory. The output file is also deleted properly now before the writing to it.
MinimalImpactTEDWriter now writes the number of variables to the output file. This is required by sbmrm to enable sparse representation of the coefficients. Part of the code has been reformated for clarity and performance.