19#ifndef itkOtsuThresholdImageFilter_h
20#define itkOtsuThresholdImageFilter_h
54template <
typename TInputImage,
typename TOutputImage,
typename TMaskImage = TOutputImage>
96 using typename Superclass::HistogramType;
100 static constexpr unsigned int InputImageDimension = InputImageType::ImageDimension;
101 static constexpr unsigned int OutputImageDimension = OutputImageType::ImageDimension;
105 itkSetMacro(ReturnBinMidpoint,
bool);
106 itkGetConstReferenceMacro(ReturnBinMidpoint,
bool);
107 itkBooleanMacro(ReturnBinMidpoint);
117 auto calc =
static_cast<CalculatorType *
>(this->GetModifiableCalculator());
119 this->Superclass::GenerateData();
125 Superclass::VerifyPreconditions();
126 if (
dynamic_cast<const CalculatorType *
>(Superclass::GetCalculator()) ==
nullptr)
128 itkExceptionMacro(
"Invalid OtsuThresholdCalculator.");
133 bool m_ReturnBinMidpoint{
false };
Threshold an image using a HistogramThresholdCalculator.
Base class for all process objects that output image data.
typename OutputImageType::RegionType OutputImageRegionType
TOutputImage OutputImageType
typename OutputImageType::Pointer OutputImagePointer
TInputImage InputImageType
typename InputImageType::Pointer InputImagePointer
typename InputImageType::RegionType InputImageRegionType
Computes the Otsu's threshold for an image.
virtual void SetReturnBinMidpoint(bool _arg)
Threshold an image using the Otsu Threshold.
typename OutputImageType::IndexType OutputIndexType
typename OutputImageType::SizeType OutputSizeType
OtsuThresholdImageFilter()
typename OutputImageType::PixelType OutputPixelType
~OtsuThresholdImageFilter() override=default
typename MaskImageType::SizeType MaskSizeType
typename MaskImageType::RegionType MaskImageRegionType
typename InputImageType::PixelType InputPixelType
typename MaskImageType::PixelType MaskPixelType
typename InputImageType::IndexType InputIndexType
typename MaskImageType::IndexType MaskIndexType
void VerifyPreconditions() const override
Verifies that the process object has been configured correctly, that all required inputs are set,...
typename InputImageType::SizeType InputSizeType
void GenerateData() override
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SmartPointer< Self > Pointer
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....