34 , m_MitkDistanceImageNode(nullptr)
35 , m_MitkAmplitudeImageNode(nullptr)
36 , m_MitkIntensityImageNode(nullptr)
37 , m_Widget1ColorTransferFunction(nullptr)
38 , m_Widget2ColorTransferFunction(nullptr)
39 , m_Widget3ColorTransferFunction(nullptr)
40 , m_Widget1TransferFunctionType(1)
41 , m_Widget2TransferFunctionType(0)
42 , m_Widget3TransferFunctionType(0)
56 m_Controls =
new Ui::QmitkToFVisualisationSettingsWidgetControls;
66 connect( (QObject*)(
m_Controls->m_SelectWidgetCombobox), SIGNAL(currentIndexChanged(
int)),(QObject*)
this, SLOT(
OnWidgetSelected(
int)) );
80 m_Controls->m_ColorTransferFunctionCanvas->SetTitle(
"");
96 m_Controls->m_ColorTransferFunctionCanvas->update();
103 m_Controls->m_ColorTransferFunctionCanvas->update();
109 m_Controls->m_ColorTransferFunctionCanvas->update();
118 m_Controls->m_ColorTransferFunctionCanvas->update();
123 int lower =
m_Controls->m_RangeSlider->minimumValue();
124 int upper =
m_Controls->m_RangeSlider->maximumValue();
126 m_Controls->m_ColorTransferFunctionCanvas->SetMin(lower);
127 m_Controls->m_ColorTransferFunctionCanvas->SetMax(upper);
130 void QmitkToFVisualisationSettingsWidget::UpdateSurfaceProperty()
155 m_Controls->m_ColorTransferFunctionCanvas->setEnabled(
false);
159 m_Controls->m_ColorTransferFunctionCanvas->setEnabled(
true);
160 int numberOfImages = 0;
180 m_Controls->m_SelectWidgetCombobox->setMaxCount(numberOfImages);
182 this->ReinitTransferFunction(0,1);
183 this->ReinitTransferFunction(1,0);
184 this->ReinitTransferFunction(2,0);
191 m_Controls->m_ColorTransferFunctionCanvas->update();
196 int currentWidgetIndex =
m_Controls->m_SelectWidgetCombobox->currentIndex();
197 if (currentWidgetIndex == 0)
201 else if (currentWidgetIndex == 1)
205 else if (currentWidgetIndex == 2)
213 this->UpdateSurfaceProperty();
218 this->
m_Controls->m_MappingGroupBox->setVisible(checked);
219 this->
m_Controls->m_SelectTransferFunctionTypeCombobox->setVisible(checked);
220 this->
m_Controls->m_SelectWidgetCombobox->setVisible(checked);
221 this->
m_Controls->m_TransferFunctionResetButton->setVisible(checked);
226 int currentWidgetIndex = index;
231 if (currentWidgetIndex == 0)
239 else if (currentWidgetIndex == 1)
247 else if (currentWidgetIndex == 2)
255 else if (currentWidgetIndex == 3)
271 m_Controls->m_ColorTransferFunctionCanvas->update();
272 this->UpdateSurfaceProperty();
275 void QmitkToFVisualisationSettingsWidget::ResetTransferFunction(vtkColorTransferFunction* colorTransferFunction,
int type,
double min,
double max)
277 colorTransferFunction->RemoveAllPoints();
280 colorTransferFunction->AddRGBPoint(min, 0, 0, 0);
281 colorTransferFunction->AddRGBPoint(max, 1, 1, 1);
287 colorTransferFunction->AddRGBPoint(0.0, 0, 0, 0);
288 colorTransferFunction->AddRGBPoint(min-0.01, 0, 0, 0);
290 colorTransferFunction->AddRGBPoint(min, 1, 0, 0);
291 colorTransferFunction->AddRGBPoint(min+(max-min)/2, 1, 1, 0);
292 colorTransferFunction->AddRGBPoint(max, 0, 0, 1);
294 colorTransferFunction->SetColorSpaceToHSV();
297 void QmitkToFVisualisationSettingsWidget::ReinitTransferFunction(
int widget,
int type)
321 if (amplitudeImage.IsNotNull())
323 m_RangeSliderMin = amplitudeImage->GetStatistics()->GetScalarValueMin();
324 m_RangeSliderMax = amplitudeImage->GetStatistics()->GetScalarValueMax();
341 if (intensityImage.IsNotNull())
343 m_RangeSliderMin = intensityImage->GetStatistics()->GetScalarValueMin();
344 m_RangeSliderMax = intensityImage->GetStatistics()->GetScalarValueMax();
359 this->UpdateSurfaceProperty();
364 int currentTransferFunctionTypeIndex =
m_Controls->m_SelectTransferFunctionTypeCombobox->currentIndex();
365 int currentWidgetIndex =
m_Controls->m_SelectWidgetCombobox->currentIndex();
367 this->ReinitTransferFunction(currentWidgetIndex,currentTransferFunctionTypeIndex);
370 m_Controls->m_RangeSlider->setMinimum(m_RangeSliderMin - border);
371 m_Controls->m_RangeSlider->setMaximum(m_RangeSliderMax + border);
372 m_Controls->m_RangeSliderMinEdit->setText(QString(
"").setNum(m_RangeSliderMin - border));
373 m_Controls->m_RangeSliderMaxEdit->setText(QString(
"").setNum(m_RangeSliderMax + border));
374 m_Controls->m_RangeSlider->setRange( m_RangeSliderMin, m_RangeSliderMax);
376 m_Controls->m_ColorTransferFunctionCanvas->update();
377 this->UpdateSurfaceProperty();
397 int currentWidgetIndex =
m_Controls->m_SelectWidgetCombobox->currentIndex();
398 if (currentWidgetIndex==0)
402 else if (currentWidgetIndex==1)
406 else if (currentWidgetIndex==2)
418 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.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.