iRoCS Toolbox  1.1.0
Filter.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 ATBFILTER_HH
31 #define ATBFILTER_HH
32 
33 #ifdef HAVE_CONFIG_H
34 #include <config.hh>
35 #endif
36 
37 #include "Array.hh"
38 #include "BoundaryTreatment.hh"
39 
41 
42 namespace atb
43 {
44 
45 /*======================================================================*/
53 /*======================================================================*/
54  template<typename DataT, int Dim, typename ResultT>
55  class Filter
56  {
57 
58  public:
59 
60 /*======================================================================*/
68 /*======================================================================*/
70  DataT const &boundaryValue = traits<DataT>::zero);
71 
72 /*======================================================================*/
76 /*======================================================================*/
77  virtual ~Filter();
78 
79 /*======================================================================*/
86 /*======================================================================*/
88 
89 /*======================================================================*/
97 /*======================================================================*/
100  DataT const &boundaryValue = traits<DataT>::zero);
101 
102 /*======================================================================*/
108 /*======================================================================*/
110 
111 /*======================================================================*/
124 /*======================================================================*/
125  virtual void apply(
126  blitz::Array<DataT,Dim> const &data,
127  blitz::TinyVector<double,Dim> const &elementSizeUm,
128  blitz::Array<ResultT,Dim> &result,
129  iRoCS::ProgressReporter *pr = NULL) const = 0;
130 
131 /*======================================================================*/
143 /*======================================================================*/
144  virtual void apply(
145  Array<DataT,Dim> const &data, Array<ResultT,Dim> &result,
146  iRoCS::ProgressReporter *pr = NULL) const;
147 
148  protected:
149 
150 /*======================================================================*/
158 /*======================================================================*/
160 
161  };
162 
163 }
164 
165 #include "Filter.icc"
166 
167 #endif
Array class derived from blitz++ Arrays for handling microscopic datasets with associated element siz...
BoundaryTreatment< DataT, Dim > const & boundaryTreatment() const
Get a read-only reference to the boundary treatment object associated with this filter.
The Filter class is the base class for all filter implementations.
Definition: Filter.hh:55
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".
Filter(BoundaryTreatmentType bt=ValueBT, DataT const &boundaryValue=traits< DataT >::zero)
Constructor.
The traits class provides means to query specific information about different data types...
Definition: TypeTraits.hh:73
virtual ~Filter()
Destructor.
Treat positions beyond the Array domain as having a constant value.
void setBoundaryTreatment(BoundaryTreatmentType bt, DataT const &boundaryValue=traits< DataT >::zero)
Change the boundary treatment type to the type specified.
BoundaryTreatment< DataT, Dim > * p_bt
The boundary treatment object to use for out-of-Array access.
Definition: Filter.hh:159
The BoundaryTreatment class provides the interface to all specific BoundaryTreatment subclasses...
Classes and functions for handling out-of-Array access.
virtual void apply(blitz::Array< DataT, Dim > const &data, blitz::TinyVector< double, Dim > const &elementSizeUm, blitz::Array< ResultT, Dim > &result, iRoCS::ProgressReporter *pr=NULL) const =0
Apply the filter to the given Array.