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

The GaussianFilter class implements the Filter interface and provides a Gaussian smoothing filter. More...

#include "libArrayToolbox/GaussianFilter.hh"

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

Public Types

typedef DataT ResultT
 

Public Member Functions

 GaussianFilter (BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Default Constructor. More...
 
 GaussianFilter (blitz::TinyVector< double, Dim > const &standardDeviationUm, blitz::TinyVector< BlitzIndexT, Dim > const &minimumKernelShapePx=BlitzIndexT(0), BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
 Constructor. More...
 
virtual ~GaussianFilter ()
 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...
 
blitz::TinyVector< BlitzIndexT, Dim > minimumKernelShapePx () const
 Get the minimum kernel shape of the Gaussian in pixels for all dimensions. 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 setMinimumKernelShapePx (blitz::TinyVector< BlitzIndexT, Dim > const &minimumKernelShapePx)
 Set the minimum kernel shape of the Gaussian in pixels for all dimensions. More...
 
void setStandardDeviationUm (blitz::TinyVector< double, Dim > const &standardDeviationUm)
 Set the standard deviation of the Gaussian in micrometers for all dimensions. More...
 
blitz::TinyVector< double, Dim > standardDeviationUm () const
 Get the standard deviation of the Gaussian in micrometers for all dimensions. 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, blitz::TinyVector< double, Dim > const &standardDeviationUm, blitz::TinyVector< BlitzIndexT, Dim > const &minimumKernelShapePx=BlitzIndexT(0), 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, blitz::TinyVector< double, Dim > const &standardDeviationUm, blitz::TinyVector< BlitzIndexT, Dim > const &minimumKernelShapePx=BlitzIndexT(0), 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::GaussianFilter< DataT, Dim >

The GaussianFilter class implements the Filter interface and provides a Gaussian smoothing filter.

Definition at line 53 of file GaussianFilter.hh.

Member Typedef Documentation

◆ ResultT

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

Definition at line 58 of file GaussianFilter.hh.

Constructor & Destructor Documentation

◆ GaussianFilter() [1/2]

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

Default Constructor.

Creates a stub Gaussian filter.

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

◆ GaussianFilter() [2/2]

template<typename DataT , int Dim>
atb::GaussianFilter< DataT, Dim >::GaussianFilter ( blitz::TinyVector< double, Dim > const &  standardDeviationUm,
blitz::TinyVector< BlitzIndexT, Dim > const &  minimumKernelShapePx = BlitzIndexT(0),
BoundaryTreatmentType  bt = ValueBT,
DataT const &  boundaryValue = traits< DataT >::zero 
)

Constructor.

Creates a Gaussian filter with given standard deviations (in micrometers) in either dimension.

Parameters
standardDeviationUmThe Gaussian standard deviation in either direction in micrometers
minimumKernelShapePxThe minimum kernel shape in pixels. Usually the kernel has a shape of 6 * standardDeviation (in pixels) + 1 in either dimension. If you want to explicitely force larger kernels you can give the minimum kernel extents here.
btThe boundary treatment this filter uses
boundaryValueIf bt is ValueBT, this value will be used for out-of-Array access

◆ ~GaussianFilter()

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

Destructor.

Member Function Documentation

◆ standardDeviationUm()

template<typename DataT , int Dim>
blitz::TinyVector<double,Dim> atb::GaussianFilter< DataT, Dim >::standardDeviationUm ( ) const

Get the standard deviation of the Gaussian in micrometers for all dimensions.

Returns
The Gaussian standard deviation vector in micrometers

◆ setStandardDeviationUm()

template<typename DataT , int Dim>
void atb::GaussianFilter< DataT, Dim >::setStandardDeviationUm ( blitz::TinyVector< double, Dim > const &  standardDeviationUm)

Set the standard deviation of the Gaussian in micrometers for all dimensions.

Parameters
standardDeviationUmThe Gaussian standard deviation vector in micrometers

◆ minimumKernelShapePx()

template<typename DataT , int Dim>
blitz::TinyVector<BlitzIndexT,Dim> atb::GaussianFilter< DataT, Dim >::minimumKernelShapePx ( ) const

Get the minimum kernel shape of the Gaussian in pixels for all dimensions.

Returns
The minimum kernel shape in pixels

◆ setMinimumKernelShapePx()

template<typename DataT , int Dim>
void atb::GaussianFilter< DataT, Dim >::setMinimumKernelShapePx ( blitz::TinyVector< BlitzIndexT, Dim > const &  minimumKernelShapePx)

Set the minimum kernel shape of the Gaussian in pixels for all dimensions.

Parameters
minimumKernelShapePxThe minimum kernel shape in pixels

◆ apply() [1/4]

template<typename DataT , int Dim>
virtual void atb::GaussianFilter< 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 >.

Referenced by segmentation::edgeFilter().

◆ apply() [2/4]

template<typename DataT , int Dim>
static void atb::GaussianFilter< DataT, Dim >::apply ( blitz::Array< DataT, Dim > const &  data,
blitz::TinyVector< double, Dim > const &  elementSizeUm,
blitz::Array< ResultT, Dim > &  filtered,
blitz::TinyVector< double, Dim > const &  standardDeviationUm,
blitz::TinyVector< BlitzIndexT, Dim > const &  minimumKernelShapePx = BlitzIndexT(0),
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
standardDeviationUmThe Gaussian standard deviation vector (in micrometers)
minimumKernelShapePxThe minimum kernel shape in pixels
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::GaussianFilter< DataT, Dim >::apply ( Array< DataT, Dim > const &  data,
Array< ResultT, Dim > &  filtered,
blitz::TinyVector< double, Dim > const &  standardDeviationUm,
blitz::TinyVector< BlitzIndexT, Dim > const &  minimumKernelShapePx = BlitzIndexT(0),
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
standardDeviationUmThe Gaussian standard deviation vector (in micrometers)
minimumKernelShapePxThe minimum kernel shape in pixels
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
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: