GOFIGURE2
0.9.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
Code
GUI
lib
TransferFunctionEditor
GoTransferFunctionWidget.h
Go to the documentation of this file.
1
/****************************************************************************
2
**
3
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4
** All rights reserved.
5
** Contact: Nokia Corporation (qt-info@nokia.com)
6
**
7
** This file is part of the demonstration applications of the Qt Toolkit.
8
**
9
** $QT_BEGIN_LICENSE:LGPL$
10
** Commercial Usage
11
** Licensees holding valid Qt Commercial licenses may use this file in
12
** accordance with the Qt Commercial License Agreement provided with the
13
** Software or, alternatively, in accordance with the terms contained in
14
** a written agreement between you and Nokia.
15
**
16
** GNU Lesser General Public License Usage
17
** Alternatively, this file may be used under the terms of the GNU Lesser
18
** General Public License version 2.1 as published by the Free Software
19
** Foundation and appearing in the file LICENSE.LGPL included in the
20
** packaging of this file. Please review the following information to
21
** ensure the GNU Lesser General Public License version 2.1 requirements
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23
**
24
** In addition, as a special exception, Nokia gives you certain additional
25
** rights. These rights are described in the Nokia Qt LGPL Exception
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27
**
28
** GNU General Public License Usage
29
** Alternatively, this file may be used under the terms of the GNU
30
** General Public License version 3.0 as published by the Free Software
31
** Foundation and appearing in the file LICENSE.GPL included in the
32
** packaging of this file. Please review the following information to
33
** ensure the GNU General Public License version 3.0 requirements will be
34
** met: http://www.gnu.org/copyleft/gpl.html.
35
**
36
** If you have questions regarding the use of this file, please contact
37
** Nokia at qt-info@nokia.com.
38
** $QT_END_LICENSE$
39
**
40
****************************************************************************/
41
42
/*=========================================================================
43
Modifications were made by the GoFigure Dev. Team.
44
while at Megason Lab, Systems biology, Harvard Medical school, 2009-11
45
46
Copyright (c) 2009-11, President and Fellows of Harvard College.
47
All rights reserved.
48
49
Redistribution and use in source and binary forms, with or without
50
modification, are permitted provided that the following conditions are met:
51
52
Redistributions of source code must retain the above copyright notice,
53
this list of conditions and the following disclaimer.
54
Redistributions in binary form must reproduce the above copyright notice,
55
this list of conditions and the following disclaimer in the documentation
56
// and/or other materials provided with the distribution.
57
Neither the name of the President and Fellows of Harvard College
58
nor the names of its contributors may be used to endorse or promote
59
products derived from this software without specific prior written
60
permission.
61
62
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
63
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
64
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
65
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
66
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
67
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
68
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
69
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
70
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
71
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
72
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73
74
=========================================================================*/
75
76
#ifndef __GoTransferFunctionWidget_h
77
#define __GoTransferFunctionWidget_h
78
79
#include <QtGui>
80
81
class
HoverPoints
;
82
83
// vtk
84
class
vtkLookupTable;
85
86
87
class
GoTransferFunctionWidget
:
public
QWidget
88
{
89
Q_OBJECT
90
public
:
91
92
GoTransferFunctionWidget
(
QColor
iColor,
93
double
iMax,
94
QWidget
*
parent
);
95
102
void
paintEvent
(
QPaintEvent
*e);
103
104
QSize
sizeHint
()
const
{
return
QSize
(150, 40); }
105
QPolygonF
points
()
const
;
106
107
113
void
AddPointsToOpacityTF
(
const
QPolygonF
& iPoints);
114
115
121
void
AddPointsToLUT
(
const
QPolygonF
& iPoints);
122
130
void
UpdateLookupTable
(vtkLookupTable* iLUT,
131
qreal iGamma, qreal iMin, qreal iMax);
132
136
void
SetHistogram
(
QVector<qreal>
iHistogram);
137
141
void
ResetOpacity
();
142
149
void
setColor
(
QColor
iColor);
150
154
void
setMax
(
double
iMax);
155
156
signals:
160
void
opacityChanged
();
161
165
void
enableOpacityTF
(
bool
);
166
170
void
enableLUTCurve
(
bool
);
171
172
private
:
176
void
generateShade
();
177
181
QColor
m_color
;
182
186
QImage
m_shade
;
187
191
HoverPoints
*
m_OpacityTFPoints
;
192
196
HoverPoints
*
m_LUTPoints
;
197
201
QVector<qreal>
m_Histogram
;
202
206
double
m_Max
;
207
};
208
209
#endif
QWidget
GoTransferFunctionWidget::m_Histogram
QVector< qreal > m_Histogram
the histogram
Definition:
GoTransferFunctionWidget.h:201
GoTransferFunctionWidget::sizeHint
QSize sizeHint() const
Definition:
GoTransferFunctionWidget.h:104
GoTransferFunctionWidget::enableLUTCurve
void enableLUTCurve(bool)
enable/disable LUT curve
GoTransferFunctionWidget::paintEvent
void paintEvent(QPaintEvent *e)
Paint event: 1- generate new shade is size of the widget changed 2- draw the shade 3- draw the histog...
Definition:
GoTransferFunctionWidget.cxx:126
GoTransferFunctionWidget::GoTransferFunctionWidget
GoTransferFunctionWidget(QColor iColor, double iMax, QWidget *parent)
Definition:
GoTransferFunctionWidget.cxx:85
HoverPoints
Definition:
hoverpoints.h:83
GoTransferFunctionWidget::AddPointsToOpacityTF
void AddPointsToOpacityTF(const QPolygonF &iPoints)
Add points to the opacity transfer function. Called at initialization or reset.
Definition:
GoTransferFunctionWidget.cxx:175
GoTransferFunctionWidget::opacityChanged
void opacityChanged()
Point added in the Opacity TF then update the visualization.
GoTransferFunctionWidget
Definition:
GoTransferFunctionWidget.h:87
GoTransferFunctionWidget::m_LUTPoints
HoverPoints * m_LUTPoints
LUT points.
Definition:
GoTransferFunctionWidget.h:196
GoTransferFunctionWidget::AddPointsToLUT
void AddPointsToLUT(const QPolygonF &iPoints)
Add points to the LUT. Called at initialization or reset.
Definition:
GoTransferFunctionWidget.cxx:187
GoTransferFunctionWidget::m_Max
double m_Max
Maximum pixel value in the current channel at given time point.
Definition:
GoTransferFunctionWidget.h:206
QColor
GoTransferFunctionWidget::UpdateLookupTable
void UpdateLookupTable(vtkLookupTable *iLUT, qreal iGamma, qreal iMin, qreal iMax)
Modify LUT with given parameters.
Definition:
GoTransferFunctionWidget.cxx:196
QSize
GoTransferFunctionWidget::m_OpacityTFPoints
HoverPoints * m_OpacityTFPoints
Opacity transfer function points.
Definition:
GoTransferFunctionWidget.h:191
QImage
GoTransferFunctionWidget::setMax
void setMax(double iMax)
Set maximum pixel intensity for current channel at current T point.
Definition:
GoTransferFunctionWidget.cxx:283
QVector< qreal >
GoTransferFunctionWidget::m_shade
QImage m_shade
Shade generated, based on the color.
Definition:
GoTransferFunctionWidget.h:186
GoTransferFunctionWidget::m_color
QColor m_color
Color of the current channel.
Definition:
GoTransferFunctionWidget.h:181
GoTransferFunctionWidget::setColor
void setColor(QColor iColor)
Set the color of the channel. 1- Modify the color 2- Update the shade 3- Update the visualization...
Definition:
GoTransferFunctionWidget.cxx:269
QPaintEvent
QObject::parent
QObject * parent() const
GoTransferFunctionWidget::generateShade
void generateShade()
Generate the shade when the color changed.
Definition:
GoTransferFunctionWidget.cxx:159
GoTransferFunctionWidget::SetHistogram
void SetHistogram(QVector< qreal > iHistogram)
Set the histogram.
Definition:
GoTransferFunctionWidget.cxx:244
GoTransferFunctionWidget::ResetOpacity
void ResetOpacity()
Reset the opacity TF from min to max, from 0 to 1.
Definition:
GoTransferFunctionWidget.cxx:253
GoTransferFunctionWidget::points
QPolygonF points() const
Definition:
GoTransferFunctionWidget.cxx:119
GoTransferFunctionWidget::enableOpacityTF
void enableOpacityTF(bool)
enable/disable opacity TF
QPolygonF
Generated on Fri Dec 13 2013 08:25:46 for GOFIGURE2 by
1.8.5