Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HistoImageCanvas.hh
1 #ifndef __HistoImageCanvas_hh__
2 #define __HistoImageCanvas_hh__
3 
4 #include <bias_config.h>
5 
6 #ifndef BIAS_HAVE_WXWIDGETS
7 # error BIAS_HAVE_WXWIDGETS not defined but required by HistoImageCanvas. Please enable BIAS_HAVE_WXWIDGETS in CMake configure step.
8 #endif
9 
10 #include <vector>
11 #include <wx/wx.h>
12 #include <Base/Image/Image.hh>
13 #include <Base/Common/BIASpragmaStart.hh>
14 #include <Base/Common/BIASpragmaEnd.hh>
15 
16 
17 namespace BIAS{
18 
19  /** @class Histogramm_float_Entry
20  @brief base class for storing computed histogramm information
21  in HistoCanvas
22  @author schiller */
24  public:
25  //Interval ends
26  float value_begin;
27  float value_end;
28  //Number of values in this interval
30  };
31 
32 
33  /** @class HistoImageCanvas
34  @brief It's a Canvas used to compute Histogram for current image
35  @status working
36  @author amattal
37  @date 03/2007 */
38  class BIASGui_EXPORT HistoImageCanvas : public wxPanel
39  {
40  public:
41  HistoImageCanvas(wxWindow* parent, wxStatusBar *sbar=NULL, int sbarid=0,
42  wxWindowID id = -1,
43  const wxPoint& pos = wxDefaultPosition,
44  const wxSize& size = wxSize(272, 216),
45  long style = wxTAB_TRAVERSAL,
46  const wxString& name = wxT("HistoImageCanvas"));
48 
49  void UpdateHistogramm(ImageBase image);
50  void NewImage(BIAS::ImageBase& im);
51  bool SameName(wxString name, bool settothenewone);
52  void RefitHistogramm();
53 
54  protected:
55 
56  void OnMouseLeave(wxMouseEvent&);
57  void OnMouseMove(wxMouseEvent &event);
58 
59  void UpdateStatusBar(unsigned mouseX, unsigned mouseY);
60 
61  void OnResize(wxSizeEvent & event);
62  void OnPaint(wxPaintEvent& event);
63 
64  wxBitmap *Bitmap_;
65  wxImage *wximage_;
68  wxStatusBar *SBar_;
69 
70  //indicates how wide should be 1 step of histogramm, when painted
71  //(in pixels), is set automatically when the histoframe is resized
72  wxCoord histoZoom_;
73 
74  int SBarID_;
75 
76  unsigned int mousex_, mousey_;
77 
78  int wwidth_, wheight_; // width & height of Window_
79 
80  wxMutex wxbitmap_mutex_, origim_mutex_;
81 
82  //----HISTOGRAMMS----
83  //Histogramm type:
84  // -1 - no histogramm computed
85  //
86  // 0 - unsigned char
87  // 1 - floating point (float)
89 
90  //Histogramm for float-images for each channel
91  //std::vector<std::vector<Histo_Entry_Float> > histo_float;
92  std::vector<std::vector<Histo_Entry_Float> > histo_float;
95 
98 
99  //Histogramm for unsigned char-images for each channel
100  std::vector<std::vector<int> > histo_UC;
101 
103 
104  std::vector<std::vector<float> > histo_percentage;
105  std::vector<float> histo_percentage_biggest;
106 
107  //count of pixels in an image with histogramm
109  //-------------------
110  wxString histo_name;
111 
112  DECLARE_EVENT_TABLE()
113  }; // class HistoImageCanvas
114 
115 } // namespace
116 
117 #endif // __HistoImageCanvas_hh__
std::vector< std::vector< Histo_Entry_Float > > histo_float
BIAS::Image< unsigned char > zim_
int value_count
std::vector< std::vector< int > > histo_UC
float value_end
It&#39;s a Canvas used to compute Histogram for current image working.
std::vector< float > histo_percentage_biggest
float value_begin
std::vector< std::vector< float > > histo_percentage
This is the base class for images in BIAS.
Definition: ImageBase.hh:102