26 connect(m_XEditScalarOpacity, SIGNAL(textEdited(
const QString &)),
this, SLOT(
SetXValueScalar(
const QString &)));
27 connect(m_YEditScalarOpacity, SIGNAL(textEdited(
const QString &)),
this, SLOT(
SetYValueScalar(
const QString &)));
29 connect(m_XEditGradientOpacity, SIGNAL(textEdited(
const QString &)),
this, SLOT(
SetXValueGradient(
const QString &)));
30 connect(m_YEditGradientOpacity, SIGNAL(textEdited(
const QString &)),
this, SLOT(
SetYValueGradient(
const QString &)));
32 connect(m_XEditColor, SIGNAL(textEdited(
const QString &)),
this, SLOT(
SetXValueColor(
const QString &)));
34 m_RangeSlider->setMinimum(-2048);
35 m_RangeSlider->setMaximum(2048);
36 connect(m_RangeSlider, SIGNAL(valuesChanged(
int,
int)),
this, SLOT(
OnSpanChanged(
int,
int)));
39 connect(m_RangeSliderReset, SIGNAL(pressed()),
this, SLOT(
OnResetSlider()));
41 m_ScalarOpacityFunctionCanvas->SetQLineEdits(m_XEditScalarOpacity, m_YEditScalarOpacity);
42 m_GradientOpacityCanvas->SetQLineEdits(m_XEditGradientOpacity, m_YEditGradientOpacity);
43 m_ColorTransferFunctionCanvas->SetQLineEdits(m_XEditColor,
nullptr);
45 m_ScalarOpacityFunctionCanvas->SetTitle(
"Grayvalue -> Opacity");
46 m_GradientOpacityCanvas->SetTitle(
"Grayvalue/Gradient -> Opacity");
47 m_ColorTransferFunctionCanvas->SetTitle(
"Grayvalue -> Color");
56 m_textLabelX->setText(scalarLabel);
57 m_textLabelX_2->setText(scalarLabel);
58 m_textLabelX_3->setText(scalarLabel);
60 m_ScalarOpacityFunctionCanvas->SetTitle(scalarLabel +
" -> Opacity");
61 m_GradientOpacityCanvas->SetTitle(scalarLabel +
"/Gradient -> Opacity");
62 m_ColorTransferFunctionCanvas->SetTitle(scalarLabel +
" -> Color");
67 m_ScalarOpacityWidget->setVisible(show);
72 m_ColorWidget->setVisible(show);
77 m_GradientOpacityWidget->setVisible(show);
82 m_ScalarOpacityWidget->setEnabled(enable);
87 m_ColorWidget->setEnabled(enable);
92 m_GradientOpacityWidget->setEnabled(enable);
103 if (!dynamic_cast<mitk::Image *>(node->
GetData()))
105 MITK_WARN <<
"QmitkTransferFunctionWidget::SetDataNode called with non-image node";
121 m_RangeSlider->blockSignals(
true);
126 m_RangeSlider->blockSignals(
false);
128 m_ScalarOpacityFunctionCanvas->SetHistogram(h);
129 m_GradientOpacityCanvas->SetHistogram(h);
130 m_ColorTransferFunctionCanvas->SetHistogram(h);
140 m_ScalarOpacityFunctionCanvas->setEnabled(
false);
141 m_ScalarOpacityFunctionCanvas->SetHistogram(
nullptr);
142 m_GradientOpacityCanvas->setEnabled(
false);
143 m_GradientOpacityCanvas->SetHistogram(
nullptr);
144 m_ColorTransferFunctionCanvas->setEnabled(
false);
145 m_ColorTransferFunctionCanvas->SetHistogram(
nullptr);
159 m_ScalarOpacityFunctionCanvas->SetPiecewiseFunction(tf->GetScalarOpacityFunction());
160 m_GradientOpacityCanvas->SetPiecewiseFunction(tf->GetGradientOpacityFunction());
161 m_ColorTransferFunctionCanvas->SetColorTransferFunction(tf->GetColorTransferFunction());
165 m_ScalarOpacityFunctionCanvas->update();
166 m_GradientOpacityCanvas->update();
167 m_ColorTransferFunctionCanvas->update();
172 if (!text.endsWith(
"."))
174 m_ScalarOpacityFunctionCanvas->SetX(text.toFloat());
181 if (!text.endsWith(
"."))
183 m_ScalarOpacityFunctionCanvas->SetY(text.toFloat());
190 if (!text.endsWith(
"."))
192 m_GradientOpacityCanvas->SetX(text.toFloat());
199 if (!text.endsWith(
"."))
201 m_GradientOpacityCanvas->SetY(text.toFloat());
208 if (!text.endsWith(
"."))
210 m_ColorTransferFunctionCanvas->SetX(text.toFloat());
217 int lower = m_RangeSlider->minimumValue();
218 int upper = m_RangeSlider->maximumValue();
220 m_ScalarOpacityFunctionCanvas->SetMin(lower);
221 m_ScalarOpacityFunctionCanvas->SetMax(upper);
223 m_GradientOpacityCanvas->SetMin(lower);
224 m_GradientOpacityCanvas->SetMax(upper);
226 m_ColorTransferFunctionCanvas->SetMin(lower);
227 m_ColorTransferFunctionCanvas->SetMax(upper);
234 m_GradientOpacityCanvas->update();
235 m_ColorTransferFunctionCanvas->update();
236 m_ScalarOpacityFunctionCanvas->update();
241 m_RangeSlider->blockSignals(
true);
244 m_RangeSlider->blockSignals(
false);
247 m_GradientOpacityCanvas->update();
248 m_ColorTransferFunctionCanvas->update();
249 m_ScalarOpacityFunctionCanvas->update();
The TransferFunctionProperty class Property class for the mitk::TransferFunction. ...
Base of all data objects.
Organizes the rendering process.
virtual double GetMax() const =0
Returns the maximum value of the histogram.
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
mitk::BaseProperty * GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer=nullptr) const
Get the property (instance of BaseProperty) with key propertyKey from the PropertyList of the rendere...
virtual double GetMin() const =0
Returns the minimal value of the histogram.
Abstract superclass for histograms with double values. Classes which are deriving from this class can...
static RenderingManager * GetInstance()
void SetProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer=nullptr)
Set the property (instance of BaseProperty) with key propertyKey in the PropertyList of the renderer ...
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Class for nodes of the DataTree.