ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMinMaxCurvatureFlowFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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  * http://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 itkMinMaxCurvatureFlowFunction_h
19 #define itkMinMaxCurvatureFlowFunction_h
20 
23 
24 namespace itk
25 {
41 template< typename TImage >
42 class ITK_TEMPLATE_EXPORT MinMaxCurvatureFlowFunction:
43  public CurvatureFlowFunction< TImage >
44 {
45 public:
46  ITK_DISALLOW_COPY_AND_ASSIGN(MinMaxCurvatureFlowFunction);
47 
53 
55  itkNewMacro(Self);
56 
58  itkTypeMacro(MinMaxCurvatureFlowFunction,
60 
62  using ImageType = typename Superclass::ImageType;
63  using PixelType = typename Superclass::PixelType;
67 
69  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
70 
73 
75  void SetStencilRadius(const RadiusValueType radius);
76 
78  { return m_StencilRadius; }
79 
82  { return GetRadiusValueType(); }
83 
86  PixelType ComputeUpdate(const NeighborhoodType & neighborhood,
87  void *globalData,
88  const FloatOffsetType & offset = FloatOffsetType(0.0)
89  ) override;
90 
91 protected:
93  ~MinMaxCurvatureFlowFunction() override = default;
94 
97 
100  void InitializeStencilOperator();
101 
102 private:
104 
105  // To control overloaded versions of ComputeThreshold
106  struct DispatchBase {};
107  template< signed int VDimension >
108  struct Dispatch: public DispatchBase {};
109 
112  PixelType ComputeThreshold(const Dispatch< 2 > &,
113  const NeighborhoodType & neighborhood) const;
114 
115  PixelType ComputeThreshold(const Dispatch< 3 > &,
116  const NeighborhoodType & neighborhood) const;
117 
118  PixelType ComputeThreshold(const DispatchBase &,
119  const NeighborhoodType & neighborhood) const;
120 };
121 } // end namespace itk
122 
123 #ifndef ITK_MANUAL_INSTANTIATION
124 #include "itkMinMaxCurvatureFlowFunction.hxx"
125 #endif
126 
127 #endif
Light weight base class for most itk classes.
const RadiusValueType & GetStencilRadius() const
typename Superclass::NeighborhoodType NeighborhoodType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename Superclass::ImageType ImageType
typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
typename Superclass::RadiusType RadiusType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
typename Superclass::FloatOffsetType FloatOffsetType
typename Superclass::PixelType PixelType
This class encapsulate the finite difference equation which drives a curvature flow denoising algorit...
typename RadiusType::SizeValueType RadiusValueType
const RadiusValueType & GetRadiusValueType() const