CustusX  16.5.0-rc9
An IGT application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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) 2008-2014, SINTEF Department of Medical Technology
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11  this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14  this list of conditions and the following disclaimer in the documentation
15  and/or other materials provided with the distribution.
16 
17 3. Neither the name of the copyright holder nor the names of its contributors
18  may be used to endorse or promote products derived from this software
19  without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 =========================================================================*/
32 
33 #ifndef CXTRANSFERFUNCTIONWIDGET_H_
34 #define CXTRANSFERFUNCTIONWIDGET_H_
35 
36 #include "cxGuiExport.h"
37 
38 #include "cxBaseWidget.h"
39 #include <QCheckBox>
40 #include <QDomElement>
41 #include "cxImage.h"
43 #include "cxDoublePropertyBase.h"
44 #include "cxActiveImageProxy.h"
45 
46 class QVBoxLayout;
47 class QComboBox;
48 class QStringList;
49 class QAction;
50 class QActionGroup;
51 
52 namespace cx
53 {
54 class TransferFunctionAlphaWidget;
55 class TransferFunctionColorWidget;
56 
66 {
67  Q_OBJECT
68 public:
71  virtual double getValue() const;
72  virtual bool setValue(double val);
73  virtual void connectValueSignals(bool on) {}
74 public:
75  void setImageTFData(ImageTFDataPtr tfData, ImagePtr image);
76 protected:
77  virtual double getValueInternal() const = 0;
78  virtual void setValueInternal(double val) = 0;
79 
82 };
83 typedef boost::shared_ptr<DoublePropertyImageTFDataBase> DoublePropertyImageTFDataBasePtr;
84 
85 
89 {
90 public:
92  virtual QString getDisplayName() const { return "Window width"; }
93  virtual double getValueInternal() const;
94  virtual void setValueInternal(double val);
95  virtual DoubleRange getValueRange() const;
96 };
97 
101 {
102  Q_OBJECT
103 public:
105  virtual QString getDisplayName() const { return "Window level"; }
106  virtual double getValueInternal() const;
107  virtual void setValueInternal(double val);
108  virtual DoubleRange getValueRange() const;
109 };
110 
114 {
115  Q_OBJECT
116 public:
118  virtual QString getDisplayName() const { return "LLR"; }
119  virtual double getValueInternal() const;
120  virtual void setValueInternal(double val);
121  virtual DoubleRange getValueRange() const;
122 };
123 
127 {
128  Q_OBJECT
129 public:
131  virtual QString getDisplayName() const { return "Alpha"; }
132  virtual double getValueInternal() const;
133  virtual void setValueInternal(double val);
134  virtual DoubleRange getValueRange() const;
135 };
136 
137 class cxGui_EXPORT TransferFunction3DWidget : public BaseWidget
138 {
139  Q_OBJECT
140 
141 public:
142  TransferFunction3DWidget(ActiveDataPtr activeData, QWidget* parent, bool connectToActiveImage = true);
144 
145 public slots:
146  void activeImageChangedSlot();
147 
148  void imageChangedSlot(ImagePtr image);
149 protected:
150  QVBoxLayout* mLayout;
153 
156 };
157 
158 class cxGui_EXPORT TransferFunction2DWidget : public BaseWidget
159 {
160  Q_OBJECT
161 
162 public:
163  TransferFunction2DWidget(ActiveDataPtr activeData, QWidget* parent, bool connectToActiveImage = true);
165 
166 public slots:
167  void activeImageChangedSlot();
168 
169 protected:
170  QVBoxLayout* mLayout;
173  DoublePropertyImageTFDataBasePtr mDataWindow, mDataAlpha, mDataLLR, mDataLevel;
174 
177 };
178 
179 
189 class cxGui_EXPORT TransferFunctionWidget : public BaseWidget
190 {
191  Q_OBJECT
192 
193 public:
194  TransferFunctionWidget(PatientModelServicePtr patientModelService, QWidget* parent, bool connectToActiveImage = true);
196 };
197 
201 }
202 
203 #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:53
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:48
TransferFunctionColorWidget * mTransferFunctionColorWidget
boost::shared_ptr< class ActiveImageProxy > ActiveImageProxyPtr
boost::shared_ptr< class ActiveData > ActiveDataPtr
Definition: cxColorWidget.h:42
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:108
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.