iRoCS Toolbox  1.1.0
IsotropicPercentileFilter.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 /*======================================================================*/
54 /*======================================================================*/
55  template<typename DataT, int Dim>
56  class IsotropicPercentileFilter : public Filter<DataT,Dim,DataT>
57  {
58 
59  public:
60 
61  typedef DataT ResultT;
62 
63 /*======================================================================*/
73 /*======================================================================*/
75  double radiusUm = 1.0, double percentile = 50.0);
76 
77 /*======================================================================*/
81 /*======================================================================*/
83 
84 /*======================================================================*/
90 /*======================================================================*/
91  double filterRadiusUm() const;
92 
93 /*======================================================================*/
99 /*======================================================================*/
100  void setFilterRadiusUm(double radiusUm);
101 
102 /*======================================================================*/
108 /*======================================================================*/
109  double percentile() const;
110 
111 /*======================================================================*/
117 /*======================================================================*/
118  void setPercentile(double percentile);
119 
120 /*======================================================================*/
131 /*======================================================================*/
132  virtual void apply(
133  blitz::Array<DataT,Dim> const &data,
134  blitz::TinyVector<double,Dim> const &elementSizeUm,
135  blitz::Array<ResultT,Dim> &result,
136  iRoCS::ProgressReporter *pr = NULL) const;
137 
138  // Explicitly force the name mangler to also consider the base class
139  // implementation
141 
142 /*======================================================================*/
154 /*======================================================================*/
155  static void apply(
156  blitz::Array<DataT,Dim> const &data,
157  blitz::Array<ResultT,Dim> &filtered,
158  double radiusUm, iRoCS::ProgressReporter *pr = NULL);
159 
160  private:
161 
162  double _filterRadiusUm;
163  double _percentile;
164 
165  };
166 
167 }
168 
169 #include "IsotropicPercentileFilter.icc"
170 
171 #endif
Base class (Interface) for all Filter implementations.
The IsotropicPercentileFilter class implements the n-dimensional percentile filter.
The Filter class is the base class for all filter implementations.
Definition: Filter.hh:55
void setFilterRadiusUm(double radiusUm)
Set the filter radius in micrometers.
IsotropicPercentileFilter(double radiusUm=1.0, double percentile=50.0)
Constructor.
virtual ~IsotropicPercentileFilter()
Destructor.
double filterRadiusUm() const
Get the filter radius in micrometers.
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 percentile() const
Get the percentile.
void setPercentile(double percentile)
Set the percentile.