Threshold detection debugged

Removed background stack support
Replaced double indexing format by singe index for image access
("substacks" -> frames)
Verified that automatic threshold detection works on test data