OpenStructure
gaussian.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2020 by the OpenStructure authors
5 // Copyright (C) 2003-2010 by the IPLT authors
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the Free
9 // Software Foundation; either version 3.0 of the License, or (at your option)
10 // any later version.
11 // This library is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 // details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //------------------------------------------------------------------------------
20 
21 
22 /*
23 
24  Authors: Giani Signorell, Ansgar Philippsen
25 
26 */
27 
28 
29 
30 #ifndef IMG_ALG_FILTER_GAUSSIAN_H
31 
32 #define IMG_ALG_FILTER_GAUSSIAN_H
33 
34 
35 
36 #include <ost/img/algorithm.hh>
37 
38 #include <ost/img/image_state.hh>
39 
41 
42 #include <ost/message.hh>
43 
44 
45 
46 #include <ost/dllexport.hh>
47 
48 #include "line_iterator.hh"
49 
50 
51 
52 namespace ost { namespace img { namespace alg {
53 
54 
55 
57 
71 
72 {
73 
74 public:
75 
77 
79 
80 
81 
82  template <typename T, class D>
83 
85 
86 
87 
89 
90  void SetSigma(Real sigma) {
91 
92  calcBVals( calcQ(sigma) );
93 
94  }
95 
97 
98  void SetQ(Real q) {
99 
100  calcBVals( q );
101 
102  }
103 
104  static String GetAlgorithmName() {return "GaussianFilter";}
105 
106 protected:
107 
108  Real b0_, b1_, b2_, b3_, bb_;
109 
110 
111 
112 private:
113 
114  Real calcQ( Real sigma );
115 
116  void calcBVals( Real q );
117 
118 
119 
120  template <typename T, class D>
121 
122  void lineTransformFW(ImageStateImpl<T,D>& s, ExtentIterator& it);
123 
124 
125 
126  template <typename T, class D>
127 
128  void lineTransformBW(ImageStateImpl<T,D>& s, ExtentIterator& it);
129 
130 };
131 
132 
133 
135 
136 
137 
138 }
139 
140 
141 
143 
144 
145 
146 }} // namespaces
147 
148 
149 
150 #endif
151 
GaussianFilterBase(Real sigma=1.0)
Initialization takes smoothing radius.
void SetQ(Real q)
Set q value directly.
Definition: gaussian.hh:98
void VisitState(ImageStateImpl< T, D > &s)
void SetSigma(Real sigma)
Set smoothing radius.
Definition: gaussian.hh:90
static String GetAlgorithmName()
Definition: gaussian.hh:104
in-place modifying image state visitor plus ip algorithm
#define DLLEXPORT_IMG_ALG
#define OST_IMG_ALG_EXPLICIT_INST_DECL(c, t)
float Real
Definition: base.hh:44
std::string String
Definition: base.hh:54
ImageStateModIPAlgorithm< GaussianFilterBase > GaussianFilter
Definition: gaussian.hh:134
Definition: base.dox:1