00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date: 2005/06/28 12:37:25 $ 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 http://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 QmitkSegmentationPostProcessing_h 00019 #define QmitkSegmentationPostProcessing_h 00020 00021 #include "QmitkFunctionality.h" 00022 #include "mitkDataStorage.h" 00023 #include "mitkToolManager.h" 00024 #include "mitkDataNodeSelection.h" 00025 00026 #include <QObject> 00027 00028 #include <berryISelectionListener.h> 00029 00037 class QmitkSegmentationPostProcessing : public QObject 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 00043 // construction/destruction 00044 QmitkSegmentationPostProcessing(mitk::DataStorage* storage, QmitkFunctionality* functionality, QObject* parent = 0); 00045 virtual ~QmitkSegmentationPostProcessing(); 00046 00047 // for receiving messages 00048 void OnSurfaceCalculationDone(); 00049 void OnThresholdingToolManagerToolModified(); 00050 void SelectionChanged(berry::IWorkbenchPart::Pointer sourcepart, berry::ISelection::ConstPointer selection); 00051 00052 protected slots: 00053 00054 // reactions to context menu items 00055 void ThresholdImage(bool); 00056 void CreateSurface(bool); 00057 void CreateSmoothedSurface(bool); 00058 void ImageStatistics(bool); 00059 void AutocropSelected(bool); 00060 00061 // class internal slots 00062 void ThresholdingDone(int); 00063 void InternalCreateSurface(bool smoothed); 00064 00065 protected: 00066 00067 typedef std::vector<mitk::DataNode*> NodeList; 00068 NodeList GetSelectedNodes() const; 00069 00070 mitk::Image::Pointer IncreaseCroppedImageSize( mitk::Image::Pointer image ); 00071 00072 // variables 00073 QmitkFunctionality* m_BlueBerryView; 00074 mitk::DataStorage::Pointer m_DataStorage; 00075 00076 QAction* m_CreateSurfaceAction; 00077 QAction* m_CreateSmoothSurfaceAction; 00078 QAction* m_StatisticsAction; 00079 QAction* m_AutocropAction; 00080 QAction* m_ThresholdAction; 00081 00082 QDialog* m_ThresholdingDialog; 00083 mitk::ToolManager::Pointer m_ThresholdingToolManager; 00084 00085 berry::ISelectionListener::Pointer m_SelectionListener; 00086 mitk::DataNodeSelection::ConstPointer m_CurrentSelection; 00087 friend struct berry::SelectionChangedAdapter<QmitkSegmentationPostProcessing>; 00088 }; 00089 00090 #endif 00091