ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkMorphologicalSharpeningImageFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkMorphologicalSharpeningImageFilter_h
19#define itkMorphologicalSharpeningImageFilter_h
20
22// #include "itkProgressReporter.h"
23#include "itkCastImageFilter.h"
27
28namespace itk
29{
65
66template <typename TInputImage, typename TOutputImage = TInputImage>
67class ITK_TEMPLATE_EXPORT MorphologicalSharpeningImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
68{
69public:
70 ITK_DISALLOW_COPY_AND_MOVE(MorphologicalSharpeningImageFilter);
71
77
79 itkNewMacro(Self);
80
82 itkOverrideGetNameOfClassMacro(MorphologicalSharpeningImageFilter);
83
85 using InputImageType = TInputImage;
86 using OutputImageType = TOutputImage;
87 using InputPixelType = typename TInputImage::PixelType;
90 using OutputPixelType = typename TOutputImage::PixelType;
91
93 using InputImagePointer = typename TInputImage::Pointer;
94 using InputImageConstPointer = typename TInputImage::ConstPointer;
95
97 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
98 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
99 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
100
103
104 itkSetMacro(Iterations, int);
105 itkGetConstReferenceMacro(Iterations, int);
106
107 void
109 {
110 m_Erode->SetScale(scale);
111 m_Dilate->SetScale(scale);
112 }
113
114 void
116 {
117 m_Erode->SetScale(scale);
118 m_Dilate->SetScale(scale);
119 }
120
121 void
123 {
124 m_Erode->SetUseImageSpacing(uis);
125 m_Dilate->SetUseImageSpacing(uis);
126 }
127
128 // need to include the Get methods
129 const RadiusType &
131 {
132 return m_Erode->GetScale();
133 }
134
135 const bool &
137 {
138 return m_Erode->GetUseImageSpacing();
139 }
140
141 static_assert(InputImageDimension == OutputImageDimension);
142
144
145protected:
148 void
149 PrintSelf(std::ostream & os, Indent indent) const override;
150
152 void
153 GenerateData() override;
154
155 // do everything in the output image type, which should have high precision
159
162
163private:
165
166 typename ErodeType::Pointer m_Erode;
167 typename DilateType::Pointer m_Dilate;
168 typename CastType::Pointer m_Cast;
169 typename SharpenOpType::Pointer m_SharpenOp;
170};
171} // namespace itk
172#ifndef ITK_MANUAL_INSTANTIATION
173# include "itkMorphologicalSharpeningImageFilter.hxx"
174#endif
175
176#endif
Casts input pixels to output pixel type.
Simulate a standard C array with copy semantics.
Control indentation during Print() invocation.
Definition itkIndent.h:53
typename itk::SharpenOpImageFilter< OutputImageType, OutputImageType, OutputImageType, OutputImageType > SharpenOpType
typename itk::CastImageFilter< InputImageType, OutputImageType > CastType
void PrintSelf(std::ostream &os, Indent indent) const override
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
typename NumericTraits< InputPixelType >::RealType RealType
typename NumericTraits< InputPixelType >::ScalarRealType ScalarRealType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
typename itk::ParabolicErodeImageFilter< OutputImageType, OutputImageType > ErodeType
~MorphologicalSharpeningImageFilter() override=default
typename itk::ParabolicDilateImageFilter< OutputImageType, OutputImageType > DilateType
Class for morphological dilation operations with parabolic structuring elements.
Class for morphological erosion operations with parabolic structuring elements.
Implements the sharpening operation. The inputs are the dilated, eroded and original images.
Implements transparent reference counting.
#define itkConceptMacro(name, conceptType)
Compile-time check that a template argument satisfies an itk::Concept.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)