iRoCS Toolbox  1.1.0
SeparableConvolutionFilter.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2015 Thorsten Falk
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 /*======================================================================*/
28 /*======================================================================*/
29 
30 #ifndef ATBSEPARABLECONVOLUTIONFILTER_HH
31 #define ATBSEPARABLECONVOLUTIONFILTER_HH
32 
33 #ifdef HAVE_CONFIG_H
34 #include <config.hh>
35 #endif
36 
38 
39 namespace atb
40 {
41 
42 /*======================================================================*/
56 /*======================================================================*/
57  template<typename DataT,int Dim>
58  class SeparableConvolutionFilter : public SeparableFilter<DataT,Dim,DataT>
59  {
60 
61  public:
62 
63  typedef DataT ResultT;
64 
65 /*======================================================================*/
75 /*======================================================================*/
78  DataT const &boundaryValue = traits<DataT>::zero);
79 
80 /*======================================================================*/
93 /*======================================================================*/
95  blitz::TinyVector<blitz::Array<DataT,1> *,Dim> const &kernels,
97  DataT const &boundaryValue = traits<DataT>::zero);
98 
99 /*======================================================================*/
103 /*======================================================================*/
105 
106 /*======================================================================*/
114 /*======================================================================*/
117  DataT const &boundaryValue = traits<DataT>::zero);
118 
119 /*======================================================================*/
125 /*======================================================================*/
127 
128 /*======================================================================*/
140 /*======================================================================*/
141  void setKernelForDim(blitz::Array<DataT,1> const *kernel, int dim);
142 
143 /*======================================================================*/
154 /*======================================================================*/
155  void setKernels(
156  blitz::TinyVector<blitz::Array<DataT,1> *,Dim> const &kernels);
157 
158 /*======================================================================*/
168 /*======================================================================*/
169  void applyAlongDim(
170  blitz::Array<DataT,Dim> const &data,
171  blitz::TinyVector<double,Dim> const &elementSizeUm,
172  blitz::Array<DataT,Dim> &filtered, int dim,
173  iRoCS::ProgressReporter *pr = NULL) const;
174 
175  // Explicitly force the name mangler to also consider the base class
176  // implementation
178 
179 /*======================================================================*/
187 /*======================================================================*/
188  void apply(
189  blitz::Array<DataT,Dim> const &data,
190  blitz::TinyVector<double,Dim> const &elementSizeUm,
191  blitz::Array<DataT,Dim> &filtered,
192  iRoCS::ProgressReporter *pr = NULL) const;
193 
194  // Explicitly force the name mangler to also consider the base class
195  // implementation
197 
198 /*======================================================================*/
213 /*======================================================================*/
214  static void apply(
215  blitz::Array<DataT,Dim> const &data,
216  blitz::TinyVector<double,Dim> const &elementSizeUm,
217  blitz::Array<DataT,Dim> &filtered,
218  blitz::TinyVector<blitz::Array<DataT,1> *,Dim> const &kernels,
220  DataT const &boundaryValue = traits<DataT>::zero,
221  iRoCS::ProgressReporter *pr = NULL);
222 
223 /*======================================================================*/
237 /*======================================================================*/
238  static void apply(
239  Array<DataT,Dim> const &data, Array<DataT,Dim> &filtered,
240  blitz::TinyVector<blitz::Array<DataT,1> *,Dim> const &kernels,
242  DataT const &boundaryValue = traits<DataT>::zero,
243  iRoCS::ProgressReporter *pr = NULL);
244 
245  private:
246 
248 
249  };
250 
251 }
252 
253 #include "SeparableConvolutionFilter.icc"
254 
255 #endif
The Filter class is the base class for all filter implementations.
Definition: Filter.hh:55
The SeparableFilter class specifies methods a separable filter provides additionally to the filter me...
The Array class is an extension to the blitz++ Array class providing additional parameters element si...
Definition: Array.hh:85
void setBoundaryTreatment(BoundaryTreatmentType bt, DataT const &boundaryValue=traits< DataT >::zero)
Change the boundary treatment type to the type specified.
BoundaryTreatmentType
BoundaryTreatment.hh "libArrayToolbox/BoundaryTreatment.hh".
Classes and functions for n-D separable correlation.
The traits class provides means to query specific information about different data types...
Definition: TypeTraits.hh:73
The SeparableConvolutionFilter class implements direct separable convolution.
The SeparableCorrelationFilter class implements direct separable correlation.
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
Convolution of the data Array along the specified dimension using the filter kernel given through the...
Treat positions beyond the Array domain as having a constant value.
void setKernels(blitz::TinyVector< blitz::Array< DataT, 1 > *, Dim > const &kernels)
Set the kernels for all data dimensions.
void apply(blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< DataT, Dim > &filtered, iRoCS::ProgressReporter *pr=NULL) const
Convolve the given data Array with this filter.
void setKernelForDim(blitz::Array< DataT, 1 > const *kernel, int dim)
Set the filtering kernel component for the specified dimension.
The BoundaryTreatment class provides the interface to all specific BoundaryTreatment subclasses...
SeparableConvolutionFilter(BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
Deafult Constructor.
~SeparableConvolutionFilter()
Destructor.