ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkAnisotropicDiffusionFunction.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 itkAnisotropicDiffusionFunction_h
19 #define itkAnisotropicDiffusionFunction_h
20 
22 
23 namespace itk
24 {
138 template< typename TImage >
139 class ITK_TEMPLATE_EXPORT AnisotropicDiffusionFunction:
140  public FiniteDifferenceFunction< TImage >
141 {
142 public:
143  ITK_DISALLOW_COPY_AND_ASSIGN(AnisotropicDiffusionFunction);
145 
151 
154 
163 
165  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
166 
172  virtual void CalculateAverageGradientMagnitudeSquared(ImageType *) = 0;
173 
177  void SetTimeStep(const TimeStepType & t)
178  {
179  m_TimeStep = t;
180  }
181 
182  const TimeStepType & GetTimeStep() const
183  {
184  return m_TimeStep;
185  }
186 
188  void SetConductanceParameter(const double & c)
189  {
190  m_ConductanceParameter = c;
191  }
192 
193  const double & GetConductanceParameter() const
194  {
195  return m_ConductanceParameter;
196  }
197 
199  const double & GetAverageGradientMagnitudeSquared() const
200  {
201  return m_AverageGradientMagnitudeSquared;
202  }
203 
204  void SetAverageGradientMagnitudeSquared(const double & c)
205  {
206  m_AverageGradientMagnitudeSquared = c;
207  }
208 
211  TimeStepType ComputeGlobalTimeStep( void *itkNotUsed(GlobalData) ) const override
212  {
213  return this->GetTimeStep();
214  }
215 
218  void * GetGlobalDataPointer() const override
219  {
220  return nullptr;
221  }
222 
224  void ReleaseGlobalDataPointer( void *itkNotUsed(GlobalData) ) const override
225  {
226  /* do nothing */
227  }
228 
229 protected:
231  {
232  m_AverageGradientMagnitudeSquared = 0.0;
233  m_ConductanceParameter = 1.0; // default value
234  m_TimeStep = 0.125f; // default value
235  }
236 
237  ~AnisotropicDiffusionFunction() override = default;
238 
239  void PrintSelf(std::ostream & os, Indent indent) const override
240  {
241  Superclass::PrintSelf(os, indent);
242  os << indent << "TimeStep: " << m_TimeStep << std::endl;
243  os << indent << "ConductanceParameter: " << m_ConductanceParameter
244  << std::endl;
245  }
246 
247 private:
251 };
252 } // end namespace itk
253 
254 #endif
Light weight base class for most itk classes.
void PrintSelf(std::ostream &os, Indent indent) const override
TimeStepType ComputeGlobalTimeStep(void *) const override
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
typename Superclass::FloatOffsetType FloatOffsetType
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
typename Superclass::PixelRealType PixelrealType
void ReleaseGlobalDataPointer(void *) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::NeighborhoodType NeighborhoodType
typename Superclass::TimeStepType TimeStepType