Closed haesleinhuepf closed 7 years ago
@haesleinhuepf I tidied up the warning text comments a bit, and clarified the new one a little. Is it understandable?
The code changes look ok to me... i suppose you tested it works and catches the -ve pixel values issue right and prevents the crash? Right?
Should we have a unit test to check this is working? Or is that overkill?
I'm happy to merge if you are confident its all good.
@chalkie666 I just pulled and checked again. I works as expected. The error message appears more informative now. But is it a good idea to suggest setting negative pixel values to zero? I mean, technically you can make the algorithm work, but the results may stay as wrong was when these pixels are ignored, right?
Ah and regarding the automated test: I would like to add a test, but appears quite complicated as there is no InputCheck test I could just extend. So maybe we keep a another github issue "Write test for InputCheck class"?
@haesleinhuepf Actually the input checks are tests in of themselves... so probably no point in testing tests? Maybe my logic is wrong here... Depending on the type of microscopy, and if it involved a reconstruction algorithm to generate final image, it might make sense to shift values or clamp negatives to zero.... if we offer two possibilities, at least the user is aware they need to think harder. The warning is the best help we can give.
Thanks for the contribution here! Its a worthwhile problem to catch, and now we do!
I added two checks preventing a crash and warning the user when using images with negative pixel values to resolve #48 .
Cheers, Robert