NorMIT-nav  18.04-rc6
An IGT application
cxTransferFunctionWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXTRANSFERFUNCTIONWIDGET_H_
13 #define CXTRANSFERFUNCTIONWIDGET_H_
14 
15 #include "cxGuiExport.h"
16 
17 #include "cxBaseWidget.h"
18 #include <QCheckBox>
19 #include <QDomElement>
20 #include "cxImage.h"
22 #include "cxDoublePropertyBase.h"
23 #include "cxActiveImageProxy.h"
24 
25 class QVBoxLayout;
26 class QComboBox;
27 class QStringList;
28 class QAction;
29 class QActionGroup;
30 
31 namespace cx
32 {
33 class TransferFunctionAlphaWidget;
34 class TransferFunctionColorWidget;
35 
45 {
46  Q_OBJECT
47 public:
50  virtual double getValue() const;
51  virtual bool setValue(double val);
52  virtual void connectValueSignals(bool on) {}
53 public:
54  void setImageTFData(ImageTFDataPtr tfData, ImagePtr image);
55 protected:
56  virtual double getValueInternal() const = 0;
57  virtual void setValueInternal(double val) = 0;
58 
61 };
62 typedef boost::shared_ptr<DoublePropertyImageTFDataBase> DoublePropertyImageTFDataBasePtr;
63 
64 
68 {
69 public:
71  virtual QString getDisplayName() const { return "Window width"; }
72  virtual double getValueInternal() const;
73  virtual void setValueInternal(double val);
74  virtual DoubleRange getValueRange() const;
75 };
76 
80 {
81  Q_OBJECT
82 public:
84  virtual QString getDisplayName() const { return "Window level"; }
85  virtual double getValueInternal() const;
86  virtual void setValueInternal(double val);
87  virtual DoubleRange getValueRange() const;
88 };
89 
93 {
94  Q_OBJECT
95 public:
97  virtual QString getDisplayName() const { return "LLR"; }
98  virtual double getValueInternal() const;
99  virtual void setValueInternal(double val);
100  virtual DoubleRange getValueRange() const;
101 };
102 
106 {
107  Q_OBJECT
108 public:
110  virtual QString getDisplayName() const { return "Alpha"; }
111  virtual double getValueInternal() const;
112  virtual void setValueInternal(double val);
113  virtual DoubleRange getValueRange() const;
114 };
115 
116 class cxGui_EXPORT TransferFunction3DWidget : public BaseWidget
117 {
118  Q_OBJECT
119 
120 public:
121  TransferFunction3DWidget(ActiveDataPtr activeData, QWidget* parent, bool connectToActiveImage = true);
123 
124 public slots:
125  void activeImageChangedSlot();
126 
127  void imageChangedSlot(ImagePtr image);
128 protected:
129  QVBoxLayout* mLayout;
132 
135 };
136 
137 class cxGui_EXPORT TransferFunction2DWidget : public BaseWidget
138 {
139  Q_OBJECT
140 
141 public:
142  TransferFunction2DWidget(ActiveDataPtr activeData, QWidget* parent, bool connectToActiveImage = true);
144 
145 public slots:
146  void activeImageChangedSlot();
147 
148 protected:
149  QVBoxLayout* mLayout;
152  DoublePropertyImageTFDataBasePtr mDataWindow, mDataAlpha, mDataLLR, mDataLevel;
153 
156 };
157 
158 
168 class cxGui_EXPORT TransferFunctionWidget : public BaseWidget
169 {
170  Q_OBJECT
171 
172 public:
173  TransferFunctionWidget(PatientModelServicePtr patientModelService, QWidget* parent, bool connectToActiveImage = true);
175 };
176 
180 }
181 
182 #endif /* CXTRANSFERFUNCTIONWIDGET_H_ */
virtual QString getDisplayName() const
name of data entity. Used for display to user.
TransferFunctionAlphaWidget * mTransferFunctionAlphaWidget
TransferFunctionColorWidget * mTransferFunctionColorWidget
Utility class for describing a bounded numeric range.
Definition: cxDoubleRange.h:32
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
TransferFunctionColorWidget * mTransferFunctionColorWidget
boost::shared_ptr< class ActiveImageProxy > ActiveImageProxyPtr
boost::shared_ptr< class ActiveData > ActiveDataPtr
Definition: cxColorWidget.h:21
TransferFunctionAlphaWidget * mTransferFunctionAlphaWidget
boost::shared_ptr< DoublePropertyImageTFDataBase > DoublePropertyImageTFDataBasePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
virtual QString getDisplayName() const
name of data entity. Used for display to user.
boost::shared_ptr< class ImageTFData > ImageTFDataPtr
DoublePropertyImageTFDataBasePtr mDataWindow
virtual QString getDisplayName() const
name of data entity. Used for display to user.
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Namespace for all CustusX production code.