MCPcopy Create free account
hub / github.com/MITK/MITK / InitializeUI

Method InitializeUI

Modules/SegmentationUI/src/QmitkGrowCutToolGUI.cpp:49–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void QmitkGrowCutToolGUI::InitializeUI(QBoxLayout *mainLayout)
50{
51 auto wrapperWidget = new QWidget(this);
52 mainLayout->addWidget(wrapperWidget);
53 m_Controls->setupUi(wrapperWidget);
54
55 this->OnAdvancedSettingsButtonToggled(false);
56
57 std::function<bool()> isPreviewAvailable;
58 isPreviewAvailable = [this]()
59 {
60 auto tool = this->GetConnectedToolAs<mitk::GrowCutTool>();
61 if (nullptr != tool)
62 {
63 return tool->SeedImageIsValid();
64 }
65 return false;
66 };
67
68 auto previewAvailable = isPreviewAvailable();
69 m_Controls->m_previewButton->setEnabled(previewAvailable);
70 m_Controls->m_warningLabel->setVisible(!previewAvailable);
71
72 connect(m_Controls->m_previewButton, &QPushButton::clicked, this, &QmitkGrowCutToolGUI::OnPreviewBtnClicked);
73 connect(m_Controls->m_advancedSettingsButton,
74 &ctkExpandButton::toggled,
75 this,
76 &QmitkGrowCutToolGUI::OnAdvancedSettingsButtonToggled);
77
78 connect(m_Controls->m_distancePenaltyDoubleSpinBox,
79 qOverload<double>(&QDoubleSpinBox::valueChanged),
80 this,
81 &QmitkGrowCutToolGUI::SetValueOfDistancePenaltySlider);
82
83 connect(m_Controls->m_distancePenaltySlider,
84 &QSlider::valueChanged,
85 this,
86 &QmitkGrowCutToolGUI::SetValueOfDistancePenaltyDoubleSpinBox);
87
88 Superclass::InitializeUI(mainLayout);
89}
90
91void QmitkGrowCutToolGUI::SetValueOfDistancePenaltySlider(double val)
92{

Callers

nothing calls this directly

Calls 3

SeedImageIsValidMethod · 0.80
setEnabledMethod · 0.45

Tested by

no test coverage detected