iRoCS Toolbox
1.1.0
|
The LocalSumFilter class is a box filter with a filter kernel containing only ones. More...
#include "libArrayToolbox/LocalSumFilter.hh"
Public Member Functions | |
LocalSumFilter (BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero) | |
Default Constructor. More... | |
LocalSumFilter (blitz::TinyVector< BlitzIndexT, Dim > const &kernelShapePx, BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero) | |
Constructor with kernel parameter intialization. More... | |
~LocalSumFilter () | |
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... | |
void | apply (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< DataT, Dim > &filtered, iRoCS::ProgressReporter *pr=NULL) const |
Application of the local sum filter onto the data Array. More... | |
virtual void | applyAlongDim (Array< DataT, Dim > const &data, Array< DataT, Dim > &result, int dim, iRoCS::ProgressReporter *pr=NULL) const |
Apply the filter along the specified dimension. More... | |
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 |
Application of the local sum filter onto the data Array 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... | |
blitz::TinyVector< BlitzIndexT, Dim > const & | kernelShapePx () const |
Get the box kernel shape. More... | |
BlitzIndexT | kernelSizePxInDim (int dim) const |
Get the box width in the specified dimension. 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 | setKernelShapePx (blitz::TinyVector< BlitzIndexT, Dim > const &kernelShapePx) |
Set the box kernel shape. More... | |
void | setKernelSizePxInDim (int dim, BlitzIndexT kernelSizePx) |
Set the box width in the specified dimension. More... | |
Static Public Member Functions | |
static void | apply (blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< DataT, Dim > &filtered, blitz::TinyVector< BlitzIndexT, Dim > const &kernelShapePx, BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero, iRoCS::ProgressReporter *pr=NULL) |
Application of a local sum filter with given kernel shape and boundary treatment policy onto the data Array. More... | |
static void | apply (Array< DataT, Dim > const &data, Array< DataT, Dim > &filtered, blitz::TinyVector< BlitzIndexT, Dim > const &kernelShapePx, BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero, iRoCS::ProgressReporter *pr=NULL) |
Application of a local sum filter with given kernel shape and boundary treatment policy onto the data Array. More... | |
Protected Attributes | |
BoundaryTreatment< DataT, Dim > * | p_bt |
The boundary treatment object to use for out-of-Array access. More... | |
The LocalSumFilter class is a box filter with a filter kernel containing only ones.
The filtering result can be divided by the kernel size to get a normalized box-filter response. It is implemented as an algorithm by exploiting the fact that for each kernel shift only the point entering the kernel has to be added and the point leaving the kernel has to be subtracted (for each direction).
Definition at line 59 of file LocalSumFilter.hh.
atb::LocalSumFilter< DataT, Dim >::LocalSumFilter | ( | BoundaryTreatmentType | btType = ValueBT , |
DataT const & | boundaryValue = traits< DataT >::zero |
||
) |
Default Constructor.
btType | Defines the border treatment of this filter. The following border treatments are available: ValueBT , RepeatBT , MirrorBT , CyclicBT , CropBT |
boundaryValue | The value to use for out-of-Array positions if the btType is ValueBT |
atb::LocalSumFilter< DataT, Dim >::LocalSumFilter | ( | blitz::TinyVector< BlitzIndexT, Dim > const & | kernelShapePx, |
BoundaryTreatmentType | btType = ValueBT , |
||
DataT const & | boundaryValue = traits< DataT >::zero |
||
) |
Constructor with kernel parameter intialization.
kernelShapePx | The box shape in pixels. If you pass values ![]() |
btType | Defines the border treatment of this filter. The following border treatments are available: ValueBT , RepeatBT , MirrorBT , CyclicBT , CropBT |
boundaryValue | The value to use for out-of-Array positions if the btType is ValueBT |
atb::LocalSumFilter< DataT, Dim >::~LocalSumFilter | ( | ) |
Destructor.
BlitzIndexT atb::LocalSumFilter< DataT, Dim >::kernelSizePxInDim | ( | int | dim | ) | const |
Get the box width in the specified dimension.
dim | The dimension to get the filter width for |
void atb::LocalSumFilter< DataT, Dim >::setKernelSizePxInDim | ( | int | dim, |
BlitzIndexT | kernelSizePx | ||
) |
Set the box width in the specified dimension.
dim | The dimension to set the filter width for |
kernelSizePx | The new width of the kernel along dimension dim in pixels. |
blitz::TinyVector<BlitzIndexT,Dim> const& atb::LocalSumFilter< DataT, Dim >::kernelShapePx | ( | ) | const |
Get the box kernel shape.
void atb::LocalSumFilter< DataT, Dim >::setKernelShapePx | ( | blitz::TinyVector< BlitzIndexT, Dim > const & | kernelShapePx | ) |
Set the box kernel shape.
kernelShapePx | The new box shape in pixels. If you pass values ![]() |
|
virtual |
Application of the local sum filter onto the data Array along the specified dimension.
data | The data Array to filter |
elementSizeUm | The voxel extents in micrometers |
filtered | The filter result |
dim | The dimension along which to apply the filter |
Implements atb::SeparableFilter< DataT, Dim, DataT >.
|
virtual |
Application of the local sum filter onto the data Array.
data | The data Array to filter |
elementSizeUm | The voxel extents in micrometers |
filtered | The filtering result |
Implements atb::Filter< DataT, Dim, DataT >.
|
static |
Application of a local sum filter with given kernel shape and boundary treatment policy onto the data Array.
data | The data Array to filter |
elementSizeUm | The voxel extents in micrometers |
filtered | The filtering result |
kernelShapePx | The box shape in pixels. If you pass values ![]() |
btType | The boundary treatment to apply |
boundaryValue | The out-of-Array value that should be used if btType == ValueBT |
|
static |
Application of a local sum filter with given kernel shape and boundary treatment policy onto the data Array.
data | The data Array to filter |
filtered | The filtering result |
kernelShapePx | The box shape in pixels. If you pass values ![]() |
btType | The boundary treatment to apply |
boundaryValue | The out-of-Array value that should be used if btType == ValueBT |
|
virtualinherited |
Apply the filter along the specified dimension.
data | The data Array to filter |
result | The filter result |
dim | The dimension along which to apply the filter |
RuntimeError | If an error occurs during the filter operation an exception of this kind is thrown |
|
inherited |
Get a read-only reference to the boundary treatment object associated with this filter.
|
inherited |
Change the boundary treatment type to the type specified.
bt | The boundary treatment this filter uses |
boundaryValue | If bt is ValueBT, this value will be used for out-of-Array access |
|
inherited |
Change the boundary treatment type to the type specified.
bt | The boundary treatment this filter uses |
|
virtualinherited |
Apply the filter to the given Array.
data | The Array to apply the filter to |
result | The filtering result |
pr | If given progress will be reported to this ProgressReporter |
RuntimeError | If an error occurs during the filter operation an exception of this kind is thrown |
|
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.