ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkGPUAnisotropicDiffusionFunction.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 itkGPUAnisotropicDiffusionFunction_h
19 #define itkGPUAnisotropicDiffusionFunction_h
20 
22 
23 namespace itk
24 {
37 template< typename TImage >
39  public GPUFiniteDifferenceFunction< TImage >
40 {
41 public:
42 
48 
51 
53  typedef typename Superclass::ImageType ImageType;
54  typedef typename Superclass::PixelType PixelType;
60 
62  itkStaticConstMacro(ImageDimension, unsigned int, Superclass::ImageDimension);
63 
70 
74  void SetTimeStep(const TimeStepType & t)
75  {
76  m_TimeStep = t;
77  }
78 
79  const TimeStepType & GetTimeStep() const
80  {
81  return m_TimeStep;
82  }
83 
85  void SetConductanceParameter(const double & c)
86  {
88  }
89 
90  const double & GetConductanceParameter() const
91  {
93  }
94 
96  const double & GetAverageGradientMagnitudeSquared() const
97  {
99  }
100 
101  void SetAverageGradientMagnitudeSquared(const double & c)
102  {
104  }
105 
108  virtual TimeStepType ComputeGlobalTimeStep( void *itkNotUsed(GlobalData) ) const ITK_OVERRIDE
109  {
110  return this->GetTimeStep();
111  }
112 
115  virtual void * GetGlobalDataPointer() const ITK_OVERRIDE
116  {
117  return ITK_NULLPTR;
118  }
119 
121  virtual void ReleaseGlobalDataPointer( void *itkNotUsed(GlobalData) ) const ITK_OVERRIDE
122  {
123  /* do nothing */
124  }
125 
126 protected:
128  {
130  m_ConductanceParameter = 1.0; // default value
131  m_TimeStep = 0.125f; // default value
132  }
133 
135 
136  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE
137  {
138  Superclass::PrintSelf(os, indent);
139  os << indent << "TimeStep: " << m_TimeStep << std::endl;
140  os << indent << "ConductanceParameter: " << m_ConductanceParameter
141  << std::endl;
142  }
143 
144  // GPU buffer for Computing Average Squared Gradient Magnitude
147 
148  // GPU Kernel Handles
150 
151 private:
152  ITK_DISALLOW_COPY_AND_ASSIGN(GPUAnisotropicDiffusionFunction);
153 
157 };
158 } // end namespace itk
159 
160 #endif
virtual void ReleaseGlobalDataPointer(void *) const override
GPUFiniteDifferenceFunction< TImage > Superclass
virtual void PrintSelf(std::ostream &os, Indent indent) const override
virtual void GPUCalculateAverageGradientMagnitudeSquared(ImageType *)=0
virtual TimeStepType ComputeGlobalTimeStep(void *) const override
GPUKernelManager::Pointer m_AnisotropicDiffusionFunctionGPUKernelManager
Control indentation during Print() invocation.
Definition: itkIndent.h:49
void PrintSelf(std::ostream &os, Indent indent) const override