iRoCS Toolbox
1.1.0
|
The SeparableCorrelationFilter class implements direct separable correlation. More...
#include "libArrayToolbox/SeparableCorrelationFilter.hh"
Public Member Functions | |
SeparableCorrelationFilter (BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero) | |
Default Constructor. More... | |
SeparableCorrelationFilter (blitz::TinyVector< blitz::Array< DataT, 1 > *, Dim > const &kernels, BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero) | |
Constructor with kernel intialization. More... | |
~SeparableCorrelationFilter () | |
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 |
Correlate the given data Array with this filter. 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 |
Correlation of the data Array with the kernel 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 | 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 | setKernelForDim (blitz::Array< DataT, 1 > const *kernel, int dim) |
Set the filtering kernel component for the specified dimension. More... | |
void | setKernels (blitz::TinyVector< blitz::Array< DataT, 1 > *, Dim > const &kernels) |
Set the kernels for all data dimensions. 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< blitz::Array< DataT, 1 > *, Dim > const &kernels, BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero, iRoCS::ProgressReporter *pr=NULL) |
Correlate the data Array with the given kernels using the specified boundary treatment policy. More... | |
static void | apply (Array< DataT, Dim > const &data, Array< DataT, Dim > &filtered, blitz::TinyVector< blitz::Array< DataT, 1 > *, Dim > const &kernels, BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero, iRoCS::ProgressReporter *pr=NULL) |
Correlate the data Array with the given kernels using the specified boundary treatment policy. More... | |
Protected Attributes | |
BoundaryTreatment< DataT, Dim > * | p_bt |
The boundary treatment object to use for out-of-Array access. More... | |
The SeparableCorrelationFilter class implements direct separable correlation.
Compared to the ATB::correlate() functions this class provides functions with minimum memory overhead. The filters are parallelized and memory traversal is near optimum to give reasonable speed without employing Fourier Transforms. So this class is especially useful if you have only limited memory but much processing power. The running time scales linearly with the kernel size, though, therefore for big kernels this class can be much slower than its Fourier counterparts.
Definition at line 58 of file SeparableCorrelationFilter.hh.
atb::SeparableCorrelationFilter< DataT, Dim >::SeparableCorrelationFilter | ( | 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::SeparableCorrelationFilter< DataT, Dim >::SeparableCorrelationFilter | ( | blitz::TinyVector< blitz::Array< DataT, 1 > *, Dim > const & | kernels, |
BoundaryTreatmentType | btType = ValueBT , |
||
DataT const & | boundaryValue = traits< DataT >::zero |
||
) |
Constructor with kernel intialization.
kernels | Pointers to the filter kernels for all data dimensions. The vector may contain NULL pointers for dimensions the filter should not be applied to. |
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::SeparableCorrelationFilter< DataT, Dim >::~SeparableCorrelationFilter | ( | ) |
Destructor.
void atb::SeparableCorrelationFilter< DataT, Dim >::setKernelForDim | ( | blitz::Array< DataT, 1 > const * | kernel, |
int | dim | ||
) |
Set the filtering kernel component for the specified dimension.
You can pass the NULL
pointer if you don't want to filter in the specified direction. The filter will create and manage a copy of the given kernel, and not work directly on the data pointer given!
kernel | A pointer to the blitz++ Array containing the kernel to apply along dimension dim, or the NULL pointer if data should not be filtered along dim. |
dim | The filtering dimension for this kernel |
void atb::SeparableCorrelationFilter< DataT, Dim >::setKernels | ( | blitz::TinyVector< blitz::Array< DataT, 1 > *, Dim > const & | kernels | ) |
Set the kernels for all data dimensions.
You can pass NULL
pointers if you don't want to filter along some dimensions. The filter will create and manage copies of the given kernels, and will not work directly on the data pointers given!
kernels | Pointers to the filter kernels for all data dimensions. The vector may contain NULL pointers for dimensions the filter should not be applied to. |
|
virtual |
Correlation of the data Array with the kernel along the specified dimension.
data | The data Array to correlate |
elementSizeUm | The voxel extents in micrometers |
filtered | The correlation result |
dim | The dimension along which to correlate |
Implements atb::SeparableFilter< DataT, Dim, DataT >.
|
virtual |
Correlate the given data Array with this filter.
data | The data Array to correlate |
elementSizeUm | The voxel extents in micrometers |
filtered | The correlation result |
Implements atb::Filter< DataT, Dim, DataT >.
|
static |
Correlate the data Array with the given kernels using the specified boundary treatment policy.
data | The data Array to correlate |
elementSizeUm | The voxel extents in micrometers |
filtered | The correlation result |
kernels | Pointers to the filter kernels for all data dimensions. The vector may contain NULL pointers for dimensions the filter should not be applied to. |
btType | The boundary treatment to apply |
boundaryValue | The out-of-Array value that should be used if btType == ValueBT |
|
static |
Correlate the data Array with the given kernels using the specified boundary treatment policy.
data | The data Array to correlate |
filtered | The correlation result |
kernels | Pointers to the filter kernels for all data dimensions. The vector may contain NULL pointers for dimensions the filter should not be applied to. |
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.