CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Loading...
Searching...
No Matches
ctkVTKDiscretizableColorTransferWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Library: CTK
4
5 Copyright (c) Kitware Inc.
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0.txt
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19=========================================================================*/
20
21#ifndef __ctkVTKDiscretizableColorTransferWidget_h
22#define __ctkVTKDiscretizableColorTransferWidget_h
23
24// CTK includes
25#include "ctkVisualizationVTKWidgetsExport.h"
26class ctkVTKDiscretizableColorTransferWidgetPrivate;
28
29// VTK includes
30#include <vtkSmartPointer.h>
31class vtkAlgorithmOutput;
32class vtkDiscretizableColorTransferFunction;
33class vtkImageAccumulate;
34class vtkPiecewiseFunction;
35class vtkScalarsToColors;
36
37// Qt includes
38#include <QWidget>
39class QCheckBox;
40class QLineEdit;
41class QSpinBox;
42class QToolButton;
43
44class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKDiscretizableColorTransferWidget: public QWidget
45{
46 Q_OBJECT
50 Q_PROPERTY(QColor viewBackgroundColor READ viewBackgroundColor WRITE setViewBackgroundColor)
51public:
52 explicit ctkVTKDiscretizableColorTransferWidget(QWidget* parent_ = CTK_NULLPTR);
54
62
64 {
67 VISIBLE
68 };
69
70 void copyColorTransferFunction(vtkScalarsToColors* ctf, bool useCtfRange = false);
71 vtkDiscretizableColorTransferFunction* discretizableColorTransferFunction() const;
72
76 void setLeftAxisMode(int mode);
78
79 void setHistogramConnection(vtkAlgorithmOutput* input);
80 void updateHistogram(bool updateDataRange);
81
82 void setViewBackgroundColor(const QColor& i_color);
83 QColor viewBackgroundColor() const;
84
86
87 void setVisibleRange(double min, double max);
90
91 void setColorTransferFunctionRange(double min, double max);
95
96 void setDataRange(double min, double max);
98
100
101signals:
103 void currentScalarsToColorsChanged(vtkDiscretizableColorTransferFunction* ctf);
104
105public slots:
107 void onPaletteIndexChanged(vtkScalarsToColors* ctf);
112 void onRangeSliderValueChange(double min, double max);
113
115 void setGlobalOpacity(double opacity);
117 void setDiscretize(bool checked);
119
120protected:
121 QScopedPointer<ctkVTKDiscretizableColorTransferWidgetPrivate> d_ptr;
122
125 double* getDataRange();
130
131private:
134};
135#endif // __ctkVTKDiscretizableColorTransferWidget_h
ctkVTKDiscretizableColorTransferWidget(QWidget *parent_=CTK_NULLPTR)
vtkDiscretizableColorTransferFunction * discretizableColorTransferFunction() const
void setHistogramConnection(vtkAlgorithmOutput *input)
void updateHistogram(bool updateDataRange)
void setViewBackgroundColor(const QColor &i_color)
QScopedPointer< ctkVTKDiscretizableColorTransferWidgetPrivate > d_ptr
void setVisibleRange(double min, double max)
void onRangeSliderValueChange(double min, double max)
void resetVisibleRange(ResetVisibleRange resetMode)
void setDataRange(double min, double max)
void resetColorTransferFunctionRange(ResetCTFRange resetMode)
ctkVTKScalarsToColorsComboBox * scalarsToColorsSelector() const
void onPaletteIndexChanged(vtkScalarsToColors *ctf)
void copyColorTransferFunction(vtkScalarsToColors *ctf, bool useCtfRange=false)
void currentScalarsToColorsChanged(vtkDiscretizableColorTransferFunction *ctf)
void setColorTransferFunctionRange(double min, double max)