Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
14 #define _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
15 
16 #include <MitkToFUIExports.h>
17 #include "ui_QmitkToFVisualisationSettingsWidgetControls.h"
18 
19 #include "mitkDataNode.h"
20 // QT headers
21 #include <QWidget>
22 // vtk includes
23 #include <vtkColorTransferFunction.h>
24 
26 
34 class MITKTOFUI_EXPORT QmitkToFVisualisationSettingsWidget :public QWidget
35 {
36 
37  //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
38  Q_OBJECT
39 
40  public:
41 
42  static const std::string VIEW_ID;
43 
44  QmitkToFVisualisationSettingsWidget (QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
46 
47  /* @brief This method is part of the widget an needs not to be called seperately. */
48  virtual void CreateQtPartControl(QWidget *parent);
49  /* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
50  virtual void CreateConnections();
57  void Initialize(mitk::DataNode* distanceImageNode=nullptr, mitk::DataNode* amplitudeImageNode=nullptr,
58  mitk::DataNode* intensityImageNode=nullptr, mitk::DataNode* surfaceNode=nullptr);
59 
64  vtkColorTransferFunction* GetWidget1ColorTransferFunction();
69  vtkColorTransferFunction* GetWidget2ColorTransferFunction();
74  vtkColorTransferFunction* GetWidget3ColorTransferFunction();
79  vtkColorTransferFunction* GetSelectedColorTransferFunction();
83  int GetSelectedImageIndex();
84 
85 protected slots:
86  void OnShowAdvancedOptionsCheckboxChecked(bool checked);
87 
88  void OnSetXValueColor();
92  void OnResetSlider();
96  void OnSpanChanged (int lower, int upper);
100  void OnTransferFunctionReset();
104  void OnWidgetSelected(int index);
108  void OnRangeSliderMaxChanged();
112  void OnRangeSliderMinChanged();
116  void OnTransferFunctionTypeSelected(int index);
117 
118  protected:
119 
123  void UpdateCanvas();
127  void UpdateRanges();
128 
129  Ui::QmitkToFVisualisationSettingsWidgetControls* m_Controls;
130 
133 
138 
139  vtkColorTransferFunction* m_Widget1ColorTransferFunction;
140  vtkColorTransferFunction* m_Widget2ColorTransferFunction;
141  vtkColorTransferFunction* m_Widget3ColorTransferFunction;
142 
146 
147  private:
148 
152  void UpdateSurfaceProperty();
153 
154 
162  void ResetTransferFunction(vtkColorTransferFunction* colorTransferFunction, int type, double min, double max);
168  void ReinitTransferFunction(int widget, int type);
169 };
170 
171 #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...
The &#39;QmitkStdMultiWidget&#39; is a &#39;QmitkAbstractMultiWidget&#39; that is used to display multiple render win...
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:56
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:53
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:57