18 #ifndef itkUnsharpMaskImageFilter_h
19 #define itkUnsharpMaskImageFilter_h
54 template<
typename TInputImage,
typename TOutputImage = TInputImage,
typename TInternalPrecision =
float >
74 itkStaticConstMacro(ImageDimension,
unsigned int,
75 TOutputImage::ImageDimension);
76 itkStaticConstMacro(InputImageDimension,
unsigned int,
77 TInputImage::ImageDimension);
105 #ifdef ITK_USE_CONCEPT_CHECKING
130 this->SetSigmas(sigmas);
135 itkSetMacro(Amount, TInternalPrecision);
136 itkGetConstMacro(Amount, TInternalPrecision);
141 itkSetMacro(Threshold, TInternalPrecision);
142 itkGetConstMacro(Threshold, TInternalPrecision);
147 itkSetMacro(Clamp,
bool);
148 itkGetConstMacro(Clamp,
bool);
149 itkBooleanMacro(Clamp);
163 virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
165 virtual
void VerifyPreconditions() ITK_OVERRIDE;
166 virtual
void GenerateData() ITK_OVERRIDE;
168 void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
174 TInternalPrecision m_Amount;
175 TInternalPrecision m_Threshold;
179 template<typename InPixelType, typename FunctorRealType = TInternalPrecision, typename OutPixelType = InPixelType>
197 m_Threshold(threshold),
200 assert(m_Threshold >= 0.0);
212 return !(*
this == other);
215 inline OutPixelType
operator()(
const InPixelType & v,
const FunctorRealType & s)
const
217 FunctorRealType diff = v - s;
218 FunctorRealType result;
219 if (diff > m_Threshold)
221 result = v + (diff - m_Threshold)*m_Amount;
223 else if (-diff > m_Threshold)
225 result = v + (diff + m_Threshold)*m_Amount;
244 return static_cast<OutPixelType
>(result);
250 #ifndef ITK_MANUAL_INSTANTIATION
251 #include "itkUnsharpMaskImageFilter.hxx"
bool operator!=(const ImageRegionCopier< D1, D2 > &c1, const ImageRegionCopier< D1, D2 > &c2)
TOutputImage::PixelType OutputPixelType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
TInputImage InputImageType
OutPixelType operator()(const InPixelType &v, const FunctorRealType &s) const
SmoothingRecursiveGaussianImageFilter< TInputImage, Image< TInternalPrecision, TOutputImage::ImageDimension > > GaussianType
UnsharpMaskImageFilter Self
TOutputImage OutputImageType
Base class for all process objects that output image data.
void Fill(const ValueType &)
bool operator==(const UnsharpMaskingFunctor &other)
SmartPointer< const Self > ConstPointer
TOutputImage::RegionType OutputImageRegionType
static ITK_CONSTEXPR_FUNC T max(const T &)
void SetSigma(const typename SigmaArrayType::ValueType sigma)
FunctorRealType m_Threshold
TInputImage::InternalPixelType InputInternalPixelType
UnsharpMaskingFunctor(FunctorRealType amount, FunctorRealType threshold, bool clamp)
TInputImage::PixelType InputPixelType
Computes the smoothing of an image by convolution with the Gaussian kernels implemented as IIR filter...
virtual ~UnsharpMaskImageFilter() override
TOutputImage::InternalPixelType OutputInternalPixelType
static ITK_CONSTEXPR_FUNC T NonpositiveMin()
TInputImage::RegionType InputImageRegionType
InputImageType::Pointer InputImagePointer
Base class for filters that take an image as input and produce an image as output.
TInternalPrecision InternalPrecisionType
SmartPointer< Self > Pointer
Control indentation during Print() invocation.
Define additional traits for native types such as int or float.
#define itkConceptMacro(name, concept)
Templated n-dimensional image class.
GaussianType::SigmaArrayType SigmaArrayType