iRoCS Toolbox  1.1.0
DericheFilter.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 /*======================================================================*/
29 /*======================================================================*/
30 
31 #ifndef ATBDERICHEFILTER_HH
32 #define ATBDERICHEFILTER_HH
33 
34 #ifdef HAVE_CONFIG_H
35 #include <config.hh>
36 #endif
37 
38 #include "SeparableFilter.hh"
39 #include "DericheFilter_base.hh"
40 
41 namespace atb
42 {
43 
44 /*======================================================================*/
72 /*======================================================================*/
73  template<typename DataT, int Dim>
74  class DericheFilter : public SeparableFilter<DataT,Dim,DataT>
75  {
76 
77  public:
78 
79  typedef DataT ResultT;
80 
81 /*======================================================================*/
91 /*======================================================================*/
94  DataT const &boundaryValue = traits<DataT>::zero);
95 
96 /*======================================================================*/
109 /*======================================================================*/
111  blitz::TinyVector<double,Dim> const &sigmaUm,
113  DataT const &boundaryValue = traits<DataT>::zero);
114 
115 /*======================================================================*/
119 /*======================================================================*/
120  virtual ~DericheFilter();
121 
122 /*======================================================================*/
131 /*======================================================================*/
132  double sigmaUmInDim(int dim) const;
133 
134 /*======================================================================*/
144 /*======================================================================*/
145  void setSigmaUmInDim(int dim, double sigmaUm);
146 
147 /*======================================================================*/
153 /*======================================================================*/
154  blitz::TinyVector<double,Dim> const &sigmaUm() const;
155 
156 /*======================================================================*/
164 /*======================================================================*/
165  void setSigmaUm(blitz::TinyVector<double,Dim> const &sigmaUm);
166 
167 /*======================================================================*/
177 /*======================================================================*/
178  void applyAlongDim(
179  blitz::Array<DataT,Dim> const &data,
180  blitz::TinyVector<double,Dim> const &elementSizeUm,
181  blitz::Array<DataT,Dim> &filtered, int dim,
182  iRoCS::ProgressReporter *pr = NULL) const;
183 
184  // Explicitly force the name mangler to also consider the base class
185  // implementation
187 
188 /*======================================================================*/
197 /*======================================================================*/
198  void apply(
199  blitz::Array<DataT,Dim> const &data,
200  blitz::TinyVector<double,Dim> const &elementSizeUm,
201  blitz::Array<DataT,Dim> &filtered,
202  iRoCS::ProgressReporter *pr = NULL) const;
203 
204  // Explicitly force the name mangler to also consider the base class
205  // implementation
207 
208 /*======================================================================*/
222 /*======================================================================*/
224  blitz::Array<DataT,Dim> const &data,
225  blitz::TinyVector<double,Dim> const &elementSizeUm,
226  blitz::Array<DataT,Dim> &filtered,
227  blitz::TinyVector<double,Dim> const &sigmaUm,
229  DataT const &boundaryValue = traits<DataT>::zero,
230  iRoCS::ProgressReporter *pr = NULL);
231 
232 /*======================================================================*/
245 /*======================================================================*/
247  Array<DataT,Dim> const &data,
248  Array<DataT,Dim> &filtered,
249  blitz::TinyVector<double,Dim> const &sigmaUm,
251  DataT const &boundaryValue = traits<DataT>::zero,
252  iRoCS::ProgressReporter *pr = NULL);
253 
254  private:
255 
256  blitz::TinyVector<double,Dim> _sigmaUm;
257 
258  };
259 
260 }
261 
262 #include "DericheFilter.icc"
263 
264 #endif
blitz::TinyVector< double, Dim > const & sigmaUm() const
Get the standard deviations of the Deriche filter.
virtual ~DericheFilter()
Destructor.
The Filter class is the base class for all filter implementations.
Definition: Filter.hh:55
void setSigmaUm(blitz::TinyVector< double, Dim > const &sigmaUm)
Set the standard deviations of the Deriche filter.
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
BoundaryTreatmentType
BoundaryTreatment.hh "libArrayToolbox/BoundaryTreatment.hh".
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 Deriche filter onto the data Array using the standard deviations passed to the fil...
The traits class provides means to query specific information about different data types...
Definition: TypeTraits.hh:73
The DericheFilter class implements the Deriche filter, which approximates a Gaussian filter using a r...
Implementation of the basic Deriche filter function approximating Gaussian filtering using recursion ...
DericheFilter(BoundaryTreatmentType btType=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
Constructor.
Filter Interface additions that apply to separable filters.
Treat positions beyond the Array domain as having a constant value.
void setSigmaUmInDim(int dim, double sigmaUm)
Set the standard deviation of the Deriche filter along the given dimension.
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 Deriche filter onto the data Array along the specified dimension.
double sigmaUmInDim(int dim) const
Get the standard deviation of the Deriche filter along the given dimension.