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

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

#include "libArrayToolbox/CentralHessianUTFilter.hh"

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

Public Types

typedef blitz::TinyVector< DataT, Dim *(Dim+1)/2 > ResultT
 

Public Member Functions

 CentralHessianUTFilter (BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Default Constructor. More...
 
 CentralHessianUTFilter (typename CentralGradientFilter< DataT, Dim >::Accuracy accuracy, BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Constructor. More...
 
virtual ~CentralHessianUTFilter ()
 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::TinyVector< DataT, Dim *(Dim+1)/2 >, 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::TinyVector< DataT, Dim *(Dim+1)/2 >, 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...
 
static blitz::TinyVector< int, 2 > indexToMatrixPosition (int dim)
 Compute the position in the triangular matrix for the given linear index. More...
 
static int matrixPositionToIndex (blitz::TinyVector< int, 2 > const &pos)
 Compute the linear index for the given matrix position. 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::CentralHessianUTFilter< DataT, Dim >

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

The output is stored in upper triangular format to avoid extra memory consumption due to the redundant lower triangular values.

Definition at line 54 of file CentralHessianUTFilter.hh.

Member Typedef Documentation

◆ ResultT

template<typename DataT , int Dim>
typedef blitz::TinyVector<DataT,Dim * (Dim + 1) / 2> atb::CentralHessianUTFilter< DataT, Dim >::ResultT

Definition at line 61 of file CentralHessianUTFilter.hh.

Constructor & Destructor Documentation

◆ CentralHessianUTFilter() [1/2]

template<typename DataT , int Dim>
atb::CentralHessianUTFilter< DataT, Dim >::CentralHessianUTFilter ( 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

◆ CentralHessianUTFilter() [2/2]

template<typename DataT , int Dim>
atb::CentralHessianUTFilter< DataT, Dim >::CentralHessianUTFilter ( 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

◆ ~CentralHessianUTFilter()

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

Destructor.

Member Function Documentation

◆ accuracy()

template<typename DataT , int Dim>
CentralGradientFilter<DataT,Dim>::Accuracy atb::CentralHessianUTFilter< 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::CentralHessianUTFilter< 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

◆ indexToMatrixPosition()

template<typename DataT , int Dim>
static blitz::TinyVector<int,2> atb::CentralHessianUTFilter< DataT, Dim >::indexToMatrixPosition ( int  dim)
static

Compute the position in the triangular matrix for the given linear index.

Parameters
dimlinear index into the local vectorial representation of the upper triangular matrix storing the Hessian.
Returns
The matrix position (row, column) corresponding to the given index

◆ matrixPositionToIndex()

template<typename DataT , int Dim>
static int atb::CentralHessianUTFilter< DataT, Dim >::matrixPositionToIndex ( blitz::TinyVector< int, 2 > const &  pos)
static

Compute the linear index for the given matrix position.

Parameters
posThe matrix position (row, column)
Returns
The linear index into the local vectorial representation of the upper triangular matrix storing the Hessian.

◆ applyAlongDim() [1/3]

template<typename DataT , int Dim>
virtual void atb::CentralHessianUTFilter< 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 hessian is handled as an upper triangular matrix. The given dimension is the upper triangle index. E.g. for 2D: 0: d^2/dx^2, 1: d^2/dxdy, 2: d^2/dy^2

◆ applyAlongDim() [2/3]

template<typename DataT , int Dim>
virtual void atb::CentralHessianUTFilter< 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 hessian is handled as an upper triangular matrix. The given dimension is the upper triangle index. E.g. for 2D: 0: d^2/dx^2, 1: d^2/dxdy, 2: d^2/dy^2

Implements atb::SeparableFilter< DataT, Dim, blitz::TinyVector< DataT, Dim *(Dim+1)/2 > >.

◆ apply() [1/4]

template<typename DataT , int Dim>
virtual void atb::CentralHessianUTFilter< 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::TinyVector< DataT, Dim *(Dim+1)/2 > >.

◆ apply() [2/4]

template<typename DataT , int Dim>
static void atb::CentralHessianUTFilter< 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::CentralHessianUTFilter< 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::TinyVector< DataT, Dim *(Dim+1)/2 > >::applyAlongDim ( Array< DataT, Dim > const &  data,
Array< blitz::TinyVector< DataT, Dim *(Dim+1)/2 > , 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::TinyVector< DataT, Dim *(Dim+1)/2 > >::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::TinyVector< DataT, Dim *(Dim+1)/2 > >::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::TinyVector< DataT, Dim *(Dim+1)/2 > >::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::TinyVector< DataT, Dim *(Dim+1)/2 > >::apply ( Array< DataT, Dim > const &  data,
Array< blitz::TinyVector< DataT, Dim *(Dim+1)/2 > , 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::TinyVector< DataT, Dim *(Dim+1)/2 > >::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: