ITK  4.13.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 
149 
152 
154  typedef typename Superclass::ImageType ImageType;
161 
163  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
164 
170  virtual void CalculateAverageGradientMagnitudeSquared(ImageType *) = 0;
171 
175  void SetTimeStep(const TimeStepType & t)
176  {
177  m_TimeStep = t;
178  }
179 
180  const TimeStepType & GetTimeStep() const
181  {
182  return m_TimeStep;
183  }
184 
186  void SetConductanceParameter(const double & c)
187  {
188  m_ConductanceParameter = c;
189  }
190 
191  const double & GetConductanceParameter() const
192  {
193  return m_ConductanceParameter;
194  }
195 
197  const double & GetAverageGradientMagnitudeSquared() const
198  {
199  return m_AverageGradientMagnitudeSquared;
200  }
201 
202  void SetAverageGradientMagnitudeSquared(const double & c)
203  {
204  m_AverageGradientMagnitudeSquared = c;
205  }
206 
209  virtual TimeStepType ComputeGlobalTimeStep( void *itkNotUsed(GlobalData) ) const ITK_OVERRIDE
210  {
211  return this->GetTimeStep();
212  }
213 
216  virtual void * GetGlobalDataPointer() const ITK_OVERRIDE
217  {
218  return ITK_NULLPTR;
219  }
220 
222  virtual void ReleaseGlobalDataPointer( void *itkNotUsed(GlobalData) ) const ITK_OVERRIDE
223  {
224  /* do nothing */
225  }
226 
227 protected:
229  {
230  m_AverageGradientMagnitudeSquared = 0.0;
231  m_ConductanceParameter = 1.0; // default value
232  m_TimeStep = 0.125f; // default value
233  }
234 
236 
237  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE
238  {
239  Superclass::PrintSelf(os, indent);
240  os << indent << "TimeStep: " << m_TimeStep << std::endl;
241  os << indent << "ConductanceParameter: " << m_ConductanceParameter
242  << std::endl;
243  }
244 
245 private:
246  ITK_DISALLOW_COPY_AND_ASSIGN(AnisotropicDiffusionFunction);
247 
251 };
252 } // end namespace itk
253 
254 #endif
void PrintSelf(std::ostream &os, Indent indent) const override
ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
virtual TimeStepType ComputeGlobalTimeStep(void *) const override
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
virtual void * GetGlobalDataPointer() const override
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:62
FiniteDifferenceFunction< TImage > Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49
virtual void ReleaseGlobalDataPointer(void *) const override