GUI for mitk::BinaryThresholdTool. More...
#include <QmitkBinaryThresholdULToolGUI.h>


Public Types | |
| typedef QmitkBinaryThresholdULToolGUI | Self |
| typedef QmitkToolGUI | Superclass |
| typedef itk::SmartPointer< Self > | Pointer |
| typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
| virtual const char * | GetClassName () const |
| void | OnThresholdingIntervalBordersChanged (int lower, int upper) |
| void | OnThresholdingValuesChanged (int lower, int upper) |
Static Public Member Functions | |
| static Pointer | New () |
Protected Slots | |
| void | OnNewToolAssociated (mitk::Tool *) |
| void | OnSpanChanged (int lower, int upper) |
| void | OnAcceptThresholdPreview () |
| void | OnUpperSpinnerChanged (int) |
| void | OnLowerSpinnerChanged (int) |
Protected Member Functions | |
| QmitkBinaryThresholdULToolGUI () | |
| virtual | ~QmitkBinaryThresholdULToolGUI () |
Protected Attributes | |
| QxtSpanSlider * | m_RangeSlider |
| QSpinBox * | m_LowerSpinner |
| QSpinBox * | m_UpperSpinner |
| mitk::BinaryThresholdULTool::Pointer | m_BinaryThresholdULTool |
GUI for mitk::BinaryThresholdTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
Last contributor: $Author$
Definition at line 36 of file QmitkBinaryThresholdULToolGUI.h.
| typedef itk::SmartPointer<const Self> QmitkBinaryThresholdULToolGUI::ConstPointer |
Reimplemented from QmitkToolGUI.
Definition at line 42 of file QmitkBinaryThresholdULToolGUI.h.
| typedef itk::SmartPointer<Self> QmitkBinaryThresholdULToolGUI::Pointer |
Reimplemented from QmitkToolGUI.
Definition at line 42 of file QmitkBinaryThresholdULToolGUI.h.
Reimplemented from QmitkToolGUI.
Definition at line 42 of file QmitkBinaryThresholdULToolGUI.h.
Reimplemented from QmitkToolGUI.
Definition at line 42 of file QmitkBinaryThresholdULToolGUI.h.
| QmitkBinaryThresholdULToolGUI::QmitkBinaryThresholdULToolGUI | ( | ) | [protected] |
Definition at line 28 of file QmitkBinaryThresholdULToolGUI.cpp.
References QxtSpanSlider::NoOverlapping.
:QmitkToolGUI(), m_RangeSlider(NULL) { // create the visible widgets QBoxLayout* mainLayout = new QVBoxLayout(this); QLabel* label = new QLabel( "Threshold :", this ); QFont f = label->font(); f.setBold(false); label->setFont( f ); mainLayout->addWidget(label); QBoxLayout* layout = new QHBoxLayout(); m_LowerSpinner = new QSpinBox(); m_LowerSpinner->setMinimum(-2048); m_LowerSpinner->setMaximum(0); m_LowerSpinner->setValue(-2048); connect(m_LowerSpinner, SIGNAL(valueChanged(int)), this, SLOT(OnLowerSpinnerChanged(int)) ); m_RangeSlider = new QxtSpanSlider(Qt::Horizontal, this ); m_RangeSlider->setMaximum(2048); m_RangeSlider->setMinimum(-2048); m_RangeSlider->setHandleMovementMode(QxtSpanSlider::NoOverlapping); m_UpperSpinner = new QSpinBox(); m_UpperSpinner->setMinimum(0); m_UpperSpinner->setMaximum(2048); m_UpperSpinner->setValue(2048); connect(m_UpperSpinner, SIGNAL(valueChanged(int)), this, SLOT(OnUpperSpinnerChanged(int)) ); connect(m_RangeSlider, SIGNAL(spanChanged(int, int) ),this, SLOT( OnSpanChanged(int , int ) )); layout->addWidget(m_LowerSpinner); layout->addWidget(m_RangeSlider); layout->addWidget(m_UpperSpinner); mainLayout->addLayout(layout); QPushButton* okButton = new QPushButton("Ok", this); connect( okButton, SIGNAL(clicked()), this, SLOT(OnAcceptThresholdPreview())); okButton->setFont( f ); mainLayout->addWidget( okButton ); connect( this, SIGNAL(NewToolAssociated(mitk::Tool*)), this, SLOT(OnNewToolAssociated(mitk::Tool*)) ); }
| QmitkBinaryThresholdULToolGUI::~QmitkBinaryThresholdULToolGUI | ( | ) | [protected, virtual] |
Definition at line 76 of file QmitkBinaryThresholdULToolGUI.cpp.
References m_BinaryThresholdULTool, OnThresholdingIntervalBordersChanged(), and OnThresholdingValuesChanged().
{
// !!!
if (m_BinaryThresholdULTool.IsNotNull())
{
m_BinaryThresholdULTool->IntervalBordersChanged -= mitk::MessageDelegate2<QmitkBinaryThresholdULToolGUI, int, int>( this, &QmitkBinaryThresholdULToolGUI::OnThresholdingIntervalBordersChanged );
m_BinaryThresholdULTool->ThresholdingValuesChanged -= mitk::MessageDelegate2<QmitkBinaryThresholdULToolGUI, int, int>( this, &QmitkBinaryThresholdULToolGUI::OnThresholdingValuesChanged );
}
}
| virtual const char* QmitkBinaryThresholdULToolGUI::GetClassName | ( | ) | const [virtual] |
Reimplemented from QmitkToolGUI.
| static Pointer QmitkBinaryThresholdULToolGUI::New | ( | ) | [static] |
| void QmitkBinaryThresholdULToolGUI::OnAcceptThresholdPreview | ( | ) | [protected, slot] |
Definition at line 104 of file QmitkBinaryThresholdULToolGUI.cpp.
References QmitkNewSegmentationDialog::GetColor(), QmitkNewSegmentationDialog::GetSegmentationName(), m_BinaryThresholdULTool, and QmitkNewSegmentationDialog::setPrompt().
{
if (m_BinaryThresholdULTool.IsNotNull())
{
QmitkNewSegmentationDialog* dialog = new QmitkNewSegmentationDialog( this ); // needs a QWidget as parent, "this" is not QWidget
dialog->setPrompt("What did you just segment?");
int dialogReturnValue = dialog->exec();
std::string organName = dialog->GetSegmentationName().toLocal8Bit().data();
mitk::Color color = dialog->GetColor();
delete dialog;
if ( dialogReturnValue != QDialog::Rejected ) // user clicked cancel or pressed Esc or something similar
{
m_BinaryThresholdULTool->AcceptCurrentThresholdValue( organName, color );
}
else
{
m_BinaryThresholdULTool->CancelThresholding();
}
}
}
| void QmitkBinaryThresholdULToolGUI::OnLowerSpinnerChanged | ( | int | value ) | [protected, slot] |
Definition at line 164 of file QmitkBinaryThresholdULToolGUI.cpp.
References m_RangeSlider, and QxtSpanSlider::setLowerValue().
{
m_RangeSlider->setLowerValue(value);
}
| void QmitkBinaryThresholdULToolGUI::OnNewToolAssociated | ( | mitk::Tool * | tool ) | [protected, slot] |
Definition at line 87 of file QmitkBinaryThresholdULToolGUI.cpp.
References m_BinaryThresholdULTool, OnThresholdingIntervalBordersChanged(), and OnThresholdingValuesChanged().
{
if (m_BinaryThresholdULTool.IsNotNull())
{
m_BinaryThresholdULTool->IntervalBordersChanged -= mitk::MessageDelegate2<QmitkBinaryThresholdULToolGUI, int, int>( this, &QmitkBinaryThresholdULToolGUI::OnThresholdingIntervalBordersChanged );
m_BinaryThresholdULTool->ThresholdingValuesChanged -= mitk::MessageDelegate2<QmitkBinaryThresholdULToolGUI, int, int>( this, &QmitkBinaryThresholdULToolGUI::OnThresholdingValuesChanged );
}
m_BinaryThresholdULTool = dynamic_cast<mitk::BinaryThresholdULTool*>( tool );
if (m_BinaryThresholdULTool.IsNotNull())
{
m_BinaryThresholdULTool->IntervalBordersChanged += mitk::MessageDelegate2<QmitkBinaryThresholdULToolGUI, int, int>( this, &QmitkBinaryThresholdULToolGUI::OnThresholdingIntervalBordersChanged );
m_BinaryThresholdULTool->ThresholdingValuesChanged += mitk::MessageDelegate2<QmitkBinaryThresholdULToolGUI, int, int>( this, &QmitkBinaryThresholdULToolGUI::OnThresholdingValuesChanged );
}
}
| void QmitkBinaryThresholdULToolGUI::OnSpanChanged | ( | int | lower, |
| int | upper | ||
| ) | [protected, slot] |
Definition at line 145 of file QmitkBinaryThresholdULToolGUI.cpp.
References m_BinaryThresholdULTool, m_LowerSpinner, and m_UpperSpinner.
{
if (upper < lower)
{
int tmp = upper;
upper = lower;
lower = tmp;
}
if (m_BinaryThresholdULTool.IsNotNull())
{
m_BinaryThresholdULTool->SetThresholdValues(lower, upper);
}
if (m_LowerSpinner->value() != lower)
m_LowerSpinner->setValue(lower);
if (m_UpperSpinner->value() != upper)
m_UpperSpinner->setValue(upper);
}
| void QmitkBinaryThresholdULToolGUI::OnThresholdingIntervalBordersChanged | ( | int | lower, |
| int | upper | ||
| ) |
Definition at line 128 of file QmitkBinaryThresholdULToolGUI.cpp.
References m_LowerSpinner, m_RangeSlider, and m_UpperSpinner.
Referenced by OnNewToolAssociated(), and ~QmitkBinaryThresholdULToolGUI().
{
m_RangeSlider->setMaximum(upper);
m_RangeSlider->setMinimum(lower);
m_LowerSpinner->setMaximum(upper);
m_LowerSpinner->setMinimum(lower);
m_UpperSpinner->setMaximum(upper);
m_UpperSpinner->setMinimum(lower);
}
| void QmitkBinaryThresholdULToolGUI::OnThresholdingValuesChanged | ( | int | lower, |
| int | upper | ||
| ) |
Definition at line 138 of file QmitkBinaryThresholdULToolGUI.cpp.
References m_LowerSpinner, m_RangeSlider, m_UpperSpinner, and QxtSpanSlider::setSpan().
Referenced by OnNewToolAssociated(), and ~QmitkBinaryThresholdULToolGUI().
{
m_RangeSlider->setSpan(lower, upper);
m_LowerSpinner->setValue(lower);
m_UpperSpinner->setValue(upper);
}
| void QmitkBinaryThresholdULToolGUI::OnUpperSpinnerChanged | ( | int | value ) | [protected, slot] |
Definition at line 169 of file QmitkBinaryThresholdULToolGUI.cpp.
References m_RangeSlider, and QxtSpanSlider::setUpperValue().
{
m_RangeSlider->setUpperValue(value);
}
mitk::BinaryThresholdULTool::Pointer QmitkBinaryThresholdULToolGUI::m_BinaryThresholdULTool [protected] |
Definition at line 69 of file QmitkBinaryThresholdULToolGUI.h.
Referenced by OnAcceptThresholdPreview(), OnNewToolAssociated(), OnSpanChanged(), and ~QmitkBinaryThresholdULToolGUI().
QSpinBox* QmitkBinaryThresholdULToolGUI::m_LowerSpinner [protected] |
Definition at line 66 of file QmitkBinaryThresholdULToolGUI.h.
Referenced by OnSpanChanged(), OnThresholdingIntervalBordersChanged(), and OnThresholdingValuesChanged().
Definition at line 65 of file QmitkBinaryThresholdULToolGUI.h.
Referenced by OnLowerSpinnerChanged(), OnThresholdingIntervalBordersChanged(), OnThresholdingValuesChanged(), and OnUpperSpinnerChanged().
QSpinBox* QmitkBinaryThresholdULToolGUI::m_UpperSpinner [protected] |
Definition at line 67 of file QmitkBinaryThresholdULToolGUI.h.
Referenced by OnSpanChanged(), OnThresholdingIntervalBordersChanged(), and OnThresholdingValuesChanged().
1.7.2