Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkToFVisualisationSettingsWidget.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 
17 #ifndef _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
18 #define _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
19 
20 #include <MitkToFUIExports.h>
21 #include "ui_QmitkToFVisualisationSettingsWidgetControls.h"
22 
23 #include "mitkDataNode.h"
24 // QT headers
25 #include <QWidget>
26 // vtk includes
27 #include <vtkColorTransferFunction.h>
28 
30 
38 class MITKTOFUI_EXPORT QmitkToFVisualisationSettingsWidget :public QWidget
39 {
40 
41  //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
42  Q_OBJECT
43 
44  public:
45 
46  static const std::string VIEW_ID;
47 
48  QmitkToFVisualisationSettingsWidget (QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
50 
51  /* @brief This method is part of the widget an needs not to be called seperately. */
52  virtual void CreateQtPartControl(QWidget *parent);
53  /* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
54  virtual void CreateConnections();
61  void Initialize(mitk::DataNode* distanceImageNode=nullptr, mitk::DataNode* amplitudeImageNode=nullptr,
62  mitk::DataNode* intensityImageNode=nullptr, mitk::DataNode* surfaceNode=nullptr);
63 
68  vtkColorTransferFunction* GetWidget1ColorTransferFunction();
73  vtkColorTransferFunction* GetWidget2ColorTransferFunction();
78  vtkColorTransferFunction* GetWidget3ColorTransferFunction();
83  vtkColorTransferFunction* GetSelectedColorTransferFunction();
87  int GetSelectedImageIndex();
88 
89 protected slots:
90  void OnShowAdvancedOptionsCheckboxChecked(bool checked);
91 
92  void OnSetXValueColor();
96  void OnResetSlider();
100  void OnSpanChanged (int lower, int upper);
104  void OnTransferFunctionReset();
108  void OnWidgetSelected(int index);
112  void OnRangeSliderMaxChanged();
116  void OnRangeSliderMinChanged();
120  void OnTransferFunctionTypeSelected(int index);
121 
122  protected:
123 
127  void UpdateCanvas();
131  void UpdateRanges();
132 
133  Ui::QmitkToFVisualisationSettingsWidgetControls* m_Controls;
134 
137 
142 
143  vtkColorTransferFunction* m_Widget1ColorTransferFunction;
144  vtkColorTransferFunction* m_Widget2ColorTransferFunction;
145  vtkColorTransferFunction* m_Widget3ColorTransferFunction;
146 
150 
151  private:
152 
156  void UpdateSurfaceProperty();
157 
158 
166  void ResetTransferFunction(vtkColorTransferFunction* colorTransferFunction, int type, double min, double max);
172  void ReinitTransferFunction(int widget, int type);
173 };
174 
175 #endif // _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
int m_Widget3TransferFunctionType
member holding the type of the transfer function applied to the image shown in widget 3 (intensity im...
mitk::DataNode::Pointer m_MitkSurfaceNode
DataNode holding the surface.
Ui::QmitkToFVisualisationSettingsWidgetControls * m_Controls
mitk::DataNode::Pointer m_MitkDistanceImageNode
DataNode holding the range image of the ToF camera as set by Initialize()
vtkColorTransferFunction * m_Widget3ColorTransferFunction
vtkColorTransferFunction of widget 3 (intensity) that can be used to define a TransferFunctionPropert...
int m_RangeSliderMin
Minimal value of the transfer function range. Initialized to the minimal value of the corresponding i...
vtkColorTransferFunction * m_Widget1ColorTransferFunction
vtkColorTransferFunction of widget 1 (distance) that can be used to define a TransferFunctionProperty...
static T max(T x, T y)
Definition: svm.cpp:70
int m_RangeSliderMax
Maximal value of the transfer function range. Initialized to the maximal value of the corresponding i...
static T min(T x, T y)
Definition: svm.cpp:67
int m_Widget2TransferFunctionType
member holding the type of the transfer function applied to the image shown in widget 2 (amplitude im...
mitk::DataNode::Pointer m_MitkIntensityImageNode
DataNode holding the intensity image of the ToF camera as set by Initialize()
vtkColorTransferFunction * m_Widget2ColorTransferFunction
vtkColorTransferFunction of widget 2 (amplitude) that can be used to define a TransferFunctionPropert...
mitk::DataNode::Pointer m_MitkAmplitudeImageNode
DataNode holding the amplitude image of the ToF camera as set by Initialize()
int m_Widget1TransferFunctionType
member holding the type of the transfer function applied to the image shown in widget 1 (distance ima...
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66