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

The CentralHessianFilter class implements the SeparableFilter interface and provides hessian computation using central differences. More...

#include "libArrayToolbox/CentralHessianFilter.hh"

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

Public Types

typedef blitz::TinyMatrix< DataT, Dim, Dim > ResultT
 

Public Member Functions

 CentralHessianFilter (BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Default Constructor. More...
 
 CentralHessianFilter (typename CentralGradientFilter< DataT, Dim >::Accuracy accuracy, BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Constructor. More...
 
virtual ~CentralHessianFilter ()
 Destructor. More...
 
CentralGradientFilter< DataT, Dim >::Accuracy accuracy () const
 Get the order of accuracy of this filter. More...
 
virtual void apply (Array< DataT, Dim > const &data, Array< blitz::TinyMatrix< DataT, Dim, Dim >, 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...
 
virtual void applyAlongDim (Array< DataT, Dim > const &data, Array< blitz::TinyMatrix< DataT, Dim, Dim >, Dim > &result, int dim, iRoCS::ProgressReporter *pr=NULL) const
 Apply the filter along the specified dimension. More...
 
virtual void applyAlongDim (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< DataT, Dim > &filtered, int dim, iRoCS::ProgressReporter *pr=NULL) const
 Apply the filter along the specified dimension. More...
 
virtual void applyAlongDim (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< ResultT, Dim > &filtered, int dim, iRoCS::ProgressReporter *pr=NULL) const
 Apply the filter along the specified dimension. More...
 
BoundaryTreatment< DataT, Dim > const & boundaryTreatment () const
 Get a read-only reference to the boundary treatment object associated with this filter. More...
 
void setAccuracy (typename CentralGradientFilter< DataT, Dim >::Accuracy accuracy)
 Set the order of accuracy of this filter. 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...
 

Static Public Member Functions

static void apply (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< ResultT, Dim > &filtered, typename CentralGradientFilter< DataT, Dim >::Accuracy accuracy, 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, typename CentralGradientFilter< DataT, Dim >::Accuracy accuracy, 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::CentralHessianFilter< DataT, Dim >

The CentralHessianFilter class implements the SeparableFilter interface and provides hessian computation using central differences.

Definition at line 51 of file CentralHessianFilter.hh.

Member Typedef Documentation

◆ ResultT

template<typename DataT , int Dim>
typedef blitz::TinyMatrix<DataT,Dim,Dim> atb::CentralHessianFilter< DataT, Dim >::ResultT

Definition at line 57 of file CentralHessianFilter.hh.

Constructor & Destructor Documentation

◆ CentralHessianFilter() [1/2]

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

Default Constructor.

Creates a Hessian filter with second order accurate discrete hessian approimation using central differences.

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

◆ CentralHessianFilter() [2/2]

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

Constructor.

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

◆ ~CentralHessianFilter()

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

Destructor.

Member Function Documentation

◆ accuracy()

template<typename DataT , int Dim>
CentralGradientFilter<DataT,Dim>::Accuracy atb::CentralHessianFilter< DataT, Dim >::accuracy ( ) const

Get the order of accuracy of this filter.

Currently only snd and 4th order are implemented.

Returns
The accuracy of the discrete derivative approximation

◆ setAccuracy()

template<typename DataT , int Dim>
void atb::CentralHessianFilter< DataT, Dim >::setAccuracy ( typename CentralGradientFilter< DataT, Dim >::Accuracy  accuracy)

Set the order of accuracy of this filter.

Currently only snd and 4th order are implemented.

Parameters
accuracyThe new accuracy of the discrete derivative approximation

◆ applyAlongDim() [1/3]

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

Apply the filter along the specified dimension.

Parameters
dataThe data Array to filter
elementSizeUmThe data voxel extents in micrometers
filteredThe filter result
dimThe component of the hessian to compute. The given linear index is converted into a (row, column) pair using the formula row = dim / Dim; col = dim % Dim.

◆ applyAlongDim() [2/3]

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

Apply the filter along the specified dimension.

Parameters
dataThe data Array to filter
elementSizeUmThe data voxel extents in micrometers
filteredThe filter result (in the dim'th vector component)
dimThe component of the hessian to compute. The given linear index is converted into a (row, column) pair using the formula row = dim / Dim; col = dim % Dim.

Implements atb::SeparableFilter< DataT, Dim, blitz::TinyMatrix< DataT, Dim, Dim > >.

◆ apply() [1/4]

template<typename DataT , int Dim>
virtual void atb::CentralHessianFilter< 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
Exceptions
RuntimeErrorIf an error occurs during the filter operation an exception of this kind is thrown

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

◆ apply() [2/4]

template<typename DataT , int Dim>
static void atb::CentralHessianFilter< DataT, Dim >::apply ( blitz::Array< DataT, Dim > const &  data,
blitz::TinyVector< double, Dim > const &  elementSizeUm,
blitz::Array< ResultT, Dim > &  filtered,
typename CentralGradientFilter< DataT, Dim >::Accuracy  accuracy,
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
accuracyThe filter accuracy order
btTypeThe boundary treatment to apply
boundaryValueThe out-of-Array value that should be used if btType == ValueBT
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::CentralHessianFilter< DataT, Dim >::apply ( Array< DataT, Dim > const &  data,
Array< ResultT, Dim > &  filtered,
typename CentralGradientFilter< DataT, Dim >::Accuracy  accuracy,
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
accuracyThe filter accuracy order
btTypeThe boundary treatment to apply
boundaryValueIf btType is Value, this value is assumed outside the Arrays
btTypeThe boundary treatment to apply
boundaryValueThe out-of-Array value that should be used if btType == ValueBT
Exceptions
RuntimeErrorIf an error occurs during the filter operation an exception of this kind is thrown

◆ applyAlongDim() [3/3]

virtual void atb::SeparableFilter< DataT, Dim, blitz::TinyMatrix< DataT, Dim, Dim > >::applyAlongDim ( Array< DataT, Dim > const &  data,
Array< blitz::TinyMatrix< DataT, Dim, Dim > , Dim > &  result,
int  dim,
iRoCS::ProgressReporter pr = NULL 
) const
virtualinherited

Apply the filter along the specified dimension.

Parameters
dataThe data Array to filter
resultThe filter result
dimThe dimension along which to apply the filter
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, blitz::TinyMatrix< DataT, Dim, Dim > >::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, blitz::TinyMatrix< DataT, Dim, Dim > >::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, blitz::TinyMatrix< DataT, Dim, Dim > >::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, blitz::TinyMatrix< DataT, Dim, Dim > >::apply ( Array< DataT, Dim > const &  data,
Array< blitz::TinyMatrix< DataT, Dim, Dim > , 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, blitz::TinyMatrix< DataT, Dim, Dim > >::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: