ITK  5.3.0
Insight Toolkit
itkGPUGradientNDAnisotropicDiffusionFunction.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  * 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 itkGPUGradientNDAnisotropicDiffusionFunction_h
19 #define itkGPUGradientNDAnisotropicDiffusionFunction_h
20 
24 #include "itkDerivativeOperator.h"
25 
26 namespace itk
27 {
57 itkGPUKernelClassMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel);
58 
59 template <typename TImage>
62 {
63 public:
64  ITK_DISALLOW_COPY_AND_MOVE(GPUGradientNDAnisotropicDiffusionFunction);
65 
71 
73  itkNewMacro(Self);
74 
77 
79  using ImageType = typename Superclass::ImageType;
80  using PixelType = typename Superclass::PixelType;
86 
88 
90  static constexpr unsigned int ImageDimension = Superclass::ImageDimension;
91 
93  itkGetOpenCLSourceFromKernelMacro(GPUGradientNDAnisotropicDiffusionFunctionKernel);
94 
96  void
97  GPUComputeUpdate(const typename TImage::Pointer output, typename TImage::Pointer buffer, void * globalData) override;
98 
100  void
102  {
103  m_K = static_cast<PixelType>(this->GetAverageGradientMagnitudeSquared() * this->GetConductanceParameter() *
104  this->GetConductanceParameter() * -2.0f);
105  }
106 
107 protected:
109  ~GPUGradientNDAnisotropicDiffusionFunction() override = default;
110 
113 
115  std::slice x_slice[ImageDimension];
116  std::slice xa_slice[ImageDimension][ImageDimension];
117  std::slice xd_slice[ImageDimension][ImageDimension];
118 
121 
124 
126  NeighborhoodSizeValueType m_Stride[ImageDimension];
127 
128  static double m_MIN_NORM;
129 };
130 } // end namespace itk
131 
132 #ifndef ITK_MANUAL_INSTANTIATION
133 # include "itkGPUGradientNDAnisotropicDiffusionFunction.hxx"
134 #endif
135 
136 #endif
itk::GPUAnisotropicDiffusionFunction::TimeStepType
typename Superclass::TimeStepType TimeStepType
Definition: itkGPUAnisotropicDiffusionFunction.h:58
itkNeighborhoodAlgorithm.h
itkGPUScalarAnisotropicDiffusionFunction.h
itk::GPUScalarAnisotropicDiffusionFunction::PixelType
typename Superclass::PixelType PixelType
Definition: itkGPUScalarAnisotropicDiffusionFunction.h:56
itk::GPUGradientNDAnisotropicDiffusionFunction::m_Center
NeighborhoodSizeValueType m_Center
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:125
itk::GPUFiniteDifferenceFunction< TImage >::ImageType
typename Superclass::ImageType ImageType
Definition: itkGPUFiniteDifferenceFunction.h:63
itk::GPUGradientNDAnisotropicDiffusionFunction::InitializeIteration
void InitializeIteration() override
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:101
itk::GPUFiniteDifferenceFunction< TImage >::TimeStepType
typename Superclass::TimeStepType TimeStepType
Definition: itkGPUFiniteDifferenceFunction.h:71
itk::SmartPointer< Self >
itk::GPUAnisotropicDiffusionFunction::RadiusType
typename Superclass::RadiusType RadiusType
Definition: itkGPUAnisotropicDiffusionFunction.h:56
itk::GPUAnisotropicDiffusionFunction::NeighborhoodType
typename Superclass::NeighborhoodType NeighborhoodType
Definition: itkGPUAnisotropicDiffusionFunction.h:57
itk::GPUGradientNDAnisotropicDiffusionFunction::m_MIN_NORM
static double m_MIN_NORM
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:128
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::GPUFiniteDifferenceFunction< TImage >::NeighborhoodType
typename Superclass::NeighborhoodType NeighborhoodType
Definition: itkGPUFiniteDifferenceFunction.h:81
itk::GPUFiniteDifferenceFunction< TImage >
itk::GPUGradientNDAnisotropicDiffusionFunction::m_InnerProduct
NeighborhoodInnerProduct< ImageType > m_InnerProduct
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:112
itk::GPUGradientNDAnisotropicDiffusionFunction::PixelRealType
typename Superclass::PixelRealType PixelRealType
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:81
itk::GPUScalarAnisotropicDiffusionFunction
Definition: itkGPUScalarAnisotropicDiffusionFunction.h:38
itkNeighborhoodInnerProduct.h
itk::itkGPUKernelClassMacro
itkGPUKernelClassMacro(GPUImageOpsKernel)
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::DerivativeOperator< PixelType, Self::ImageDimension >
itk::GPUGradientNDAnisotropicDiffusionFunction::m_K
PixelType m_K
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:123
itk::GPUGradientNDAnisotropicDiffusionFunction
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:60
itk::GPUGradientNDAnisotropicDiffusionFunction::m_DerivativeOperator
DerivativeOperator< PixelType, Self::ImageDimension > m_DerivativeOperator
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:120
itk::GPUGradientNDAnisotropicDiffusionFunction::ImageType
typename Superclass::ImageType ImageType
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:79
itk::GPUGradientNDAnisotropicDiffusionFunction::PixelType
typename Superclass::PixelType PixelType
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:80
itk::NeighborhoodInnerProduct< ImageType >
itkDerivativeOperator.h
itk::GPUFiniteDifferenceFunction< TImage >::PixelRealType
typename Superclass::PixelRealType PixelRealType
Definition: itkGPUFiniteDifferenceFunction.h:65
itk::GPUFiniteDifferenceFunction< TImage >::FloatOffsetType
typename Superclass::FloatOffsetType FloatOffsetType
Definition: itkGPUFiniteDifferenceFunction.h:85
itk::GPUAnisotropicDiffusionFunction::FloatOffsetType
typename Superclass::FloatOffsetType FloatOffsetType
Definition: itkGPUAnisotropicDiffusionFunction.h:59
itk::SizeValueType
unsigned long SizeValueType
Definition: itkIntTypes.h:83
itk::GPUFiniteDifferenceFunction< TImage >::RadiusType
typename Superclass::RadiusType RadiusType
Definition: itkGPUFiniteDifferenceFunction.h:78
itk::GPUGradientNDAnisotropicDiffusionFunction::NeighborhoodSizeValueType
SizeValueType NeighborhoodSizeValueType
Definition: itkGPUGradientNDAnisotropicDiffusionFunction.h:87