16 #include <QMessageBox> 19 #include <qlistwidget.h> 20 #include <qpushbutton.h> 27 m_Controls.setupUi(
this);
29 connect(m_Controls.previewButton, SIGNAL(clicked()),
this, SLOT(OnSpinboxValueAccept()));
30 connect(m_Controls.m_selectionListWidget, SIGNAL(itemSelectionChanged()),
this, SLOT(OnRegionSelectionChanged()));
31 connect(m_Controls.m_Spinbox, SIGNAL(valueChanged(
int)),
this, SLOT(OnRegionSpinboxChanged(
int)));
32 connect(m_Controls.m_ConfSegButton, SIGNAL(clicked()),
this, SLOT(OnSegmentationRegionAccept()));
33 connect(
this, SIGNAL(NewToolAssociated(
mitk::Tool *)),
this, SLOT(OnNewToolAssociated(
mitk::Tool *)));
34 connect(m_Controls.advancedSettingsButton, SIGNAL(toggled(
bool)),
this, SLOT(OnAdvancedSettingsButtonToggled(
bool)));
36 this->OnAdvancedSettingsButtonToggled(
false);
46 int curBinValue =
m_Controls.m_BinsSpinBox->value();
47 if (curBinValue < numberOfRegions)
48 m_Controls.m_BinsSpinBox->setValue(numberOfRegions);
65 QList<QListWidgetItem *>::Iterator it;
66 std::vector<int> regionIDs;
68 regionIDs.push_back((*it)->text().toInt());
74 void QmitkOtsuTool3DGUI::OnAdvancedSettingsButtonToggled(
bool toggled)
76 m_Controls.m_ValleyCheckbox->setVisible(toggled);
83 if (max >=
m_Controls.m_BinsSpinBox->minimum())
98 QString segName = QString::fromStdString(
m_OtsuTool3DTool->GetCurrentSegmentationName());
101 int result = dialog.exec();
133 QMessageBox *messageBox =
new QMessageBox(QMessageBox::Question,
135 "The otsu segmentation computation may take several minutes depending " 136 "on the number of Regions you selected. Proceed anyway?",
137 QMessageBox::Ok | QMessageBox::Cancel);
140 proceed = messageBox->exec();
141 if (proceed != QMessageBox::Ok)
149 this->setCursor(Qt::WaitCursor);
151 this->setCursor(Qt::ArrowCursor);
155 this->setCursor(Qt::ArrowCursor);
156 QMessageBox *messageBox =
157 new QMessageBox(QMessageBox::Critical,
159 "itkOtsuFilter error: image dimension must be in {2, 3} and no RGB images can be handled.");
166 QListWidgetItem *item;
168 for (
int i = 0; i <
m_Controls.m_Spinbox->value(); ++i)
170 itemName = QString::number(i);
171 item =
new QListWidgetItem(itemName);
172 m_Controls.m_selectionListWidget->addItem(item);
175 m_Controls.m_ConfSegButton->setEnabled(
false);
void SetSegmentationName(QString name)
#define MITKSEGMENTATIONUI_EXPORT