Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkAdaptiveRegionGrowingToolGUI.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef QMITK_QmitkAdaptiveRegionGrowingToolGUI_H
17 #define QMITK_QmitkAdaptiveRegionGrowingToolGUI_H
18 
19 #include "itkImage.h"
20 #include "mitkDataStorage.h"
21 #include "mitkGeometry3D.h"
22 #include "mitkPointSet.h"
23 
24 #include "qwidget.h"
25 #include "ui_QmitkAdaptiveRegionGrowingToolGUIControls.h"
26 
28 
29 #include "QmitkToolGUI.h"
30 
32 
34 class DataNode;
35 class QmitkAdaptiveRegionGrowingToolGUIControls;
36 
46 {
47  Q_OBJECT
48 
49 public:
54 
55  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
56 
57  QmitkAdaptiveRegionGrowingToolGUI(QWidget *parent = 0);
58 
61  virtual void CreateConnections();
62 
64  virtual void SetDataStorage(mitk::DataStorage *dataStorage);
65 
70  void SetMultiWidget(QmitkStdMultiWidget *multiWidget);
71 
78  void SetDataNodeNames(std::string labledSegmentation,
79  std::string binaryImage,
80  /*std::string vesselTree,*/ std::string surface,
81  std::string maskedSegmentation);
82 
89  void EnableControls(bool enable);
90 
95  void SetInputImageNode(mitk::DataNode *node);
96 
97  void Deactivated();
98  void Activated();
99 
103  Ui::QmitkAdaptiveRegionGrowingToolGUIControls m_Controls;
104 
105 protected slots:
106 
112  void RunSegmentation();
113 
120  void ChangeLevelWindow(double newValue);
121 
127  void IncreaseSlider();
128 
134  void DecreaseSlider();
135 
141  void ConfirmSegmentation();
142 
147  void UseVolumeRendering(bool on);
148 
155  void SetLowerThresholdValue(double lowerThreshold);
156 
163  void SetUpperThresholdValue(double upperThreshold);
164 
170  void OnNewToolAssociated(mitk::Tool *);
171 
172 protected:
174 
177 
178  // Pointer to the main widget to be able to reach the renderer
180 
182 
184 
188  void OnPointAdded();
189 
190 private:
191  std::string m_NAMEFORORGIMAGE;
192  std::string m_NAMEFORLABLEDSEGMENTATIONIMAGE;
193  std::string m_NAMEFORBINARYIMAGE;
194  std::string m_NAMEFORSURFACE;
195  std::string m_NAMEFORMASKEDSEGMENTATION;
196 
197  mitk::ScalarType m_LOWERTHRESHOLD; // Hounsfield value
198  mitk::ScalarType m_UPPERTHRESHOLD; // Hounsfield value
199  mitk::ScalarType m_SeedPointValueMean;
200 
201  void RemoveHelperNodes();
202 
203  int m_DetectedLeakagePoint;
204 
205  bool m_CurrentRGDirectionIsUpwards; // defines fixed threshold (true = LOWERTHRESHOLD fixed, false = UPPERTHRESHOLD
206  // fixed)
207 
208  int m_SeedpointValue;
209  bool m_SliderInitialized;
210  bool m_UseVolumeRendering;
211  bool m_UpdateSuggestedThreshold;
212  float m_SuggestedThValue;
213 
214  long m_PointSetAddObserverTag;
215  long m_PointSetMoveObserverTag;
216 
217  template <typename TPixel, unsigned int VImageDimension>
218  void StartRegionGrowing(itk::Image<TPixel, VImageDimension> *itkImage,
219  mitk::BaseGeometry *imageGeometry,
220  mitk::PointSet::PointType seedPoint);
221 
222  template <typename TPixel, unsigned int VImageDimension>
223  void ITKThresholding(itk::Image<TPixel, VImageDimension> *inputImage);
224 
225  void InitializeLevelWindow();
226 
227  void EnableVolumeRendering(bool enable);
228 
229  void UpdateVolumeRenderingThreshold(int thValue);
230 };
231 
232 #endif
Base class of all tools used by mitk::ToolManager.
Definition: mitkTool.h:92
Data management class that handles 'was created by' relations.
double ScalarType
Ui::QmitkAdaptiveRegionGrowingToolGUIControls m_Controls
The created GUI from the .ui-File. This Attribute is obligatory.
mitk::AdaptiveRegionGrowingTool::Pointer m_RegionGrow3DTool
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Base class for GUIs belonging to mitk::Tool classes.
Definition: QmitkToolGUI.h:36
static void ITKThresholding(itk::Image< TPixel, VImageDimension > *originalImage, mitk::Image *segmentation, double lower, double upper, unsigned int timeStep)
BaseGeometry Describes the geometry of a data object.
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
#define MITKSEGMENTATIONUI_EXPORT