00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef IMG_ALG_DENSITY_SLICE_HH
00026 #define IMG_ALG_DENSITY_SLICE_HH
00027
00028 #include <ost/img/image_state.hh>
00029 #include <ost/img/image_state/image_state_algorithm.hh>
00030 #include <ost/img/alg/module_config.hh>
00031
00032
00033 namespace ost { namespace img { namespace alg {
00034
00035 struct DLLEXPORT_IMG_ALG SliceFnc {
00036 SliceFnc();
00037 explicit SliceFnc(Real l,Real u);
00038 explicit SliceFnc(const Complex& l, const Complex& u);
00039
00040 void SetThresholds(Real l,Real u);
00041 void SetThresholds(const Complex& l, const Complex& u);
00042
00043 template <typename T, class D>
00044 void VisitState(ImageStateImpl<T,D>& isi) const;
00045
00046 static String GetAlgorithmName() {return "DensitySlice";}
00047
00048 private:
00049 Real r_tl_;
00050 Real r_tu_;
00051 Complex c_tl_;
00052 Complex c_tu_;
00053
00054 void set_rl(Real f) {r_tl_=f; c_tl_=Val2Val<Real,Complex>(f);}
00055 void set_ru(Real f) {r_tu_=f; c_tu_=Val2Val<Real,Complex>(f);}
00056 void set_cl(const Complex& f) {c_tl_=f; r_tl_=Val2Val<Complex,Real>(f);}
00057 void set_cu(const Complex& f) {c_tu_=f; r_tu_=Val2Val<Complex,Real>(f);}
00058 };
00059
00060 typedef ImageStateConstModIPAlgorithm<SliceFnc> DensitySlice;
00061
00062 }
00063
00064 OST_IMG_ALG_EXPLICIT_INST_DECL(class,ImageStateConstModIPAlgorithm<alg::SliceFnc>)
00065
00066 }}
00067
00068 #endif