ITK  5.4.0
Insight Toolkit
itkAnisotropicDiffusionFunction.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 itkAnisotropicDiffusionFunction_h
19#define itkAnisotropicDiffusionFunction_h
20
22
23namespace itk
24{
138template <typename TImage>
139class ITK_TEMPLATE_EXPORT AnisotropicDiffusionFunction : public FiniteDifferenceFunction<TImage>
140{
141public:
142 ITK_DISALLOW_COPY_AND_MOVE(AnisotropicDiffusionFunction);
150
152 itkOverrideGetNameOfClassMacro(AnisotropicDiffusionFunction);
153
155 using typename Superclass::ImageType;
156 using typename Superclass::PixelType;
158 using typename Superclass::RadiusType;
159 using typename Superclass::NeighborhoodType;
160 using typename Superclass::TimeStepType;
161 using typename Superclass::FloatOffsetType;
162
164 static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
165
171 virtual void
173
177 void
179 {
180 m_TimeStep = t;
181 }
182
183 const TimeStepType &
185 {
186 return m_TimeStep;
187 }
188
190 void
192 {
193 m_ConductanceParameter = c;
194 }
195
196 const double &
198 {
199 return m_ConductanceParameter;
200 }
201
203 const double &
205 {
206 return m_AverageGradientMagnitudeSquared;
207 }
208
209 void
211 {
212 m_AverageGradientMagnitudeSquared = c;
213 }
214
217 TimeStepType
218 ComputeGlobalTimeStep(void * itkNotUsed(GlobalData)) const override
219 {
220 return this->GetTimeStep();
221 }
222
225 void *
226 GetGlobalDataPointer() const override
227 {
228 return nullptr;
229 }
230
232 void
233 ReleaseGlobalDataPointer(void * itkNotUsed(GlobalData)) const override
234 {
235 /* do nothing */
236 }
237
238protected:
240 {
241 m_AverageGradientMagnitudeSquared = 0.0;
242 m_ConductanceParameter = 1.0; // default value
243 m_TimeStep = 0.125f; // default value
244 }
245
246 ~AnisotropicDiffusionFunction() override = default;
247
248 void
249 PrintSelf(std::ostream & os, Indent indent) const override
250 {
251 Superclass::PrintSelf(os, indent);
252 os << indent << "TimeStep: " << m_TimeStep << std::endl;
253 os << indent << "ConductanceParameter: " << m_ConductanceParameter << std::endl;
254 }
255
256private:
257 double m_AverageGradientMagnitudeSquared{};
258 double m_ConductanceParameter{};
259 TimeStepType m_TimeStep{};
260};
261} // end namespace itk
262
263#endif
TimeStepType ComputeGlobalTimeStep(void *) const override
void ReleaseGlobalDataPointer(void *) const override
typename Superclass::PixelRealType PixelrealType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void CalculateAverageGradientMagnitudeSquared(ImageType *)=0
~AnisotropicDiffusionFunction() override=default
Const version of NeighborhoodIterator, defining iteration of a local N-dimensional neighborhood of pi...
typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
A templated class holding a n-Dimensional vector.
Definition: itkVector.h:63
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....