00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision: 1.12 $ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 #ifndef QMITKHistogramWidget_H_ 00019 #define QMITKHistogramWidget_H_ 00020 00021 #include <qlayout.h> 00022 #include "QmitkExtExports.h" 00023 #include <qtextedit.h> 00024 #include <qdialog.h> 00025 #include <qwt_plot.h> 00026 #include <qwt_plot_marker.h> 00027 #include <qwt_plot_zoomer.h> 00028 #include <qwt_plot_picker.h> 00029 00030 #include "QmitkHistogram.h" 00031 #include "mitkImage.h" 00032 00033 #include <itkHistogram.h> 00034 00041 class QmitkExt_EXPORT QmitkHistogramWidget: public QDialog 00042 { 00043 Q_OBJECT 00044 00045 public: 00046 00047 //overloaded constructor to choose between showing only the histogram or the histogram and the report 00048 QmitkHistogramWidget(QWidget *parent = 0, bool showreport = false); 00049 virtual ~QmitkHistogramWidget(); 00050 00051 typedef mitk::Image::HistogramType HistogramType; 00052 00058 void SetHistogram(HistogramType::ConstPointer histogram); 00059 void SetHistogram(mitk::Image* mitkImage); 00060 00061 void SetReport(std::string report); 00062 00063 double GetMarkerPosition(); 00064 00065 protected slots: 00066 00067 void OnSelect( const QwtDoublePoint &pos ); 00068 00069 protected: 00070 00071 // convenience fct. for rounding doubles to integral numbers 00072 double Round(double val); 00073 00074 void InitializeMarker(); 00075 void InitializeZoomer(); 00076 00077 QwtPlot* m_Plot; 00078 QTextEdit* m_Textedit; 00079 QwtPlotMarker* m_Marker; 00080 QwtPlotPicker* m_Picker; 00081 QwtPlotZoomer* m_Zoomer; 00082 QmitkHistogram* m_Histogram; 00083 }; 00084 00085 #endif /* QMITKHistogramWidget_H_ */ 00086