ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::GPUGradientNDAnisotropicDiffusionFunction< TImage > Class Template Reference

#include <itkGPUGradientNDAnisotropicDiffusionFunction.h>

Detailed Description

template<typename TImage>
class itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >

This class implements an N-dimensional version of the classic Perona-Malik anisotropic diffusion equation [86] for scalar-valued images on the GPU. See itkAnisotropicDiffusionFunction for an overview of the anisotropic diffusion framework and equation.

The conductance term for this implementation is chosen as a function of the gradient magnitude of the image at each point, reducing the strength of diffusion at edge pixels.

\[C(\mathbf{x}) = e^{-(\frac{\parallel \nabla U(\mathbf{x}) \parallel}{K})^2}\]

.

The numerical implementation of this equation is similar to that described in the Perona-Malik paper below, but uses a more robust technique for gradient magnitude estimation and has been generalized to N-dimensions.

Definition at line 55 of file itkGPUGradientNDAnisotropicDiffusionFunction.h.

+ Inheritance diagram for itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >:
+ Collaboration diagram for itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >:

Public Types

using ConstPointer = SmartPointer<const Self>
 
using NeighborhoodSizeValueType = SizeValueType
 
using Pointer = SmartPointer<Self>
 
using Self = GPUGradientNDAnisotropicDiffusionFunction
 
using Superclass = GPUScalarAnisotropicDiffusionFunction<TImage>
 
- Public Types inherited from itk::GPUScalarAnisotropicDiffusionFunction< TImage >
using ConstPointer = SmartPointer<const Self>
 
typedef TImage ImageType
 
typedef ConstNeighborhoodIterator< TImage, DefaultBoundaryConditionTypeNeighborhoodType
 
typedef typename ImageType::PixelType PixelType
 
using Pointer = SmartPointer<Self>
 
typedef typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
 
using Self = GPUScalarAnisotropicDiffusionFunction
 
using Superclass = GPUAnisotropicDiffusionFunction<TImage>
 
typedef double TimeStepType
 
- Public Types inherited from itk::GPUAnisotropicDiffusionFunction< TImage >
using ConstPointer = SmartPointer<const Self>
 
typedef Vector< float, Self::ImageDimensionFloatOffsetType
 
typedef TImage ImageType
 
typedef ConstNeighborhoodIterator< TImage, DefaultBoundaryConditionTypeNeighborhoodType
 
using PixelrealType = typename Superclass::PixelRealType
 
typedef typename ImageType::PixelType PixelType
 
using Pointer = SmartPointer<Self>
 
typedef typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
 
using Self = GPUAnisotropicDiffusionFunction
 
using Superclass = GPUFiniteDifferenceFunction<TImage>
 
typedef double TimeStepType
 
- Public Types inherited from itk::GPUFiniteDifferenceFunction< TImage >
using ConstPointer
 
typedef ZeroFluxNeumannBoundaryCondition< ImageTypeDefaultBoundaryConditionType
 
using DefaultBoundaryConditionType
 
using DifferenceFunctionType
 
typedef Vector< float, Self::ImageDimensionFloatOffsetType
 
using FloatOffsetType
 
typedef TImage ImageType
 
using ImageType
 
typedef ConstNeighborhoodIterator< TImage, DefaultBoundaryConditionTypeNeighborhoodType
 
using NeighborhoodType
 
typedef double PixelRealType
 
using PixelRealType
 
typedef typename ImageType::PixelType PixelType
 
using PixelType
 
using Pointer
 
typedef typename ConstNeighborhoodIterator< TImage >::RadiusType RadiusType
 
using RadiusType
 
using Self
 
using Superclass
 
typedef double TimeStepType
 
using TimeStepType
 
- Public Types inherited from itk::FiniteDifferenceFunction< TImage >
using ConstPointer
 
using DefaultBoundaryConditionType
 
using FloatOffsetType
 
using ImageType
 
using NeighborhoodScalesType
 
using NeighborhoodType
 
using PixelRealType
 
using PixelType
 
using Pointer
 
using RadiusType
 
using Self
 
using Superclass
 
using TimeStepType
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer<const Self>
 
using Pointer = SmartPointer<Self>
 
using Self = LightObject
 

Public Member Functions

virtual::itk::LightObject::Pointer CreateAnother () const
 
const char * GetNameOfClass () const override
 
void GPUComputeUpdate (const typename TImage::Pointer output, typename TImage::Pointer buffer, void *globalData) override
 
void InitializeIteration () override
 
 itkGetOpenCLSourceFromKernelMacro (GPUGradientNDAnisotropicDiffusionFunctionKernel)
 
- Public Member Functions inherited from itk::GPUScalarAnisotropicDiffusionFunction< TImage >
const char * GetNameOfClass () const override
 
