Public Types | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes

QmitkMorphologicToolGUI Class Reference

#include <QmitkMorphologicToolGUI.h>

Inheritance diagram for QmitkMorphologicToolGUI:
Inheritance graph
[legend]
Collaboration diagram for QmitkMorphologicToolGUI:
Collaboration graph
[legend]

List of all members.

Public Types

typedef QmitkMorphologicToolGUI Self
typedef QmitkToolGUI Superclass
typedef itk::SmartPointer< SelfPointer
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

Detailed Description

Definition at line 11 of file QmitkMorphologicToolGUI.h.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

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*)) );
}

Member Function Documentation

virtual const char* QmitkMorphologicToolGUI::GetClassName (  ) const [virtual]
static Pointer QmitkMorphologicToolGUI::New (  ) [static]
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);
}

Member Data Documentation

QCheckBox* QmitkMorphologicToolGUI::m_CheckBox [protected]

Definition at line 35 of file QmitkMorphologicToolGUI.h.

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().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines