OpenStructure
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
68 
69 }
70 
72 }} // ns
73 
74 #endif // IPLT_ALG_DOCKING_HIGHEST_PEAK_SEARCH_3D_H
class encapsulating 1D to 3D point
Definition: point.hh:47
PeakList GetPeakList() const
Main "return" function returns a list of Peaks.
void ClearPeakList()
Clears the peak list removing all peaks in the list.
void VisitState(const ImageStateImpl< T, D > &isi)
image state algorithm interface
HighestPeakSearch3DBase(int max_num_peaks=10, int exclusion_radius=10, Real threshold=0)
Initialization.
non-modifying image state visitor plus non-mod 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
ImageStateNonModAlgorithm< HighestPeakSearch3DBase > HighestPeakSearch3D
std::vector< Peak > PeakList
Definition: peak.hh:46
Definition: base.dox:1