30 , m_MitkDistanceImageNode(nullptr)
31 , m_MitkAmplitudeImageNode(nullptr)
32 , m_MitkIntensityImageNode(nullptr)
33 , m_Widget1ColorTransferFunction(nullptr)
34 , m_Widget2ColorTransferFunction(nullptr)
35 , m_Widget3ColorTransferFunction(nullptr)
36 , m_Widget1TransferFunctionType(1)
37 , m_Widget2TransferFunctionType(0)
38 , m_Widget3TransferFunctionType(0)
52 m_Controls =
new Ui::QmitkToFVisualisationSettingsWidgetControls;
62 connect( (QObject*)(
m_Controls->m_SelectWidgetCombobox), SIGNAL(currentIndexChanged(
int)),(QObject*)
this, SLOT(
OnWidgetSelected(
int)) );
76 m_Controls->m_ColorTransferFunctionCanvas->SetTitle(
"");
92 m_Controls->m_ColorTransferFunctionCanvas->update();
99 m_Controls->m_ColorTransferFunctionCanvas->update();
105 m_Controls->m_ColorTransferFunctionCanvas->update();
114 m_Controls->m_ColorTransferFunctionCanvas->update();
119 int lower =
m_Controls->m_RangeSlider->minimumValue();
120 int upper =
m_Controls->m_RangeSlider->maximumValue();
122 m_Controls->m_ColorTransferFunctionCanvas->SetMin(lower);
123 m_Controls->m_ColorTransferFunctionCanvas->SetMax(upper);
126 void QmitkToFVisualisationSettingsWidget::UpdateSurfaceProperty()
151 m_Controls->m_ColorTransferFunctionCanvas->setEnabled(
false);
155 m_Controls->m_ColorTransferFunctionCanvas->setEnabled(
true);
156 int numberOfImages = 0;
176 m_Controls->m_SelectWidgetCombobox->setMaxCount(numberOfImages);
178 this->ReinitTransferFunction(0,1);
179 this->ReinitTransferFunction(1,0);
180 this->ReinitTransferFunction(2,0);
187 m_Controls->m_ColorTransferFunctionCanvas->update();
192 int currentWidgetIndex =
m_Controls->m_SelectWidgetCombobox->currentIndex();
193 if (currentWidgetIndex == 0)
197 else if (currentWidgetIndex == 1)
201 else if (currentWidgetIndex == 2)
209 this->UpdateSurfaceProperty();
214 this->
m_Controls->m_MappingGroupBox->setVisible(checked);
215 this->
m_Controls->m_SelectTransferFunctionTypeCombobox->setVisible(checked);
216 this->
m_Controls->m_SelectWidgetCombobox->setVisible(checked);
217 this->
m_Controls->m_TransferFunctionResetButton->setVisible(checked);
222 int currentWidgetIndex = index;
227 if (currentWidgetIndex == 0)
235 else if (currentWidgetIndex == 1)
243 else if (currentWidgetIndex == 2)
251 else if (currentWidgetIndex == 3)
267 m_Controls->m_ColorTransferFunctionCanvas->update();
268 this->UpdateSurfaceProperty();
271 void QmitkToFVisualisationSettingsWidget::ResetTransferFunction(vtkColorTransferFunction* colorTransferFunction,
int type,
double min,
double max)
273 colorTransferFunction->RemoveAllPoints();
276 colorTransferFunction->AddRGBPoint(
min, 0, 0, 0);
277 colorTransferFunction->AddRGBPoint(max, 1, 1, 1);
283 colorTransferFunction->AddRGBPoint(0.0, 0, 0, 0);
284 colorTransferFunction->AddRGBPoint(
min-0.01, 0, 0, 0);
286 colorTransferFunction->AddRGBPoint(
min, 1, 0, 0);
287 colorTransferFunction->AddRGBPoint(
min+(max-
min)/2, 1, 1, 0);
288 colorTransferFunction->AddRGBPoint(max, 0, 0, 1);
290 colorTransferFunction->SetColorSpaceToHSV();
293 void QmitkToFVisualisationSettingsWidget::ReinitTransferFunction(
int widget,
int type)
317 if (amplitudeImage.IsNotNull())
337 if (intensityImage.IsNotNull())
355 this->UpdateSurfaceProperty();
360 int currentTransferFunctionTypeIndex =
m_Controls->m_SelectTransferFunctionTypeCombobox->currentIndex();
361 int currentWidgetIndex =
m_Controls->m_SelectWidgetCombobox->currentIndex();
363 this->ReinitTransferFunction(currentWidgetIndex,currentTransferFunctionTypeIndex);
372 m_Controls->m_ColorTransferFunctionCanvas->update();
373 this->UpdateSurfaceProperty();
393 int currentWidgetIndex =
m_Controls->m_SelectWidgetCombobox->currentIndex();
394 if (currentWidgetIndex==0)
398 else if (currentWidgetIndex==1)
402 else if (currentWidgetIndex==2)
414 return this->
m_Controls->m_SelectWidgetCombobox->currentIndex();
static RenderingManager * GetInstance()
Image class for storing images.
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Class for nodes of the DataTree.