18#ifndef itkUnsharpMaskImageFilter_h
19#define itkUnsharpMaskImageFilter_h
54template <
typename TInputImage,
typename TOutputImage = TInputImage,
typename TInternalPrecision =
float>
75 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
76 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
103#ifdef ITK_USE_CONCEPT_CHECKING
122 SetSigma(
const typename SigmaArrayType::ValueType sigma)
126 this->SetSigmas(sigmas);
131 itkSetMacro(Amount, TInternalPrecision);
132 itkGetConstMacro(Amount, TInternalPrecision);
137 itkSetMacro(Threshold, TInternalPrecision);
138 itkGetConstMacro(Threshold, TInternalPrecision);
143 itkSetMacro(Clamp,
bool);
144 itkGetConstMacro(Clamp,
bool);
145 itkBooleanMacro(Clamp);
165 GenerateData() override;
168 PrintSelf(
std::ostream & os,
Indent indent) const override;
172 TInternalPrecision m_Amount{};
173 TInternalPrecision m_Threshold{};
177 template <
typename InPixelType,
typename FunctorRealType = TInternalPrecision,
typename OutPixelType = InPixelType>
183 bool m_Clamp{
false };
194 , m_Threshold(threshold)
197 assert(m_Threshold >= 0.0);
209 operator()(
const InPixelType & v,
const FunctorRealType & s)
const
211 FunctorRealType diff = v - s;
212 FunctorRealType result;
213 if (diff > m_Threshold)
215 result = v + (diff - m_Threshold) * m_Amount;
217 else if (-diff > m_Threshold)
219 result = v + (diff + m_Threshold) * m_Amount;
238 return static_cast<OutPixelType
>(result);
244#ifndef ITK_MANUAL_INSTANTIATION
245# include "itkUnsharpMaskImageFilter.hxx"
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Define additional traits for native types such as int or float.
static constexpr T NonpositiveMin()
static constexpr T max(const T &)
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
OutPixelType operator()(const InPixelType &v, const FunctorRealType &s) const
FunctorRealType m_Threshold
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(UnsharpMaskingFunctor)
UnsharpMaskingFunctor(FunctorRealType amount, FunctorRealType threshold, bool clamp)
bool operator==(const UnsharpMaskingFunctor &other) const
typename GaussianType::SigmaArrayType SigmaArrayType
void VerifyPreconditions() ITKv5_CONST override
Verifies that the process object has been configured correctly, that all required inputs are set,...
typename TOutputImage::PixelType OutputPixelType
~UnsharpMaskImageFilter() override=default
typename TInputImage::InternalPixelType InputInternalPixelType
typename TInputImage::RegionType InputImageRegionType
TInternalPrecision InternalPrecisionType
void SetSigma(const typename SigmaArrayType::ValueType sigma)
typename InputImageType::Pointer InputImagePointer
typename TInputImage::PixelType InputPixelType
typename TOutputImage::InternalPixelType OutputInternalPixelType
TOutputImage OutputImageType
void GenerateInputRequestedRegion() override
typename TOutputImage::RegionType OutputImageRegionType
TInputImage InputImageType
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
ImageBaseType::RegionType RegionType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....