iRoCS Toolbox  1.1.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
atb::AnisotropicDiffusionFilter< DataT, Dim > Class Template Reference

The AnisotropicDiffusionFilter class implements the Filter interface and provides an anisotropic diffusion filter. More...

#include "libArrayToolbox/AnisotropicDiffusionFilter.hh"

Inheritance diagram for atb::AnisotropicDiffusionFilter< DataT, Dim >:
Collaboration diagram for atb::AnisotropicDiffusionFilter< DataT, Dim >:

Public Types

typedef DataT ResultT
 

Public Member Functions

 AnisotropicDiffusionFilter (BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Default Constructor. More...
 
 AnisotropicDiffusionFilter (double kappa, double sigmaUm=-1.0, double tau=0.0625, double zAnisotropyCorrection=0.0, int nIterations=20, int hessianUpdateStepWidth=4, BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Constructor. More...
 
virtual ~AnisotropicDiffusionFilter ()
 Destructor. More...
 
virtual void apply (Array< DataT, Dim > const &data, Array< DataT, Dim > &result, iRoCS::ProgressReporter *pr=NULL) const
 Apply the filter to the given Array. More...
 
virtual void apply (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< ResultT, Dim > &filtered, iRoCS::ProgressReporter *pr=NULL) const
 Apply the filter to the given Array. More...
 
BoundaryTreatment< DataT, Dim > const & boundaryTreatment () const
 Get a read-only reference to the boundary treatment object associated with this filter. More...
 
int hessianUpdateStepWidth () const
 Get the iteration stride for hessian recomputation. More...
 
double kappa () const
 Get the edge weight kappa. More...
 
int nIterations () const
 Get the number of filtering iterations. More...
 
void setBoundaryTreatment (BoundaryTreatmentType bt, DataT const &boundaryValue=traits< DataT >::zero)
 Change the boundary treatment type to the type specified. More...
 
void setBoundaryTreatment (BoundaryTreatment< DataT, Dim > const &bt)
 Change the boundary treatment type to the type specified. More...
 
void setHessianUpdateStepWidth (int hessianUpdateStepWidth)
 Set the iteration stride for hessian recomputation. More...
 
void setKappa (double kappa)
 Set the edge weight kappa. More...
 
void setNIterations (int nIterations)
 Set the number of filtering iterations. More...
 
void setSigmaUm (double sigmaUm)
 Set the standard deviation of the Gaussian pre-smoothing filter in micrometers for all dimensions. More...
 
void setTau (double tau)
 Set the solver time step (In case of convergence problems reduce it) More...
 
void setZAnisotropyCorrection (double zAnisotropyCorrection)
 Set the anisotropy correction constant applied in z direction. More...
 
double sigmaUm () const
 Get the standard deviations of the Gaussian pre-smoothing filter in micrometers for all dimensions. More...
 
double tau () const
 Get the solver time step. More...
 
double zAnisotropyCorrection () const
 Get the anisotropy correction constant applied in z direction. More...
 

Static Public Member Functions

static void apply (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< ResultT, Dim > &filtered, double kappa, double sigmaUm=-1.0, double tau=0.0625, double zAnisotropyCorrection=0.0, int nIterations=20, int hessianUpdateStepWidth=4, BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero, iRoCS::ProgressReporter *pr=NULL)
 Apply the filter to the given Array. More...
 
static void apply (Array< DataT, Dim > const &data, Array< ResultT, Dim > &filtered, double kappa, double sigmaUm=-1.0, double tau=0.0625, double zAnisotropyCorrection=0.0, int nIterations=20, int hessianUpdateStepWidth=4, BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero, iRoCS::ProgressReporter *pr=NULL)
 Apply the filter to the given Array. More...
 

Protected Attributes

BoundaryTreatment< DataT, Dim > * p_bt
 The boundary treatment object to use for out-of-Array access. More...
 

Detailed Description

template<typename DataT, int Dim>
class atb::AnisotropicDiffusionFilter< DataT, Dim >

The AnisotropicDiffusionFilter class implements the Filter interface and provides an anisotropic diffusion filter.

This filter non-linearly removes noise and enhances consistent structures.

Definition at line 53 of file AnisotropicDiffusionFilter.hh.

Member Typedef Documentation

◆ ResultT

template<typename DataT , int Dim>
typedef DataT atb::AnisotropicDiffusionFilter< DataT, Dim >::ResultT

Definition at line 58 of file AnisotropicDiffusionFilter.hh.

Constructor & Destructor Documentation

◆ AnisotropicDiffusionFilter() [1/2]

template<typename DataT , int Dim>
atb::AnisotropicDiffusionFilter< DataT, Dim >::AnisotropicDiffusionFilter ( BoundaryTreatmentType  bt = ValueBT,
DataT const &  boundaryValue = traits< DataT >::zero 
)

Default Constructor.

Creates a stub anisotropic diffusion filter.

Parameters
btThe boundary treatment this filter uses
boundaryValueIf bt is ValueBT, this value will be used for out-of-Array access

◆ AnisotropicDiffusionFilter() [2/2]

template<typename DataT , int Dim>
atb::AnisotropicDiffusionFilter< DataT, Dim >::AnisotropicDiffusionFilter ( double  kappa,
double  sigmaUm = -1.0,
double  tau = 0.0625,
double  zAnisotropyCorrection = 0.0,
int  nIterations = 20,
int  hessianUpdateStepWidth = 4,
BoundaryTreatmentType  bt = ValueBT,
DataT const &  boundaryValue = traits< DataT >::zero 
)

Constructor.

Creates an anisotropic diffusion filter with given pre-smoothing Gaussian standard deviation and edge weight kappa.

Parameters
sigmaUmThe standard deviations in either direction of the pre-smoothing Gaussian kernel in micrometers
kappaThe edge factor (ToDo: clarify what it does)
tauThe step width of the Jacobian solver
zAnisotropyCorrectionValues greater than zero will enhance weaker edges in z direction than in x-y directions. The z-direction edge weight will be increased by this constant.
nIterationsThe number of iterations to apply
hessianUpdateStepWidthThe hessian is recomputed every hessianUpdateStepWidth iterations
btThe boundary treatment this filter uses
boundaryValueIf bt is ValueBT, this value will be used for out-of-Array access

◆ ~AnisotropicDiffusionFilter()

template<typename DataT , int Dim>
virtual atb::AnisotropicDiffusionFilter< DataT, Dim >::~AnisotropicDiffusionFilter ( )
virtual

Destructor.

Member Function Documentation

◆ kappa()

template<typename DataT , int Dim>
double atb::AnisotropicDiffusionFilter< DataT, Dim >::kappa ( ) const

Get the edge weight kappa.

Returns
The edge weight kappa

◆ setKappa()

template<typename DataT , int Dim>
void atb::AnisotropicDiffusionFilter< DataT, Dim >::setKappa ( double  kappa)

Set the edge weight kappa.

Parameters
kappaThe edge weight

◆ sigmaUm()

template<typename DataT , int Dim>
double atb::AnisotropicDiffusionFilter< DataT, Dim >::sigmaUm ( ) const

Get the standard deviations of the Gaussian pre-smoothing filter in micrometers for all dimensions.

Returns
The standard deviation vector in micrometers

◆ setSigmaUm()

template<typename DataT , int Dim>
void atb::AnisotropicDiffusionFilter< DataT, Dim >::setSigmaUm ( double  sigmaUm)

Set the standard deviation of the Gaussian pre-smoothing filter in micrometers for all dimensions.

Parameters
sigmaUmThe standard deviation vector in micrometers

◆ tau()

template<typename DataT , int Dim>
double atb::AnisotropicDiffusionFilter< DataT, Dim >::tau ( ) const

Get the solver time step.

Returns
The solver time step

◆ setTau()

template<typename DataT , int Dim>
void atb::AnisotropicDiffusionFilter< DataT, Dim >::setTau ( double  tau)

Set the solver time step (In case of convergence problems reduce it)

Parameters
tauThe solver time step

◆ zAnisotropyCorrection()

template<typename DataT , int Dim>
double atb::AnisotropicDiffusionFilter< DataT, Dim >::zAnisotropyCorrection ( ) const

Get the anisotropy correction constant applied in z direction.

Returns
The z anisotropy constant

◆ setZAnisotropyCorrection()

template<typename DataT , int Dim>
void atb::AnisotropicDiffusionFilter< DataT, Dim >::setZAnisotropyCorrection ( double  zAnisotropyCorrection)

Set the anisotropy correction constant applied in z direction.

Parameters
zAnisotropyCorrectionThe z anisotropy constant

◆ nIterations()

template<typename DataT , int Dim>
int atb::AnisotropicDiffusionFilter< DataT, Dim >::nIterations ( ) const

Get the number of filtering iterations.

Returns
The number of filtering iterations

◆ setNIterations()

template<typename DataT , int Dim>
void atb::AnisotropicDiffusionFilter< DataT, Dim >::setNIterations ( int  nIterations)

Set the number of filtering iterations.

Parameters
nIterationsThe number of filtering iterations

◆ hessianUpdateStepWidth()

template<typename DataT , int Dim>
int atb::AnisotropicDiffusionFilter< DataT, Dim >::hessianUpdateStepWidth ( ) const

Get the iteration stride for hessian recomputation.

Returns
The number of filtering iterations between two hessian updates

◆ setHessianUpdateStepWidth()

template<typename DataT , int Dim>
void atb::AnisotropicDiffusionFilter< DataT, Dim >::setHessianUpdateStepWidth ( int  hessianUpdateStepWidth)

Set the iteration stride for hessian recomputation.

Parameters
hessianUpdateStepWidthThe number of filtering iterations between two hessian updates

◆ apply() [1/4]

template<typename DataT , int Dim>
virtual void atb::AnisotropicDiffusionFilter< DataT, Dim >::apply ( blitz::Array< DataT, Dim > const &  data,
blitz::TinyVector< double, Dim > const &  elementSizeUm,
blitz::Array< ResultT, Dim > &  filtered,
iRoCS::ProgressReporter pr = NULL 
) const
virtual

Apply the filter to the given Array.

Parameters
dataThe blitz++ Array to apply the filter to
elementSizeUmThe element size of the Array
filteredThe filtering result
prProgress will be reported through the given iRoCS::ProgressReporter
Exceptions
RuntimeErrorIf an error occurs during the filter operation an exception of this kind is thrown

Implements atb::Filter< DataT, Dim, DataT >.

◆ apply() [2/4]

template<typename DataT , int Dim>
static void atb::AnisotropicDiffusionFilter< DataT, Dim >::apply ( blitz::Array< DataT, Dim > const &  data,
blitz::TinyVector< double, Dim > const &  elementSizeUm,
blitz::Array< ResultT, Dim > &  filtered,
double  kappa,
double  sigmaUm = -1.0,
double  tau = 0.0625,
double  zAnisotropyCorrection = 0.0,
int  nIterations = 20,
int  hessianUpdateStepWidth = 4,
BoundaryTreatmentType  btType = ValueBT,
DataT const &  boundaryValue = traits< DataT >::zero,
iRoCS::ProgressReporter pr = NULL 
)
static

Apply the filter to the given Array.

Parameters
dataThe blitz++ Array to apply the filter to
elementSizeUmThe element size of the Array
filteredThe filtering result
sigmaUmThe Gaussian pre-smoothing standard deviation vector (in micrometers)
kappaThe edge weight
tauThe step width of the Jacobian solver
zAnisotropyCorrectionValues greater than zero will enhance weaker edges in z direction than in x-y directions. The z-direction edge weight will be increased by this constant.
nIterationsThe number of iterations to apply
hessianUpdateStepWidthThe hessian is recomputed every hessianUpdateStepWidth iterations
btTypeThe boundary treatment to apply
boundaryValueThe out-of-Array value that should be used if btType == ValueBT
prProgress will be reported through the given iRoCS::ProgressReporter
Exceptions
RuntimeErrorIf an error occurs during the filter operation an exception of this kind is thrown

◆ apply() [3/4]

template<typename DataT , int Dim>
static void atb::AnisotropicDiffusionFilter< DataT, Dim >::apply ( Array< DataT, Dim > const &  data,
Array< ResultT, Dim > &  filtered,
double  kappa,
double  sigmaUm = -1.0,
double  tau = 0.0625,
double  zAnisotropyCorrection = 0.0,
int  nIterations = 20,
int  hessianUpdateStepWidth = 4,
BoundaryTreatmentType  btType = ValueBT,
DataT const &  boundaryValue = traits< DataT >::zero,
iRoCS::ProgressReporter pr = NULL 
)
static

Apply the filter to the given Array.

Parameters
dataThe blitz++ Array to apply the filter to
filteredThe filtering result
sigmaUmThe Gaussian pre-smoothing standard deviation vector (in micrometers)
kappaThe edge weight
tauThe step width of the Jacobian solver
zAnisotropyCorrectionValues greater than zero will enhance weaker edges in z direction than in x-y directions. The z-direction edge weight will be increased by this constant.
nIterationsThe number of iterations to apply
hessianUpdateStepWidthThe hessian is recomputed every hessianUpdateStepWidth iterations
btTypeThe boundary treatment to apply
boundaryValueThe out-of-Array value that should be used if btType == ValueBT
prProgress will be reported through the given iRoCS::ProgressReporter
Exceptions
RuntimeErrorIf an error occurs during the filter operation an exception of this kind is thrown

◆ boundaryTreatment()

BoundaryTreatment<DataT,Dim> const& atb::Filter< DataT, Dim, DataT >::boundaryTreatment ( ) const
inherited

Get a read-only reference to the boundary treatment object associated with this filter.

Returns
A reference to the associated BoundaryTreatment object

◆ setBoundaryTreatment() [1/2]

void atb::Filter< DataT, Dim, DataT >::setBoundaryTreatment ( BoundaryTreatmentType  bt,
DataT const &  boundaryValue = traits<DataT>::zero 
)
inherited

Change the boundary treatment type to the type specified.

Parameters
btThe boundary treatment this filter uses
boundaryValueIf bt is ValueBT, this value will be used for out-of-Array access

◆ setBoundaryTreatment() [2/2]

void atb::Filter< DataT, Dim, DataT >::setBoundaryTreatment ( BoundaryTreatment< DataT, Dim > const &  bt)
inherited

Change the boundary treatment type to the type specified.

Parameters
btThe boundary treatment this filter uses

◆ apply() [4/4]

virtual void atb::Filter< DataT, Dim, DataT >::apply ( Array< DataT, Dim > const &  data,
Array< DataT , Dim > &  result,
iRoCS::ProgressReporter pr = NULL 
) const
virtualinherited

Apply the filter to the given Array.

Parameters
dataThe Array to apply the filter to
resultThe filtering result
prIf given progress will be reported to this ProgressReporter
Exceptions
RuntimeErrorIf an error occurs during the filter operation an exception of this kind is thrown

Field Documentation

◆ p_bt

BoundaryTreatment<DataT,Dim>* atb::Filter< DataT, Dim, DataT >::p_bt
protectedinherited

The boundary treatment object to use for out-of-Array access.

This is set during Filter object creation and can be changed by calling the setBoundaryTreatment() method. It gets destroyed, when the filter is deleted. If you delete the BoundaryTreatment object in a subclass, you must set this pointer to the NULL pointer.

Definition at line 159 of file Filter.hh.


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