23 #include <QApplication>
25 #include <QMessageBox>
26 #include <ctkRangeWidget.h>
27 #include <ctkSliderWidget.h>
30 #include <qpushbutton.h>
36 this->setContentsMargins(0, 0, 0, 0);
39 QVBoxLayout *widgetLayout =
new QVBoxLayout(
this);
40 widgetLayout->setContentsMargins(0, 0, 0, 0);
43 fntHelp.setBold(
true);
45 QLabel *lblHelp =
new QLabel(
this);
46 lblHelp->setText(
"Press shift-click to add seeds repeatedly.");
47 lblHelp->setFont(fntHelp);
49 widgetLayout->addWidget(lblHelp);
53 QHBoxLayout *hlayout =
new QHBoxLayout();
54 hlayout->setSpacing(2);
56 QLabel *lbl =
new QLabel(
this);
57 lbl->setText(
"Sigma: ");
58 hlayout->addWidget(lbl);
60 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
61 hlayout->addItem(sp2);
63 widgetLayout->addItem(hlayout);
66 m_slSigma =
new ctkSliderWidget(
this);
67 m_slSigma->setMinimum(0.1);
68 m_slSigma->setMaximum(5.0);
69 m_slSigma->setPageStep(0.1);
70 m_slSigma->setSingleStep(0.01);
71 m_slSigma->setValue(1.0);
72 m_slSigma->setTracking(
false);
73 m_slSigma->setToolTip(
"The \"sigma\" parameter in the Gradient Magnitude filter.");
74 connect(m_slSigma, SIGNAL(valueChanged(
double)),
this, SLOT(OnSigmaChanged(
double)));
75 widgetLayout->addWidget(m_slSigma);
79 QHBoxLayout *hlayout =
new QHBoxLayout();
80 hlayout->setSpacing(2);
82 QLabel *lbl =
new QLabel(
this);
83 lbl->setText(
"Alpha: ");
84 hlayout->addWidget(lbl);
86 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
87 hlayout->addItem(sp2);
89 widgetLayout->addItem(hlayout);
92 m_slAlpha =
new ctkSliderWidget(
this);
93 m_slAlpha->setMinimum(-10);
94 m_slAlpha->setMaximum(0);
95 m_slAlpha->setPageStep(0.1);
96 m_slAlpha->setSingleStep(0.01);
97 m_slAlpha->setValue(-2.5);
98 m_slAlpha->setTracking(
false);
99 m_slAlpha->setToolTip(
"The \"alpha\" parameter in the Sigmoid mapping filter.");
100 connect(m_slAlpha, SIGNAL(valueChanged(
double)),
this, SLOT(OnAlphaChanged(
double)));
101 widgetLayout->addWidget(m_slAlpha);
105 QHBoxLayout *hlayout =
new QHBoxLayout();
106 hlayout->setSpacing(2);
108 QLabel *lbl =
new QLabel(
this);
109 lbl->setText(
"Beta: ");
110 hlayout->addWidget(lbl);
112 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
113 hlayout->addItem(sp2);
115 widgetLayout->addLayout(hlayout);
118 m_slBeta =
new ctkSliderWidget(
this);
119 m_slBeta->setMinimum(0);
120 m_slBeta->setMaximum(100);
121 m_slBeta->setPageStep(0.1);
122 m_slBeta->setSingleStep(0.01);
123 m_slBeta->setValue(3.5);
124 m_slBeta->setTracking(
false);
125 m_slBeta->setToolTip(
"The \"beta\" parameter in the Sigmoid mapping filter.");
126 connect(m_slBeta, SIGNAL(valueChanged(
double)),
this, SLOT(OnBetaChanged(
double)));
127 widgetLayout->addWidget(m_slBeta);
131 QHBoxLayout *hlayout =
new QHBoxLayout();
132 hlayout->setSpacing(2);
134 QLabel *lbl =
new QLabel(
this);
135 lbl->setText(
"Stopping value: ");
136 hlayout->addWidget(lbl);
138 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
139 hlayout->addItem(sp2);
141 widgetLayout->addLayout(hlayout);
144 m_slStoppingValue =
new ctkSliderWidget(
this);
145 m_slStoppingValue->setMinimum(0);
146 m_slStoppingValue->setMaximum(10000);
147 m_slStoppingValue->setPageStep(10);
148 m_slStoppingValue->setSingleStep(1);
149 m_slStoppingValue->setValue(2000);
150 m_slStoppingValue->setDecimals(0);
151 m_slStoppingValue->setTracking(
false);
152 m_slStoppingValue->setToolTip(
"The \"stopping value\" parameter in the fast marching 3D algorithm");
153 connect(m_slStoppingValue, SIGNAL(valueChanged(
double)),
this, SLOT(OnStoppingValueChanged(
double)));
154 widgetLayout->addWidget(m_slStoppingValue);
158 QHBoxLayout *hlayout =
new QHBoxLayout();
159 hlayout->setSpacing(2);
161 QLabel *lbl =
new QLabel(
this);
162 lbl->setText(
"Threshold: ");
163 hlayout->addWidget(lbl);
165 QSpacerItem *sp2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
166 hlayout->addItem(sp2);
168 widgetLayout->addLayout(hlayout);
171 m_slwThreshold =
new ctkRangeWidget(
this);
172 m_slwThreshold->setMinimum(-100);
173 m_slwThreshold->setMaximum(5000);
174 m_slwThreshold->setMinimumValue(-100);
175 m_slwThreshold->setMaximumValue(2000);
176 m_slwThreshold->setDecimals(0);
177 m_slwThreshold->setTracking(
false);
178 m_slwThreshold->setToolTip(
"The lower and upper thresholds for the final thresholding");
179 connect(m_slwThreshold, SIGNAL(valuesChanged(
double,
double)),
this, SLOT(OnThresholdChanged(
double,
double)));
180 widgetLayout->addWidget(m_slwThreshold);
182 m_btClearSeeds =
new QPushButton(
"Clear");
183 m_btClearSeeds->setToolTip(
"Clear current result and start over again");
184 widgetLayout->addWidget(m_btClearSeeds);
185 connect(m_btClearSeeds, SIGNAL(clicked()),
this, SLOT(OnClearSeeds()));
187 m_btConfirm =
new QPushButton(
"Confirm Segmentation");
188 m_btConfirm->setToolTip(
"Incorporate current result in your working session.");
189 m_btConfirm->setEnabled(
false);
190 widgetLayout->addWidget(m_btConfirm);
191 connect(m_btConfirm, SIGNAL(clicked()),
this, SLOT(OnConfirmSegmentation()));
193 connect(
this, SIGNAL(NewToolAssociated(
mitk::Tool *)),
this, SLOT(OnNewToolAssociated(
mitk::Tool *)));
195 this->setEnabled(
false);
197 m_slSigma->setDecimals(2);
198 m_slBeta->setDecimals(2);
199 m_slAlpha->setDecimals(2);
237 new QmitkStepperAdapter(
this, renderer->GetSliceNavigationController()->GetTime(),
"stepper");
307 QString segName = QString::fromStdString(
m_FastMarchingTool->GetCurrentSegmentationName());
310 int result = dialog.exec();
352 QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));
354 QApplication::restoreOverrideCursor();
359 this->setEnabled(
true);
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