Refactored thresholding to reflect code changes

I refactored the threshold code to reflect the new code architecture but I'm running into a somewhat strange issue. This code worked before the refactoring and currently passes the benchmark test (its outputs match opencv's) but it isn't rendering properly in Dream. It is black except for when thresholded at a negative value between 0 and -127, is this something that I am doing wrong or potentially a bug in Dream?