iRoCS Toolbox  1.1.0
IsotropicMedianFilter.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 ATBISOTROPICMEDIANFILTER_HH
31 #define ATBISOTROPICMEDIANFILTER_HH
32 
33 #ifdef HAVE_CONFIG_H
34 #include <config.hh>
35 #endif
36 
37 #include "Filter.hh"
38 
39 namespace atb
40 {
41 
42 /*======================================================================*/
48 /*======================================================================*/
49  template<typename DataT, int Dim>
50  class IsotropicMedianFilter : public Filter<DataT,Dim,DataT>
51  {
52 
53  public:
54 
55  typedef DataT ResultT;
56 
57 /*======================================================================*/
66 /*======================================================================*/
67  IsotropicMedianFilter(double radiusUm = 1.0);
68 
69 /*======================================================================*/
73 /*======================================================================*/
74  virtual ~IsotropicMedianFilter();
75 
76 /*======================================================================*/
82 /*======================================================================*/
83  double filterRadiusUm() const;
84 
85 /*======================================================================*/
91 /*======================================================================*/
92  void setFilterRadiusUm(double radiusUm);
93 
94 /*======================================================================*/
105 /*======================================================================*/
106  virtual void apply(
107  blitz::Array<DataT,Dim> const &data,
108  blitz::TinyVector<double,Dim> const &elementSizeUm,
109  blitz::Array<ResultT,Dim> &result,
110  iRoCS::ProgressReporter *pr = NULL) const;
111 
112  // Explicitly force the name mangler to also consider the base class
113  // implementation
115 
116 /*======================================================================*/
127 /*======================================================================*/
128  static void apply(
129  blitz::Array<DataT,Dim> const &data,
130  blitz::Array<ResultT,Dim> &filtered,
131  double radiusUm, iRoCS::ProgressReporter *pr = NULL);
132 
133  private:
134 
135  double _filterRadiusUm;
136 
137  };
138 
139 }
140 
141 #include "IsotropicMedianFilter.icc"
142 
143 #endif
Base class (Interface) for all Filter implementations.
The Filter class is the base class for all filter implementations.
Definition: Filter.hh:55
The IsotropicMedianFilter class implements the n-dimensional isotropic median filter.
void setFilterRadiusUm(double radiusUm)
Set the filter radius in micrometers.
virtual ~IsotropicMedianFilter()
Destructor.
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
Apply the filter to the given Array.
double filterRadiusUm() const
Get the filter radius in micrometers.
IsotropicMedianFilter(double radiusUm=1.0)
Constructor.