19 #include <QApplication> 21 #include <QMessageBox> 22 #include <ctkRangeWidget.h> 23 #include <ctkSliderWidget.h> 26 #include <qpushbutton.h> 32 this->setContentsMargins(0, 0, 0, 0);
35 QVBoxLayout *widgetLayout =
new QVBoxLayout(
this);
36 widgetLayout->setContentsMargins(0, 0, 0, 0);
39 fntHelp.setBold(
true);
41 QLabel *lblHelp =
new QLabel(
this);
42 lblHelp->setText(
"Press shift-click to add seeds repeatedly.");
43 lblHelp->setFont(fntHelp);
45 widgetLayout->addWidget(lblHelp);
49 QHBoxLayout *hlayout =
new QHBoxLayout();
50 hlayout->setSpacing(2);
52 QLabel *lbl =
new QLabel(
this);
53 lbl->setText(
"Sigma: ");
54 hlayout->addWidget(lbl);
56 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
57 hlayout->addItem(sp2);
59 widgetLayout->addItem(hlayout);
62 m_slSigma =
new ctkSliderWidget(
this);
63 m_slSigma->setMinimum(0.1);
64 m_slSigma->setMaximum(5.0);
65 m_slSigma->setPageStep(0.1);
66 m_slSigma->setSingleStep(0.01);
67 m_slSigma->setValue(1.0);
68 m_slSigma->setTracking(
false);
69 m_slSigma->setToolTip(
"The \"sigma\" parameter in the Gradient Magnitude filter.");
70 connect(m_slSigma, SIGNAL(valueChanged(
double)),
this, SLOT(OnSigmaChanged(
double)));
71 widgetLayout->addWidget(m_slSigma);
75 QHBoxLayout *hlayout =
new QHBoxLayout();
76 hlayout->setSpacing(2);
78 QLabel *lbl =
new QLabel(
this);
79 lbl->setText(
"Alpha: ");
80 hlayout->addWidget(lbl);
82 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
83 hlayout->addItem(sp2);
85 widgetLayout->addItem(hlayout);
88 m_slAlpha =
new ctkSliderWidget(
this);
89 m_slAlpha->setMinimum(-10);
90 m_slAlpha->setMaximum(0);
91 m_slAlpha->setPageStep(0.1);
92 m_slAlpha->setSingleStep(0.01);
93 m_slAlpha->setValue(-2.5);
94 m_slAlpha->setTracking(
false);
95 m_slAlpha->setToolTip(
"The \"alpha\" parameter in the Sigmoid mapping filter.");
96 connect(m_slAlpha, SIGNAL(valueChanged(
double)),
this, SLOT(OnAlphaChanged(
double)));
97 widgetLayout->addWidget(m_slAlpha);
101 QHBoxLayout *hlayout =
new QHBoxLayout();
102 hlayout->setSpacing(2);
104 QLabel *lbl =
new QLabel(
this);
105 lbl->setText(
"Beta: ");
106 hlayout->addWidget(lbl);
108 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
109 hlayout->addItem(sp2);
111 widgetLayout->addLayout(hlayout);
114 m_slBeta =
new ctkSliderWidget(
this);
115 m_slBeta->setMinimum(0);
116 m_slBeta->setMaximum(100);
117 m_slBeta->setPageStep(0.1);
118 m_slBeta->setSingleStep(0.01);
119 m_slBeta->setValue(3.5);
120 m_slBeta->setTracking(
false);
121 m_slBeta->setToolTip(
"The \"beta\" parameter in the Sigmoid mapping filter.");
122 connect(m_slBeta, SIGNAL(valueChanged(
double)),
this, SLOT(OnBetaChanged(
double)));
123 widgetLayout->addWidget(m_slBeta);
127 QHBoxLayout *hlayout =
new QHBoxLayout();
128 hlayout->setSpacing(2);
130 QLabel *lbl =
new QLabel(
this);
131 lbl->setText(
"Stopping value: ");
132 hlayout->addWidget(lbl);
134 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
135 hlayout->addItem(sp2);
137 widgetLayout->addLayout(hlayout);
140 m_slStoppingValue =
new ctkSliderWidget(
this);
141 m_slStoppingValue->setMinimum(0);
142 m_slStoppingValue->setMaximum(10000);
143 m_slStoppingValue->setPageStep(10);
144 m_slStoppingValue->setSingleStep(1);
145 m_slStoppingValue->setValue(2000);
146 m_slStoppingValue->setDecimals(0);
147 m_slStoppingValue->setTracking(
false);
148 m_slStoppingValue->setToolTip(
"The \"stopping value\" parameter in the fast marching 3D algorithm");
149 connect(m_slStoppingValue, SIGNAL(valueChanged(
double)),
this, SLOT(OnStoppingValueChanged(
double)));
150 widgetLayout->addWidget(m_slStoppingValue);
154 QHBoxLayout *hlayout =
new QHBoxLayout();
155 hlayout->setSpacing(2);
157 QLabel *lbl =
new QLabel(
this);
158 lbl->setText(
"Threshold: ");
159 hlayout->addWidget(lbl);
161 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
162 hlayout->addItem(sp2);
164 widgetLayout->addLayout(hlayout);
167 m_slwThreshold =
new ctkRangeWidget(
this);
168 m_slwThreshold->setMinimum(-100);
169 m_slwThreshold->setMaximum(5000);
170 m_slwThreshold->setMinimumValue(-100);
171 m_slwThreshold->setMaximumValue(2000);
172 m_slwThreshold->setDecimals(0);
173 m_slwThreshold->setTracking(
false);
174 m_slwThreshold->setToolTip(
"The lower and upper thresholds for the final thresholding");
175 connect(m_slwThreshold, SIGNAL(valuesChanged(
double,
double)),
this, SLOT(OnThresholdChanged(
double,
double)));
176 widgetLayout->addWidget(m_slwThreshold);
178 m_btClearSeeds =
new QPushButton(
"Clear");
179 m_btClearSeeds->setToolTip(
"Clear current result and start over again");
180 m_btClearSeeds->setEnabled(
false);
181 widgetLayout->addWidget(m_btClearSeeds);
182 connect(m_btClearSeeds, SIGNAL(clicked()),
this, SLOT(OnClearSeeds()));
184 m_btConfirm =
new QPushButton(
"Confirm Segmentation");
185 m_btConfirm->setToolTip(
"Incorporate current result in your working session.");
186 m_btConfirm->setEnabled(
false);
187 widgetLayout->addWidget(m_btConfirm);
188 connect(m_btConfirm, SIGNAL(clicked()),
this, SLOT(OnConfirmSegmentation()));
190 connect(
this, SIGNAL(NewToolAssociated(
mitk::Tool *)),
this, SLOT(OnNewToolAssociated(
mitk::Tool *)));
192 m_slSigma->setDecimals(2);
193 m_slBeta->setDecimals(2);
194 m_slAlpha->setDecimals(2);
196 this->EnableWidgets(
false);
234 new QmitkStepperAdapter(
this, renderer->GetSliceNavigationController()->GetTime(),
"stepper");
304 QString segName = QString::fromStdString(
m_FastMarchingTool->GetCurrentSegmentationName());
307 int result = dialog.exec();
344 this->EnableWidgets(
false);
351 QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
353 QApplication::restoreOverrideCursor();
358 this->EnableWidgets(
true);
363 void QmitkFastMarchingTool3DGUI::EnableWidgets(
bool enable)
static BaseRenderer * GetInstance(vtkRenderWindow *renWin)
void SetSegmentationName(QString name)
static vtkRenderWindow * GetRenderWindowByName(const std::string &name)
Helper class to connect Qt-based navigators to instances of Stepper.
Helper class to step through a list.
#define MITKSEGMENTATIONUI_EXPORT