iRoCS Toolbox  1.1.0
CentralGradientFilter.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 ATBCENTRALGRADIENTFILTER_HH
32 #define ATBCENTRALGRADIENTFILTER_HH
33 
34 #ifdef HAVE_CONFIG_H
35 #include <config.hh>
36 #endif
37 
38 #include "SeparableFilter.hh"
39 
40 namespace atb
41 {
42 
43 /*======================================================================*/
49 /*======================================================================*/
50  template<typename DataT, int Dim>
52  public SeparableFilter< DataT,Dim,blitz::TinyVector<DataT,Dim> >
53  {
54 
55  public:
56 
57  typedef blitz::TinyVector<DataT,Dim> ResultT;
58 
60 
61 /*======================================================================*/
70 /*======================================================================*/
73  DataT const &boundaryValue = traits<DataT>::zero);
74 
75 /*======================================================================*/
84 /*======================================================================*/
87  DataT const &boundaryValue = traits<DataT>::zero);
88 
89 /*======================================================================*/
93 /*======================================================================*/
94  virtual ~CentralGradientFilter();
95 
96 /*======================================================================*/
103 /*======================================================================*/
104  Accuracy accuracy() const;
105 
106 /*======================================================================*/
113 /*======================================================================*/
114  void setAccuracy(Accuracy accuracy);
115 
116 /*======================================================================*/
125 /*======================================================================*/
126  virtual void applyAlongDim(
127  blitz::Array<DataT,Dim> const &data,
128  blitz::TinyVector<double,Dim> const &elementSizeUm,
129  blitz::Array<DataT,Dim> &filtered, int dim,
130  iRoCS::ProgressReporter *pr = NULL) const;
131 
132 /*======================================================================*/
141 /*======================================================================*/
142  virtual void applyAlongDim(
143  blitz::Array<DataT,Dim> const &data,
144  blitz::TinyVector<double,Dim> const &elementSizeUm,
145  blitz::Array<ResultT,Dim> &filtered, int dim,
146  iRoCS::ProgressReporter *pr = NULL) const;
147 
148  // Explicitly force the name mangler to also consider the base class
149  // implementation
151 
152 /*======================================================================*/
163 /*======================================================================*/
164  virtual void apply(
165  blitz::Array<DataT,Dim> const &data,
166  blitz::TinyVector<double,Dim> const &elementSizeUm,
167  blitz::Array<ResultT,Dim> &filtered,
168  iRoCS::ProgressReporter *pr = NULL) const;
169 
170  // Explicitly force the name mangler to also consider the base class
171  // implementation
173 
174 /*======================================================================*/
189 /*======================================================================*/
190  static void apply(
191  blitz::Array<DataT,Dim> const &data,
192  blitz::TinyVector<double,Dim> const &elementSizeUm,
193  blitz::Array<ResultT,Dim> &filtered,
194  Accuracy accuracy,
196  DataT const &boundaryValue = traits<DataT>::zero,
197  iRoCS::ProgressReporter *pr = NULL);
198 
199 /*======================================================================*/
216 /*======================================================================*/
217  static void apply(
218  Array<DataT,Dim> const &data, Array<ResultT,Dim> &filtered,
219  Accuracy accuracy,
221  DataT const &boundaryValue = traits<DataT>::zero,
222  iRoCS::ProgressReporter *pr = NULL);
223 
224  private:
225 
226  Accuracy _accuracy;
227 
228  };
229 
230 }
231 
232 #include "CentralGradientFilter.icc"
233 
234 #endif
virtual 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
Apply the filter along the specified dimension.
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
virtual void apply(blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< ResultT, Dim > &filtered, iRoCS::ProgressReporter *pr=NULL) const
Apply the filter to the given Array.
BoundaryTreatmentType
BoundaryTreatment.hh "libArrayToolbox/BoundaryTreatment.hh".
The traits class provides means to query specific information about different data types...
Definition: TypeTraits.hh:73
virtual ~CentralGradientFilter()
Destructor.
Filter Interface additions that apply to separable filters.
CentralGradientFilter(BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
Default Constructor.
Treat positions beyond the Array domain as having a constant value.
Accuracy accuracy() const
Get the order of accuracy of this filter.
blitz::TinyVector< DataT, Dim > ResultT
void setAccuracy(Accuracy accuracy)
Set the order of accuracy of this filter.
The CentralGradientFilter class implements the SeparableFilter interface and provides gradient comput...