Working on threshold finding still:
Check which value is closer to the threshold. Only if the slope is positive AND
the new delta between value and threshold is *larger* then the old delta, we
found the threshold. If slope is negative, we just have a ripple in the DAC's
distribution.
More threshold finding fixes:
If the pixel is above threshold at first appearance, the respective
DAC value is set as its threshold.
Threshold finding: catch the case where a pixel never actually reaches
the threshold level. In this case we set the threshold return value to
"dacMax" (rising edge) or "dacMin" (falling edge) - because this is
consistent the finding.