Manual threshold does not allow a threshold greater than 255
About you
This bug was submitted by @fouardc on bugzilla, on 2015-10-23
Overview:
While utilizing ITK Segmentation -> Manual Threshold Filter, it is not possible to choose a low threshold or a high threshold higher than 255, or lower than 0. This raises no problem for medical images encoded on unsigned char, however, for other kind of images (for example CT Scanner generally encoded on signed short), higher threshold values or negative threshold value may come handy. -- C. Fouard
Steps to Reproduce:
Open an image not encode in unsigned char. For example:
- open the sinus dicom in the examples data base
- select this image in the explorer and choose to apply ITK Segmentation -> Manual Threshold Filter
- try to set the lower threshold to -53 and the higher threshold to 455 (yes, why not, if my algorithm says so?)
- it is not possible
Actual VS Expected Result:
The fact that it is not possible is ok for some images, but it would be nice for the user to be able to choose any lower and higher threshold within the range of the encoded type of the image.
Relevant logs and/or screenshots:
[Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's very hard to read otherwise.]
Interpretation & Possible fixes:
It may come from the lines 63 and 64 of ManualThreshold.cpp :
lowThresholdProperty->setAttribute("minimum", 0); lowThresholdProperty->setAttribute("maximum", 255);
and the lines 69 and 70 of the same file:
highThresholdProperty->setAttribute("minimum", 0); highThresholdProperty->setAttribute("maximum", 255);
These 2 values 0, and 255 may not be encoded hardwire but may be declared as variables updated when a new image is set as input (an override of the getWidget method implementation may be needed) with the minimum and maximum value of the encoding type of the input image.
CamiTK Version:
This was submitted for CamiTK 3.5.0.2135 But the bug is still present in version 4.0.x and 4.1.0.develop
please do not remove anything below this line