36 #include "CImg_math.h"
37 #include "Cpeak_factory.h"
52 std::string class_name;
71 virtual void exec(CImg<T> &img)
86 virtual void peak_detection(CImg<T> &img) = 0;
88 void set_peakDim(CImg<T> &img)
95 if (!img.is_sameZ(1)){dim++;_3D = 1;}
97 for (
int i=0; i<dim; i++)
126 if (_3D){depth_0 = m_pos[2]-sig; depth_1 = m_pos[2]+sig;}
else{depth_0 = 0; depth_1 = 0;}
127 img.draw_rectangle(m_pos[0]-sig,m_pos[1]-sig,depth_0,0,m_pos[0]+sig,m_pos[1]+sig,depth_1,0,0,1);
132 void set_origin(CImg<T> &img)
137 m_pos[0] = img.width()/2-m_pos[0];
138 m_pos[1] = img.height()/2-m_pos[1];
139 if (_3D){m_pos[2] = img.depth()/2-m_pos[2];}
141 #ifdef cimg_use_fftw3 //FFtw flip image origin
142 for (
int i=0; i<m_pos.size(); i++){m_pos[i] = -m_pos[i];}
153 std::vector<T> stats;
156 stats.push_back(m_flag);
157 stats.push_back(m_mag);
159 for (
int i=0; i<m_pos.size(); i++){stats.push_back(m_pos[i]);}
This class localizes the most important peak within an image, removes it and provide peak statistics...
Definition: Cpeak.h:47
virtual void peak_delete(CImg< T > &img)
Definition: Cpeak.h:112
virtual void peak_accuracy(CImg< T > &img)
Definition: Cpeak.h:105
Cpeak()
Definition: Cpeak.h:60
std::vector< T > content()
Definition: Cpeak.h:147