00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 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 QMITKLINEEDITLEVELWINDOWWIDGET 00019 #define QMITKLINEEDITLEVELWINDOWWIDGET 00020 00021 #include <QWidget> 00022 00023 #include <mitkLevelWindowManager.h> 00024 00025 class QmitkLevelWindowWidgetContextMenu; 00026 class QLineEdit; 00027 00036 class QMITK_EXPORT QmitkLineEditLevelWindowWidget : public QWidget { 00037 00038 Q_OBJECT 00039 00040 public: 00041 00043 QmitkLineEditLevelWindowWidget( QWidget * parent = 0, Qt::WindowFlags f = 0 ); 00044 00046 ~QmitkLineEditLevelWindowWidget(); 00047 00049 QLineEdit* m_LevelInput; 00050 00052 QLineEdit* m_WindowInput; 00053 00058 mitk::LevelWindow m_LevelWindow; 00059 00061 mitk::LevelWindowManager::Pointer m_Manager; 00062 00064 void setLevelWindowManager(mitk::LevelWindowManager* levelWindowManager); 00065 00067 void SetDataStorage( mitk::DataStorage* ds ); 00068 00070 mitk::LevelWindowManager* GetManager(); 00071 00072 private: 00073 00075 void contextMenuEvent ( QContextMenuEvent * ); 00076 00078 void OnPropertyModified(const itk::EventObject& e); 00079 00087 void validLevel(); 00088 00096 void validWindow(); 00097 00098 public slots: 00099 00101 void SetLevelValue(); 00102 00104 void SetWindowValue(); 00105 00106 // validator to accept only possible values for Level/Window in lineedits 00107 //void setValidator(); 00108 00109 protected: 00110 unsigned long m_ObserverTag; 00111 bool m_IsObserverTagSet; 00112 00116 QmitkLevelWindowWidgetContextMenu* m_Contextmenu; 00117 00118 }; 00119 #endif // QMITKLINEEDITLEVELWINDOWWIDGET