void GPUCalculateAverageGradientMagnitudeSquared (TImage *) override
 
 itkGetOpenCLSourceFromKernelMacro (GPUScalarAnisotropicDiffusionFunctionKernel)
 
- Public Member Functions inherited from itk::GPUAnisotropicDiffusionFunction< TImage >
TimeStepType ComputeGlobalTimeStep (void *GlobalData) const override
 
const double & GetAverageGradientMagnitudeSquared () const
 
const double & GetConductanceParameter () const
 
void * GetGlobalDataPointer () const override
 
const TimeStepTypeGetTimeStep () const
 
void ReleaseGlobalDataPointer (void *GlobalData) const override
 
void SetAverageGradientMagnitudeSquared (const double c)
 
void SetConductanceParameter (const double c)
 
void SetTimeStep (const TimeStepType &t)
 
- Public Member Functions inherited from itk::GPUFiniteDifferenceFunction< TImage >
virtual void GPUAllocateMetricData (unsigned int numPixels)
 
virtual void GPUAllocateMetricData (unsigned int numPixels)
 
virtual void GPUReleaseMetricData ()
 
virtual void GPUReleaseMetricData ()
 
PixelType ComputeUpdate (const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
 
PixelType ComputeUpdate (const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0)) override
 
- Public Member Functions inherited from itk::FiniteDifferenceFunction< TImage >
const NeighborhoodScalesType ComputeNeighborhoodScales () const
 
const NeighborhoodScalesType ComputeNeighborhoodScales () const
 
const RadiusTypeGetRadius () const
 
const RadiusTypeGetRadius () const
 
void GetScaleCoefficients (PixelRealType vals[ImageDimension]) const
 
void GetScaleCoefficients (PixelRealType vals[ImageDimension]) const
 
void SetRadius (const RadiusType &r)
 
void SetRadius (const RadiusType &r)
 
void SetScaleCoefficients (const PixelRealType vals[ImageDimension])
 
void SetScaleCoefficients (const PixelRealType vals[ImageDimension])
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 
virtual void Register () const
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const noexcept
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Static Public Attributes

static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::GPUScalarAnisotropicDiffusionFunction< TImage >
static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::GPUAnisotropicDiffusionFunction< TImage >
static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::GPUFiniteDifferenceFunction< TImage >
static constexpr unsigned int ImageDimension
 
static constexpr unsigned int ImageDimension
 
- Static Public Attributes inherited from itk::FiniteDifferenceFunction< TImage >
static constexpr unsigned int ImageDimension
 
static constexpr unsigned int ImageDimension
 

Protected Member Functions

 GPUGradientNDAnisotropicDiffusionFunction ()
 
 ~GPUGradientNDAnisotropicDiffusionFunction () override=default
 
- Protected Member Functions inherited from itk::GPUScalarAnisotropicDiffusionFunction< TImage >
 GPUScalarAnisotropicDiffusionFunction ()
 
 ~GPUScalarAnisotropicDiffusionFunction () override=default
 
- Protected Member Functions inherited from itk::GPUAnisotropicDiffusionFunction< TImage >
 GPUAnisotropicDiffusionFunction ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~GPUAnisotropicDiffusionFunction () override=default
 
- Protected Member Functions inherited from itk::GPUFiniteDifferenceFunction< TImage >
 GPUFiniteDifferenceFunction ()
 
 GPUFiniteDifferenceFunction ()
 
 ~GPUFiniteDifferenceFunction () override=default
 
 ~GPUFiniteDifferenceFunction () override=default
 
- Protected Member Functions inherited from itk::FiniteDifferenceFunction< TImage >
 FiniteDifferenceFunction ()
 
 FiniteDifferenceFunction ()
 
 ~FiniteDifferenceFunction () override=default
 
 ~FiniteDifferenceFunction () override=default
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Protected Attributes

NeighborhoodSizeValueType m_Center {}
 
DerivativeOperator< PixelType, Self::ImageDimensionm_DerivativeOperator {}
 
NeighborhoodInnerProduct< ImageTypem_InnerProduct {}
 
PixelType m_K {}
 
NeighborhoodSizeValueType m_Stride [ImageDimension] {}
 
std::slice x_slice [ImageDimension]
 
std::slice xa_slice [ImageDimension][ImageDimension]
 
std::slice xd_slice [ImageDimension][ImageDimension]
 
- Protected Attributes inherited from itk::GPUAnisotropicDiffusionFunction< TImage >
GPUDataManager::Pointer m_AnisotropicDiffusionFunctionGPUBuffer {}
 
GPUKernelManager::Pointer m_AnisotropicDiffusionFunctionGPUKernelManager {}
 
