00001 #ifndef OST_IMG_ALG_HIGHEST_PEAK_SEARCH_3D_H
00002 #define OST_IMG_ALG_HIGHEST_PEAK_SEARCH_3D_H
00003
00004 #include <vector>
00005
00006 #include <ost/img/algorithm.hh>
00007 #include <ost/img/peak.hh>
00008 #include <ost/img/image_state.hh>
00009 #include "module_config.hh"
00010
00011 namespace ost { namespace img { namespace alg {
00012
00013 class DLLEXPORT_IMG_ALG HighestPeakSearch3DBase
00014 {
00015 public:
00016
00018
00026 HighestPeakSearch3DBase(int max_num_peaks=10,
00027 int exclusion_radius=10,
00028 Real threshold=0):
00029 max_num_peaks_(max_num_peaks),
00030 exclusion_radius_(exclusion_radius),
00031 threshold_(threshold)
00032 {}
00033
00035 template <typename T, class D>
00036 void VisitState(const ImageStateImpl<T,D>& isi);
00037
00038 static String GetAlgorithmName() {return "HighestPeakSearch3D";}
00039
00041 PeakList GetPeakList() const { return peaks_;}
00042
00044 void ClearPeakList() { peaks_.clear(); }
00045
00046 private:
00047
00048 typedef std::vector<Extent> ExtList;
00049
00050 int max_num_peaks_;
00051 int exclusion_radius_;
00052 Real threshold_;
00053 PeakList peaks_;
00054 ExtList ext_list_;
00055
00056 bool is_excluded(const Point& p)
00057 {
00058 for(ExtList::const_iterator it=ext_list_.begin();it!=ext_list_.end();++it)
00059 {
00060 if(it->Contains(p)) return true;
00061 }
00062 return false;
00063 }
00064 };
00065
00066
00067 typedef ImageStateNonModAlgorithm<HighestPeakSearch3DBase> HighestPeakSearch3D;
00068
00069 }
00070
00071 OST_IMG_ALG_EXPLICIT_INST_DECL(class,ImageStateNonModAlgorithm<alg::HighestPeakSearch3DBase>)
00072 }}
00073
00074 #endif // IPLT_ALG_DOCKING_HIGHEST_PEAK_SEARCH_3D_H