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

The MedianFilter class implements the n-dimensional median filter. More...

#include "ArrayToolbox/MedianFilter.hh"

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

Public Types

typedef DataT ResultT
 

Public Member Functions

 MedianFilter (blitz::TinyVector< BlitzIndexT, Dim > const &extentsPx=blitz::TinyVector< BlitzIndexT, Dim >(BlitzIndexT(1)))
 Constructor. More...
 
virtual ~MedianFilter ()
 Destructor. More...
 
virtual void apply (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< ResultT, Dim > &result, iRoCS::ProgressReporter *pr=NULL) const
 Apply the filter to the given Array. 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...
 
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 > const & filterExtentsPx () const
 Get the filter extents in pixels. 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 setFilterExtentsPx (blitz::TinyVector< BlitzIndexT, Dim > const &extentsPx)
 Set the filter extents in pixels. More...
 

Static Public Member Functions

static void apply (blitz::Array< DataT, Dim > const &data, blitz::Array< ResultT, Dim > &filtered, blitz::TinyVector< BlitzIndexT, Dim > const &extentsPx, 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::MedianFilter< DataT, Dim >

The MedianFilter class implements the n-dimensional median filter.

Definition at line 49 of file MedianFilter.hh.

Member Typedef Documentation

◆ ResultT

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

Definition at line 54 of file MedianFilter.hh.

Constructor & Destructor Documentation

◆ MedianFilter()

template<typename DataT , int Dim>
atb::MedianFilter< DataT, Dim >::MedianFilter ( blitz::TinyVector< BlitzIndexT, Dim > const &  extentsPx = blitz::TinyVector< BlitzIndexT, Dim >(BlitzIndexT(1)))

Constructor.

In contrast to other filters the median filter always uses crop boundary treatment. Therefore any changes in the setting of the boundary treatment are bogus and do not change the behaviour of the filter.

Parameters
extentsPxThe filter extents in pixels

◆ ~MedianFilter()

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

Destructor.

Member Function Documentation

◆ filterExtentsPx()

template<typename DataT , int Dim>
blitz::TinyVector<BlitzIndexT,Dim> const& atb::MedianFilter< DataT, Dim >::filterExtentsPx ( ) const

Get the filter extents in pixels.

Returns
The filter extents in pixels.

◆ setFilterExtentsPx()

template<typename DataT , int Dim>
void atb::MedianFilter< DataT, Dim >::setFilterExtentsPx ( blitz::TinyVector< BlitzIndexT, Dim > const &  extentsPx)

Set the filter extents in pixels.

Parameters
extentsPxThe filter extents in pixels.

◆ apply() [1/3]

template<typename DataT , int Dim>
virtual void atb::MedianFilter< DataT, Dim >::apply ( blitz::Array< DataT, Dim > const &  data,
blitz::TinyVector< double, Dim > const &  elementSizeUm,
blitz::Array< ResultT, Dim > &  result,
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
resultThe filtering result
Exceptions
RuntimeErrorIf an error occurs during the filter operation an exception of this kind is thrown

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

◆ apply() [2/3]

template<typename DataT , int Dim>
static void atb::MedianFilter< DataT, Dim >::apply ( blitz::Array< DataT, Dim > const &  data,
blitz::Array< ResultT, Dim > &  filtered,
blitz::TinyVector< BlitzIndexT, Dim > const &  extentsPx,
iRoCS::ProgressReporter pr = NULL 
)
static

Apply the filter to the given Array.

Parameters
dataThe blitz++ Array to apply the filter to
filteredThe filtering result
extentsPxThe filter extents in pixels
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() [3/3]

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: