OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
highest_peak_search_3d.hh
Go to the documentation of this file.
1 #ifndef OST_IMG_ALG_HIGHEST_PEAK_SEARCH_3D_H
2 #define OST_IMG_ALG_HIGHEST_PEAK_SEARCH_3D_H
3 
4 #include <vector>
5 
6 #include <ost/img/algorithm.hh>
7 #include <ost/img/peak.hh>
8 #include <ost/img/image_state.hh>
9 #include "module_config.hh"
10 
11 namespace ost { namespace img { namespace alg {
12 
14 {
15  public:
16 
18 
26  HighestPeakSearch3DBase(int max_num_peaks=10,
27  int exclusion_radius=10,
28  Real threshold=0):
29  max_num_peaks_(max_num_peaks),
30  exclusion_radius_(exclusion_radius),
31  threshold_(threshold)
32  {}
33 
35  template <typename T, class D>
36  void VisitState(const ImageStateImpl<T,D>& isi);
37 
38  void VisitFunction(const Function& f);
39 
40  static String GetAlgorithmName() {return "HighestPeakSearch3D";}
41 
43  PeakList GetPeakList() const { return peaks_;}
44 
46  void ClearPeakList() { peaks_.clear(); }
47 
48  private:
49 
50  typedef std::vector<Extent> ExtList;
51 
52  int max_num_peaks_;
53  int exclusion_radius_;
54  Real threshold_;
55  PeakList peaks_;
56  ExtList ext_list_;
57 
58  bool is_excluded(const Point& p)
59  {
60  for(ExtList::const_iterator it=ext_list_.begin();it!=ext_list_.end();++it)
61  {
62  if(it->Contains(p)) return true;
63  }
64  return false;
65  }
66 };
67 
68 // injection of base into algorithmic class
69 typedef ImageStateNonModAlgorithm<HighestPeakSearch3DBase> HighestPeakSearch3D;
70 
71 }
72 
73 OST_IMG_ALG_EXPLICIT_INST_DECL(class,ImageStateNonModAlgorithm<alg::HighestPeakSearch3DBase>)
74 }} // ns
75 
76 #endif // IPLT_ALG_DOCKING_HIGHEST_PEAK_SEARCH_3D_H