#include <QmitkMorphologicToolGUI.h>
Public Types | |
typedef QmitkMorphologicToolGUI | Self |
typedef QmitkToolGUI | Superclass |
typedef itk::SmartPointer< Self > | Pointer |
typedef itk::SmartPointer < const Self > | ConstPointer |
Public Member Functions | |
virtual const char * | GetClassName () const |
Static Public Member Functions | |
static Pointer | New () |
Protected Slots | |
void | OnNewToolAssociated (mitk::Tool *) |
void | OnSliderValueChanged (int value) |
void | OnSpinBoxValueChanged (int value) |
void | OnCheckStateChanged (int state) |
void | OnAcceptPreview () |
Protected Member Functions | |
virtual | ~QmitkMorphologicToolGUI () |
QmitkMorphologicToolGUI () | |
Protected Attributes | |
mitk::MorphologicTool::Pointer | m_MorphologicTool |
QSlider * | m_Slider |
QSpinBox * | m_SpinBox |
QCheckBox * | m_CheckBox |
Definition at line 11 of file QmitkMorphologicToolGUI.h.
typedef itk::SmartPointer<const Self> QmitkMorphologicToolGUI::ConstPointer |
Reimplemented from QmitkToolGUI.
Reimplemented in QmitkClosingToolGUI, QmitkDilateToolGUI, QmitkErodeToolGUI, and QmitkOpeningToolGUI.
Definition at line 16 of file QmitkMorphologicToolGUI.h.
typedef itk::SmartPointer<Self> QmitkMorphologicToolGUI::Pointer |
Reimplemented from QmitkToolGUI.
Reimplemented in QmitkClosingToolGUI, QmitkDilateToolGUI, QmitkErodeToolGUI, and QmitkOpeningToolGUI.
Definition at line 16 of file QmitkMorphologicToolGUI.h.
Reimplemented from QmitkToolGUI.
Reimplemented in QmitkClosingToolGUI, QmitkDilateToolGUI, QmitkErodeToolGUI, and QmitkOpeningToolGUI.
Definition at line 16 of file QmitkMorphologicToolGUI.h.
Reimplemented from QmitkToolGUI.
Reimplemented in QmitkClosingToolGUI, QmitkDilateToolGUI, QmitkErodeToolGUI, and QmitkOpeningToolGUI.
Definition at line 16 of file QmitkMorphologicToolGUI.h.
QmitkMorphologicToolGUI::~QmitkMorphologicToolGUI | ( | ) | [protected, virtual] |
Definition at line 65 of file QmitkMorphologicToolGUI.cpp.
{ }
QmitkMorphologicToolGUI::QmitkMorphologicToolGUI | ( | ) | [protected] |
Definition at line 11 of file QmitkMorphologicToolGUI.cpp.
: QmitkToolGUI(), m_Slider(NULL) { QBoxLayout* mainLayout = new QVBoxLayout(this); QBoxLayout* layout1 = new QHBoxLayout(); QBoxLayout* layout2 = new QHBoxLayout(); QLabel* label = new QLabel( "radius:", this ); QFont f = label->font(); f.setBold(false); label->setFont( f ); layout1->addWidget(label); m_Slider = new QSlider(Qt::Horizontal, this ); m_Slider->setMaximum(15); m_Slider->setMinimum(0); m_Slider->setPageStep(1); connect( m_Slider, SIGNAL(valueChanged(int)), this, SLOT(OnSliderValueChanged(int))); m_Slider->setValue( 0 ); layout1->addWidget( m_Slider ); m_SpinBox = new QSpinBox(this); m_SpinBox->setSuffix(tr(" pixel")); m_SpinBox->setMaximum(15); m_SpinBox->setMinimum(0); m_SpinBox->setSingleStep(1); connect(m_SpinBox, SIGNAL(valueChanged(int)), this, SLOT(OnSpinBoxValueChanged(int)) ); m_SpinBox->setValue(0); layout1->addWidget(m_SpinBox); mainLayout->addLayout(layout1); QButtonGroup* group = new QButtonGroup(this); QRadioButton* crossRadioButton = new QRadioButton(); QRadioButton* ballRadioButton = new QRadioButton(); group->addButton(crossRadioButton); group->addButton(ballRadioButton); m_CheckBox = new QCheckBox("Preview" ,this); m_CheckBox->setCheckState(Qt::CheckState::Checked); connect(m_CheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnCheckStateChanged(int)) ); layout2->addWidget(m_CheckBox); QPushButton* okButton = new QPushButton("OK", this); connect(okButton, SIGNAL(clicked()), this, SLOT(OnAcceptPreview()) ); layout2->addWidget(okButton); mainLayout->addLayout(layout2); connect( this, SIGNAL(NewToolAssociated(mitk::Tool*)), this, SLOT(OnNewToolAssociated(mitk::Tool*)) ); }
virtual const char* QmitkMorphologicToolGUI::GetClassName | ( | ) | const [virtual] |
Reimplemented from QmitkToolGUI.
Reimplemented in QmitkClosingToolGUI, QmitkDilateToolGUI, QmitkErodeToolGUI, and QmitkOpeningToolGUI.
static Pointer QmitkMorphologicToolGUI::New | ( | ) | [static] |
Reimplemented in QmitkClosingToolGUI, QmitkDilateToolGUI, QmitkErodeToolGUI, and QmitkOpeningToolGUI.
void QmitkMorphologicToolGUI::OnAcceptPreview | ( | ) | [protected, slot] |
Definition at line 93 of file QmitkMorphologicToolGUI.cpp.
References QmitkNewSegmentationDialog::GetColor(), QmitkNewSegmentationDialog::GetSegmentationName(), m_MorphologicTool, and QmitkNewSegmentationDialog::setPrompt().
{ if (m_MorphologicTool.IsNotNull()) { QmitkNewSegmentationDialog* dialog = new QmitkNewSegmentationDialog( this ); dialog->setPrompt("What did you just segment?"); int dialogReturnValue = dialog->exec(); std::string name = dialog->GetSegmentationName().toLocal8Bit().data(); mitk::Color color = dialog->GetColor(); delete dialog; if ( dialogReturnValue != QDialog::Rejected ) { m_MorphologicTool->AcceptPreview( name, color ); } else { m_MorphologicTool->CancelPreviewing(); } } }
void QmitkMorphologicToolGUI::OnCheckStateChanged | ( | int | state ) | [protected, slot] |
Definition at line 82 of file QmitkMorphologicToolGUI.cpp.
References m_MorphologicTool.
{ if (m_MorphologicTool.IsNotNull()) m_MorphologicTool->SetPreview(state); }
void QmitkMorphologicToolGUI::OnNewToolAssociated | ( | mitk::Tool * | tool ) | [protected, slot] |
Definition at line 88 of file QmitkMorphologicToolGUI.cpp.
References m_MorphologicTool.
{ m_MorphologicTool = dynamic_cast<mitk::MorphologicTool*>( tool ); }
void QmitkMorphologicToolGUI::OnSliderValueChanged | ( | int | value ) | [protected, slot] |
Definition at line 70 of file QmitkMorphologicToolGUI.cpp.
References m_MorphologicTool, and m_SpinBox.
{ m_SpinBox->setValue(value); if (m_MorphologicTool.IsNotNull()) m_MorphologicTool->SetRadius(value); }
void QmitkMorphologicToolGUI::OnSpinBoxValueChanged | ( | int | value ) | [protected, slot] |
Definition at line 77 of file QmitkMorphologicToolGUI.cpp.
References m_Slider.
{ m_Slider->setValue(value); }
QCheckBox* QmitkMorphologicToolGUI::m_CheckBox [protected] |
Definition at line 35 of file QmitkMorphologicToolGUI.h.
Definition at line 32 of file QmitkMorphologicToolGUI.h.
Referenced by OnAcceptPreview(), OnCheckStateChanged(), OnNewToolAssociated(), and OnSliderValueChanged().
QSlider* QmitkMorphologicToolGUI::m_Slider [protected] |
Definition at line 33 of file QmitkMorphologicToolGUI.h.
Referenced by OnSpinBoxValueChanged().
QSpinBox* QmitkMorphologicToolGUI::m_SpinBox [protected] |
Definition at line 34 of file QmitkMorphologicToolGUI.h.
Referenced by OnSliderValueChanged().