ITK  5.4.0
Insight Toolkit
itkCurvatureFlowImageFilter.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 itkCurvatureFlowImageFilter_h
19 #define itkCurvatureFlowImageFilter_h
20 
23 
24 namespace itk
25 {
95 template <typename TInputImage, typename TOutputImage>
96 class ITK_TEMPLATE_EXPORT CurvatureFlowImageFilter : public DenseFiniteDifferenceImageFilter<TInputImage, TOutputImage>
97 {
98 public:
99  ITK_DISALLOW_COPY_AND_MOVE(CurvatureFlowImageFilter);
107 
109  itkNewMacro(Self);
110 
112  itkOverrideGetNameOfClassMacro(CurvatureFlowImageFilter);
113 
115  using typename Superclass::InputImageType;
116 
118  using typename Superclass::OutputImageType;
120 
122  using typename Superclass::FiniteDifferenceFunctionType;
123 
126 
129  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
130 
133  using typename Superclass::PixelType;
134 
136  using typename Superclass::TimeStepType;
137 
139  itkSetMacro(TimeStep, TimeStepType);
140 
142  itkGetConstMacro(TimeStep, TimeStepType);
143 
144 #ifdef ITK_USE_CONCEPT_CHECKING
145  // Begin concept checking
146  itkConceptMacro(DoubleConvertibleToOutputCheck, (Concept::Convertible<double, PixelType>));
147  itkConceptMacro(OutputConvertibleToDoubleCheck, (Concept::Convertible<PixelType, double>));
148  itkConceptMacro(OutputDivisionOperatorsCheck, (Concept::DivisionOperators<PixelType>));
149  itkConceptMacro(DoubleOutputMultiplyOperatorCheck, (Concept::MultiplyOperator<double, PixelType, PixelType>));
152  itkConceptMacro(OutputDoubleAdditiveOperatorsCheck, (Concept::AdditiveOperators<PixelType, double>));
153  // End concept checking
154 #endif
155 
156 protected:
158  ~CurvatureFlowImageFilter() override = default;
159  void
160  PrintSelf(std::ostream & os, Indent indent) const override;
161 
164  bool
165  Halt() override
166  {
167  if (this->GetElapsedIterations() == this->GetNumberOfIterations())
168  {
169  return true;
170  }
171  else
172  {
173  return false;
174  }
175  }
180  void
181  InitializeIteration() override;
182 
186  void
187  EnlargeOutputRequestedRegion(DataObject *) override;
188 
192  void
193  GenerateInputRequestedRegion() override;
194 
195 private:
196  TimeStepType m_TimeStep{};
197 };
198 } // namespace itk
199 
200 #ifndef ITK_MANUAL_INSTANTIATION
201 # include "itkCurvatureFlowImageFilter.hxx"
202 #endif
203 
204 #endif
itk::CurvatureFlowImageFilter
Denoise an image using curvature driven flow.
Definition: itkCurvatureFlowImageFilter.h:96
Pointer
SmartPointer< Self > Pointer
Definition: itkAddImageFilter.h:93
itk::ImageSource::OutputImagePointer
typename OutputImageType::Pointer OutputImagePointer
Definition: itkImageSource.h:91
itk::FiniteDifferenceImageFilter::TimeStepType
typename FiniteDifferenceFunctionType::TimeStepType TimeStepType
Definition: itkFiniteDifferenceImageFilter.h:167
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::CurvatureFlowImageFilter::Halt
bool Halt() override
Definition: itkCurvatureFlowImageFilter.h:165
itk::DenseFiniteDifferenceImageFilter
Definition: itkDenseFiniteDifferenceImageFilter.h:70
itk::ImageSource
Base class for all process objects that output image data.
Definition: itkImageSource.h:67
itkCurvatureFlowFunction.h
itk::CurvatureFlowFunction
This class encapsulate the finite difference equation which drives a curvature flow denoising algorit...
Definition: itkCurvatureFlowFunction.h:44
itk::Concept::DivisionOperators
Definition: itkConceptChecking.h:473
itk::Concept::MultiplyOperator
Definition: itkConceptChecking.h:419
itkDenseFiniteDifferenceImageFilter.h
itk::Concept::AdditiveOperators
Definition: itkConceptChecking.h:358
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ProcessObject
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
Definition: itkProcessObject.h:139
itk::Concept::Convertible
Definition: itkConceptChecking.h:216
itk::Concept::LessThanComparable
Definition: itkConceptChecking.h:262
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293