Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmlMitkImageNavigator.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 __QmlMitkImageNavigator_h
18 #define __QmlMitkImageNavigator_h
19 
20 #include "MitkQmlItemsExports.h"
23 
24 #include <mitkVector.h>
25 #include <QQuickItem>
26 #include <QQmlEngine>
27 
29 
43 class MITKQMLITEMS_EXPORT QmlMitkImageNavigator : public QQuickItem
44 {
45  Q_OBJECT
46  Q_PROPERTY(QmlMitkSliderNavigatorItem* navigatorAxial READ getNavigatorAxial WRITE setNavigatorAxial)
47  Q_PROPERTY(QmlMitkSliderNavigatorItem* navigatorSagittal READ getNavigatorSagittal WRITE setNavigatorSagittal)
48  Q_PROPERTY(QmlMitkSliderNavigatorItem* navigatorCoronal READ getNavigatorCoronal WRITE setNavigatorCoronal)
49  Q_PROPERTY(QmlMitkSliderNavigatorItem* navigatorTime READ getNavigatorTime WRITE setNavigatorTime)
50 
51  Q_PROPERTY(double worldCoordinateX READ getWorldCoordinateX WRITE setWorldCoordinateX)
52  Q_PROPERTY(double worldCoordinateY READ getWorldCoordinateY WRITE setWorldCoordinateY)
53  Q_PROPERTY(double worldCoordinateZ READ getWorldCoordinateZ WRITE setWorldCoordinateZ)
54 
55  Q_PROPERTY(double worldCoordinateXMin READ getWorldCoordinateXMin WRITE setWorldCoordinateXMin)
56  Q_PROPERTY(double worldCoordinateYMin READ getWorldCoordinateYMin WRITE setWorldCoordinateYMin)
57  Q_PROPERTY(double worldCoordinateZMin READ getWorldCoordinateZMin WRITE setWorldCoordinateZMin)
58 
59  Q_PROPERTY(double worldCoordinateXMax READ getWorldCoordinateXMax WRITE setWorldCoordinateXMax)
60  Q_PROPERTY(double worldCoordinateYMax READ getWorldCoordinateYMax WRITE setWorldCoordinateYMax)
61  Q_PROPERTY(double worldCoordinateZMax READ getWorldCoordinateZMax WRITE setWorldCoordinateZMax)
62 
63 private:
64  QmlMitkSliderNavigatorItem* m_NavigatorAxial;
65  QmlMitkSliderNavigatorItem* m_NavigatorSagittal;
66  QmlMitkSliderNavigatorItem* m_NavigatorCoronal;
67  QmlMitkSliderNavigatorItem* m_NavigatorTime;
68 
69  double m_WorldCoordinateX;
70  double m_WorldCoordinateY;
71  double m_WorldCoordinateZ;
72 
73  double m_WorldCoordinateXMin;
74  double m_WorldCoordinateYMin;
75  double m_WorldCoordinateZMin;
76 
77  double m_WorldCoordinateXMax;
78  double m_WorldCoordinateYMax;
79  double m_WorldCoordinateZMax;
80 
81 public:
82  static QmlMitkImageNavigator* instance;
83 
86 
87  static void create(QQmlEngine &engine);
88 
89  void setNavigatorAxial(QmlMitkSliderNavigatorItem* item);
90  void setNavigatorSagittal(QmlMitkSliderNavigatorItem* item);
91  void setNavigatorCoronal(QmlMitkSliderNavigatorItem* item);
92  void setNavigatorTime(QmlMitkSliderNavigatorItem* item);
93 
94  QmlMitkSliderNavigatorItem* getNavigatorAxial();
95  QmlMitkSliderNavigatorItem* getNavigatorSagittal();
96  QmlMitkSliderNavigatorItem* getNavigatorCoronal();
97  QmlMitkSliderNavigatorItem* getNavigatorTime();
98 
99  void setWorldCoordinateX(double coordinate);
100  void setWorldCoordinateY(double coordinate);
101  void setWorldCoordinateZ(double coordinate);
102 
103  void setWorldCoordinateXMin(double coordinate);
104  void setWorldCoordinateYMin(double coordinate);
105  void setWorldCoordinateZMin(double coordinate);
106 
107  void setWorldCoordinateXMax(double coordinate);
108  void setWorldCoordinateYMax(double coordinate);
109  void setWorldCoordinateZMax(double coordinate);
110 
111  double getWorldCoordinateX();
112  double getWorldCoordinateY();
113  double getWorldCoordinateZ();
114 
115  double getWorldCoordinateXMin();
116  double getWorldCoordinateYMin();
117  double getWorldCoordinateZMin();
118 
119  double getWorldCoordinateXMax();
120  double getWorldCoordinateYMax();
121  double getWorldCoordinateZMax();
122 
123 protected slots:
124  void initialize();
125  void OnMillimetreCoordinateValueChanged();
126  void OnRefetch();
127 
128 protected:
129  //void SetBorderColors();
130  //void SetBorderColor(QDoubleSpinBox *spinBox, QString colorAsStyleSheetString);
131  //void SetBorderColor(int axis, QString colorAsStyleSheetString);
132  void SetStepSizes();
133  void SetStepSize(int axis);
134  void SetStepSize(int axis, double stepSize);
135  int GetClosestAxisIndex(mitk::Vector3D normal);
136 
137  QmitkStepperAdapter* m_AxialStepper;
138  QmitkStepperAdapter* m_SagittalStepper;
139  QmitkStepperAdapter* m_FrontalStepper;
140  QmitkStepperAdapter* m_TimeStepper;
141 
147  //QString GetDecorationColorOfGeometry(QmlMitkRenderWindowItem *renderWindow);
148 signals:
149  void sync();
150 };
151 
152 #endif
#define MITKQMLITEMS_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Helper class to connect Qt-based navigators to instances of Stepper.
Vector< ScalarType, 3 > Vector3D
Definition: mitkVector.h:134
Provides a means to scan quickly through a dataset via Axial, Coronal and Sagittal sliders...