20 #include <QMessageBox>
23 #include <qlistwidget.h>
24 #include <qpushbutton.h>
31 m_Controls.setupUi(
this);
33 connect(m_Controls.previewButton, SIGNAL(clicked()),
this, SLOT(OnSpinboxValueAccept()));
34 connect(m_Controls.m_selectionListWidget, SIGNAL(itemSelectionChanged()),
this, SLOT(OnRegionSelectionChanged()));
35 connect(m_Controls.m_Spinbox, SIGNAL(valueChanged(
int)),
this, SLOT(OnRegionSpinboxChanged(
int)));
36 connect(m_Controls.m_ConfSegButton, SIGNAL(clicked()),
this, SLOT(OnSegmentationRegionAccept()));
37 connect(
this, SIGNAL(NewToolAssociated(
mitk::Tool *)),
this, SLOT(OnNewToolAssociated(
mitk::Tool *)));
38 connect(m_Controls.advancedSettingsButton, SIGNAL(toggled(
bool)),
this, SLOT(OnAdvancedSettingsButtonToggled(
bool)));
40 this->OnAdvancedSettingsButtonToggled(
false);
50 int curBinValue =
m_Controls.m_BinsSpinBox->value();
51 if (curBinValue < numberOfRegions)
52 m_Controls.m_BinsSpinBox->setValue(numberOfRegions);
69 QList<QListWidgetItem *>::Iterator it;
70 std::vector<int> regionIDs;
72 regionIDs.push_back((*it)->text().toInt());
78 void QmitkOtsuTool3DGUI::OnAdvancedSettingsButtonToggled(
bool toggled)
80 m_Controls.m_ValleyCheckbox->setVisible(toggled);
87 if (max >=
m_Controls.m_BinsSpinBox->minimum())
102 QString segName = QString::fromStdString(
m_OtsuTool3DTool->GetCurrentSegmentationName());
105 int result = dialog.exec();
137 QMessageBox *messageBox =
new QMessageBox(QMessageBox::Question,
139 "The otsu segmentation computation may take several minutes depending "
140 "on the number of Regions you selected. Proceed anyway?",
141 QMessageBox::Ok | QMessageBox::Cancel);
144 proceed = messageBox->exec();
145 if (proceed != QMessageBox::Ok)
153 this->setCursor(Qt::WaitCursor);
155 this->setCursor(Qt::ArrowCursor);
159 this->setCursor(Qt::ArrowCursor);
160 QMessageBox *messageBox =
161 new QMessageBox(QMessageBox::Critical,
163 "itkOtsuFilter error: image dimension must be in {2, 3} and no RGB images can be handled.");
170 QListWidgetItem *item;
172 for (
int i = 0; i <
m_Controls.m_Spinbox->value(); ++i)
174 itemName = QString::number(i);
175 item =
new QListWidgetItem(itemName);
176 m_Controls.m_selectionListWidget->addItem(item);
179 m_Controls.m_ConfSegButton->setEnabled(
false);
void SetSegmentationName(QString name)
#define MITKSEGMENTATIONUI_EXPORT