NorMIT-nav  22.09
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_ */
cx::DoublePropertyImageTFDataAlpha
Definition: cxTransferFunctionWidget.h:105
cx::DoublePropertyImageTFDataBase
Definition: cxTransferFunctionWidget.h:44
cx::DoublePropertyImageTFDataLLR::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxTransferFunctionWidget.h:97
cx::DoublePropertyImageTFDataLLR::~DoublePropertyImageTFDataLLR
virtual ~DoublePropertyImageTFDataLLR()
Definition: cxTransferFunctionWidget.h:96
cx::DoublePropertyImageTFDataBase::~DoublePropertyImageTFDataBase
virtual ~DoublePropertyImageTFDataBase()
Definition: cxTransferFunctionWidget.h:49
cx::TransferFunction2DWidget
Definition: cxTransferFunctionWidget.h:137
cxBaseWidget.h
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cx::TransferFunction3DWidget::~TransferFunction3DWidget
virtual ~TransferFunction3DWidget()
Definition: cxTransferFunctionWidget.h:122
cx::TransferFunction2DWidget::mActiveData
ActiveDataPtr mActiveData
Definition: cxTransferFunctionWidget.h:155
cxTransferFunctions3DPresets.h
cx::BaseWidget
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
cxImage.h
cx::TransferFunction3DWidget::mTransferFunctionColorWidget
TransferFunctionColorWidget * mTransferFunctionColorWidget
Definition: cxTransferFunctionWidget.h:131
cxDoublePropertyBase.h
cx::ImageTFDataPtr
boost::shared_ptr< class ImageTFData > ImageTFDataPtr
Definition: cxForwardDeclarations.h:52
cx::DoublePropertyImageTFDataWindow::~DoublePropertyImageTFDataWindow
virtual ~DoublePropertyImageTFDataWindow()
Definition: cxTransferFunctionWidget.h:70
cx::DoublePropertyImageTFDataBasePtr
boost::shared_ptr< DoublePropertyImageTFDataBase > DoublePropertyImageTFDataBasePtr
Definition: cxTransferFunctionWidget.h:62
cx::TransferFunction2DWidget::mTransferFunctionColorWidget
TransferFunctionColorWidget * mTransferFunctionColorWidget
Definition: cxTransferFunctionWidget.h:151
cxActiveImageProxy.h
cx::TransferFunctionWidget
Definition: cxTransferFunctionWidget.h:168
cx::TransferFunction3DWidget::mLayout
QVBoxLayout * mLayout
Definition: cxTransferFunctionWidget.h:129
cx::DoublePropertyImageTFDataWindow::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxTransferFunctionWidget.h:71
cx::TransferFunction3DWidget::mActiveData
ActiveDataPtr mActiveData
Definition: cxTransferFunctionWidget.h:134
cx::TransferFunctionColorWidget
Definition: cxTransferFunctionColorWidget.h:37
cx::ActiveImageProxyPtr
boost::shared_ptr< class ActiveImageProxy > ActiveImageProxyPtr
Definition: cxDataInterface.h:29
cx::DoublePropertyImageTFDataLevel::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxTransferFunctionWidget.h:84
cx::TransferFunction3DWidget::mTransferFunctionAlphaWidget
TransferFunctionAlphaWidget * mTransferFunctionAlphaWidget
Definition: cxTransferFunctionWidget.h:130
cx::TransferFunction2DWidget::mTransferFunctionAlphaWidget
TransferFunctionAlphaWidget * mTransferFunctionAlphaWidget
Definition: cxTransferFunctionWidget.h:150
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::ImagePtr
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
cx::DoublePropertyImageTFDataAlpha::~DoublePropertyImageTFDataAlpha
virtual ~DoublePropertyImageTFDataAlpha()
Definition: cxTransferFunctionWidget.h:109
cx::TransferFunctionAlphaWidget
Definition: cxTransferFunctionAlphaWidget.h:37
cx::DoublePropertyImageTFDataLLR
Definition: cxTransferFunctionWidget.h:92
cx::TransferFunction2DWidget::mLayout
QVBoxLayout * mLayout
Definition: cxTransferFunctionWidget.h:149
cx::DoublePropertyBase
Definition: cxDoublePropertyBase.h:70
cx::TransferFunction2DWidget::~TransferFunction2DWidget
virtual ~TransferFunction2DWidget()
Definition: cxTransferFunctionWidget.h:143
cx::DoublePropertyImageTFDataBase::connectValueSignals
virtual void connectValueSignals(bool on)
Definition: cxTransferFunctionWidget.h:52
cx::DoubleRange
Utility class for describing a bounded numeric range.
Definition: cxDoubleRange.h:32
cx::TransferFunctionWidget::~TransferFunctionWidget
virtual ~TransferFunctionWidget()
Definition: cxTransferFunctionWidget.h:174
cx::TransferFunction2DWidget::mDataWindow
DoublePropertyImageTFDataBasePtr mDataWindow
Definition: cxTransferFunctionWidget.h:152
cx::ActiveDataPtr
boost::shared_ptr< class ActiveData > ActiveDataPtr
Definition: cxColorWidget.h:21
cx::DoublePropertyImageTFDataAlpha::getDisplayName
virtual QString getDisplayName() const
name of data entity. Used for display to user.
Definition: cxTransferFunctionWidget.h:110
cx::TransferFunction2DWidget::mActiveImageProxy
ActiveImageProxyPtr mActiveImageProxy
Definition: cxTransferFunctionWidget.h:154
cx::TransferFunction3DWidget
Definition: cxTransferFunctionWidget.h:116
cx::DoublePropertyImageTFDataBase::mImageTFData
ImageTFDataPtr mImageTFData
Definition: cxTransferFunctionWidget.h:59
cx::DoublePropertyImageTFDataWindow
Definition: cxTransferFunctionWidget.h:67
cx::DoublePropertyImageTFDataLevel
Definition: cxTransferFunctionWidget.h:79
cx::DoublePropertyImageTFDataLevel::~DoublePropertyImageTFDataLevel
virtual ~DoublePropertyImageTFDataLevel()
Definition: cxTransferFunctionWidget.h:83
cx::DoublePropertyImageTFDataBase::mImage
ImagePtr mImage
Definition: cxTransferFunctionWidget.h:60
cx::TransferFunction3DWidget::mActiveImageProxy
ActiveImageProxyPtr mActiveImageProxy
Definition: cxTransferFunctionWidget.h:133