18 #ifndef sitkOtsuThresholdImageFilter_h
19 #define sitkOtsuThresholdImageFilter_h
70 SITK_RETURN_SELF_TYPE_HEADER
SetInsideValue ( uint8_t InsideValue ) { this->m_InsideValue = InsideValue;
return *
this; }
82 SITK_RETURN_SELF_TYPE_HEADER
SetOutsideValue ( uint8_t OutsideValue ) { this->m_OutsideValue = OutsideValue;
return *
this; }
94 SITK_RETURN_SELF_TYPE_HEADER
SetNumberOfHistogramBins ( uint32_t NumberOfHistogramBins ) { this->m_NumberOfHistogramBins = NumberOfHistogramBins;
return *
this; }
103 SITK_RETURN_SELF_TYPE_HEADER
SetMaskOutput (
bool MaskOutput ) { this->m_MaskOutput = MaskOutput;
return *
this; }
106 SITK_RETURN_SELF_TYPE_HEADER
MaskOutputOn() {
return this->SetMaskOutput(
true); }
107 SITK_RETURN_SELF_TYPE_HEADER
MaskOutputOff() {
return this->SetMaskOutput(
false); }
116 SITK_RETURN_SELF_TYPE_HEADER
SetMaskValue ( uint8_t MaskValue ) { this->m_MaskValue = MaskValue;
return *
this; }
125 SITK_RETURN_SELF_TYPE_HEADER
SetReturnBinMidpoint (
bool ReturnBinMidpoint ) { this->m_ReturnBinMidpoint = ReturnBinMidpoint;
return *
this; }
145 std::string
GetName()
const {
return std::string (
"OtsuThresholdImageFilter"); }
148 std::string ToString()
const;
161 template <
class TImageType>
Image ExecuteInternal (
const Image * image,
const Image * maskImage );
169 uint8_t m_InsideValue{1u};
171 uint8_t m_OutsideValue{0u};
173 uint32_t m_NumberOfHistogramBins{128u};
175 bool m_MaskOutput{
true};
177 uint8_t m_MaskValue{255u};
179 bool m_ReturnBinMidpoint{
false};
182 double m_Threshold{0.0};
197 SITKBasicFilters_EXPORT Image OtsuThreshold (
const Image & image,
const Image & maskImage, uint8_t insideValue = 1u, uint8_t outsideValue = 0u, uint32_t numberOfHistogramBins = 128u,
bool maskOutput =
true, uint8_t maskValue = 255u,
bool returnBinMidpoint =
false );
198 SITKBasicFilters_EXPORT Image OtsuThreshold (
const Image & image, uint8_t insideValue = 1u, uint8_t outsideValue = 0u, uint32_t numberOfHistogramBins = 128u,
bool maskOutput =
true, uint8_t maskValue = 255u,
bool returnBinMidpoint =
false );