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  static String GetAlgorithmName() {return "HighestPeakSearch3D";}
39 
41  PeakList GetPeakList() const { return peaks_;}
42 
44  void ClearPeakList() { peaks_.clear(); }
45 
46  private:
47 
48  typedef std::vector<Extent> ExtList;
49 
50  int max_num_peaks_;
51  int exclusion_radius_;
52  Real threshold_;
53  PeakList peaks_;
54  ExtList ext_list_;
55 
56  bool is_excluded(const Point& p)
57  {
58  for(ExtList::const_iterator it=ext_list_.begin();it!=ext_list_.end();++it)
59  {
60  if(it->Contains(p)) return true;
61  }
62  return false;
63  }
64 };
65 
66 // injection of base into algorithmic class
67 typedef ImageStateNonModAlgorithm<HighestPeakSearch3DBase> HighestPeakSearch3D;
68 
69 }
70 
71 OST_IMG_ALG_EXPLICIT_INST_DECL(class,ImageStateNonModAlgorithm<alg::HighestPeakSearch3DBase>)
72 }} // ns
73 
74 #endif // IPLT_ALG_DOCKING_HIGHEST_PEAK_SEARCH_3D_H