int m_AverageGradientMagnitudeSquaredGPUKernelHandle {}
 
- Protected Attributes inherited from itk::GPUFiniteDifferenceFunction< TImage >
int m_ComputeUpdateGPUKernelHandle
 
int m_ComputeUpdateGPUKernelHandle
 
GPUKernelManager::Pointer m_GPUKernelManager
 
GPUKernelManager::Pointer m_GPUKernelManager
 
- Protected Attributes inherited from itk::FiniteDifferenceFunction< TImage >
RadiusType m_Radius
 
RadiusType m_Radius
 
PixelRealType m_ScaleCoefficients [ImageDimension]
 
PixelRealType m_ScaleCoefficients [ImageDimension]
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Static Protected Attributes

static double m_MIN_NORM
 

Member Typedef Documentation

◆ ConstPointer

template<typename TImage>
using itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::ConstPointer = SmartPointer<const Self>

◆ NeighborhoodSizeValueType

template<typename TImage>
using itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::NeighborhoodSizeValueType = SizeValueType

◆ Pointer

◆ Self

Standard class type aliases.

Definition at line 62 of file itkGPUGradientNDAnisotropicDiffusionFunction.h.

◆ Superclass

Constructor & Destructor Documentation

◆ GPUGradientNDAnisotropicDiffusionFunction()

template<typename TImage>
itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::GPUGradientNDAnisotropicDiffusionFunction ( )
protected

Referenced by GetNameOfClass().

◆ ~GPUGradientNDAnisotropicDiffusionFunction()

template<typename TImage>
itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::~GPUGradientNDAnisotropicDiffusionFunction ( )
overrideprotecteddefault

Member Function Documentation

◆ CreateAnother()

template<typename TImage>
virtual::itk::LightObject::Pointer itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::LightObject.

◆ GetNameOfClass()

template<typename TImage>
const char * itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::GetNameOfClass ( ) const
overridevirtual

◆ GPUComputeUpdate()

template<typename TImage>
void itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::GPUComputeUpdate ( const typename TImage::Pointer output,
typename TImage::Pointer buffer,
void * globalData )
overridevirtual

Compute the equation value.

Implements itk::GPUFiniteDifferenceFunction< TImage >.

◆ InitializeIteration()

template<typename TImage>
void itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::InitializeIteration ( )
inlineoverridevirtual

◆ itkGetOpenCLSourceFromKernelMacro()

template<typename TImage>
itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::itkGetOpenCLSourceFromKernelMacro ( GPUGradientNDAnisotropicDiffusionFunctionKernel )

Get OpenCL Kernel source as a string, creates a GetOpenCLSource method

◆ New()

Member Data Documentation

◆ ImageDimension

template<typename TImage>
unsigned int itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::ImageDimension = Superclass::ImageDimension
staticconstexpr

Inherit some parameters from the superclass type.

Definition at line 85 of file itkGPUGradientNDAnisotropicDiffusionFunction.h.

◆ m_Center

template<typename TImage>
NeighborhoodSizeValueType itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::m_Center {}
protected

◆ m_DerivativeOperator

template<typename TImage>
DerivativeOperator<PixelType, Self::ImageDimension> itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::m_DerivativeOperator {}
protected

Derivative operator.

Definition at line 115 of file itkGPUGradientNDAnisotropicDiffusionFunction.h.

◆ m_InnerProduct

template<typename TImage>
NeighborhoodInnerProduct<ImageType> itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::m_InnerProduct {}
protected

Inner product function.

Definition at line 107 of file itkGPUGradientNDAnisotropicDiffusionFunction.h.

◆ m_K

template<typename TImage>
PixelType itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::m_K {}
protected

Modified global average gradient magnitude term.

Definition at line 118 of file itkGPUGradientNDAnisotropicDiffusionFunction.h.

Referenced by InitializeIteration().

◆ m_MIN_NORM

template<typename TImage>
double itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::m_MIN_NORM
staticprotected

◆ m_Stride

template<typename TImage>
NeighborhoodSizeValueType itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::m_Stride[ImageDimension] {}
protected

◆ x_slice

template<typename TImage>
std::slice itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::x_slice[ImageDimension]
protected

Slices for the ND neighborhood.

Definition at line 110 of file itkGPUGradientNDAnisotropicDiffusionFunction.h.

◆ xa_slice

template<typename TImage>
std::slice itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::xa_slice[ImageDimension][ImageDimension]
protected

◆ xd_slice

template<typename TImage>
std::slice itk::GPUGradientNDAnisotropicDiffusionFunction< TImage >::xd_slice[ImageDimension][ImageDimension]
protected

The documentation for this class was generated from the following file: