OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
density_slice.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-2011 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  Author: Andreas Schenk
23 */
24 
25 #ifndef IMG_ALG_DENSITY_SLICE_HH
26 #define IMG_ALG_DENSITY_SLICE_HH
27 
28 #include <ost/img/image_state.hh>
31 
32 
33 namespace ost { namespace img { namespace alg {
34 
36  SliceFnc();
37  explicit SliceFnc(Real l,Real u);
38  explicit SliceFnc(const Complex& l, const Complex& u);
39 
40  void SetThresholds(Real l,Real u);
41  void SetThresholds(const Complex& l, const Complex& u);
42 
43  template <typename T, class D>
44  void VisitState(ImageStateImpl<T,D>& isi) const;
45 
46  static String GetAlgorithmName() {return "DensitySlice";}
47 
48 private:
49  Real r_tl_;
50  Real r_tu_;
51  Complex c_tl_;
52  Complex c_tu_;
53 
54  void set_rl(Real f) {r_tl_=f; c_tl_=Val2Val<Real,Complex>(f);}
55  void set_ru(Real f) {r_tu_=f; c_tu_=Val2Val<Real,Complex>(f);}
56  void set_cl(const Complex& f) {c_tl_=f; r_tl_=Val2Val<Complex,Real>(f);}
57  void set_cu(const Complex& f) {c_tu_=f; r_tu_=Val2Val<Complex,Real>(f);}
58 };
59 
60 typedef ImageStateConstModIPAlgorithm<SliceFnc> DensitySlice;
61 
62 }
63 
64 OST_IMG_ALG_EXPLICIT_INST_DECL(class,ImageStateConstModIPAlgorithm<alg::SliceFnc>)
65 
66 }} // ns
67 
68 #endif