Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkBinaryThresholdToolGUI Class Reference

GUI for mitk::BinaryThresholdTool. More...

#include <QmitkBinaryThresholdToolGUI.h>

Inheritance diagram for QmitkBinaryThresholdToolGUI:
Collaboration diagram for QmitkBinaryThresholdToolGUI:

Signals

void thresholdAccepted ()
 Emitted when threshold Accepted. More...
 
void thresholdCanceled ()
 Emitted when threshold Canceled. More...
 
- Signals inherited from QmitkToolGUI
void NewToolAssociated (mitk::Tool *)
 

Public Member Functions

 mitkClassMacro (QmitkBinaryThresholdToolGUI, QmitkToolGUI)
 
Pointer Clone () const
 
void OnThresholdingIntervalBordersChanged (double lower, double upper, bool isFloat)
 
void OnThresholdingValueChanged (double current)
 
- Public Member Functions inherited from QmitkToolGUI
 mitkClassMacroItkParent (QmitkToolGUI, itk::Object)
 
void SetTool (mitk::Tool *tool)
 
virtual void Register () const override
 
virtual void UnRegister () const ITK_NOEXCEPT ITK_OVERRIDE
 
virtual void SetReferenceCount (int) override
 
virtual ~QmitkToolGUI ()
 

Static Public Member Functions

static Pointer New ()
 

Protected Slots

void OnNewToolAssociated (mitk::Tool *)
 
void OnAcceptThresholdPreview ()
 
void OnSpinnerValueChanged ()
 Called when Spinner value has changed. Consider: Spinner contains DOUBLE values. More...
 
void OnSliderValueChanged (int value)
 Called when Slider value has changed. Consider: Slider contains INT values. More...
 

Protected Member Functions

 QmitkBinaryThresholdToolGUI ()
 
virtual ~QmitkBinaryThresholdToolGUI ()
 
double SliderIntToDouble (int val)
 When Slider (int value) has changed, we need to convert it to a respective double value for the spinner. More...
 
int DoubleToSliderInt (double val)
 When Spinner (double value) has changed, we need to convert it to a respective int value for the slider. More...
 
- Protected Member Functions inherited from QmitkToolGUI
virtual void BusyStateChanged (bool)
 

Protected Attributes

QSlider * m_Slider
 
QDoubleSpinBox * m_Spinner
 
bool m_isFloat
 is image float or int? More...
 
double m_RangeMin
 
double m_RangeMax
 
double m_Range
 
bool m_ChangingSlider
 helper bool values to find out, which of the GUI elements has been touched by the user. More...
 
bool m_ChangingSpinner
 
mitk::BinaryThresholdTool::Pointer m_BinaryThresholdTool
 
- Protected Attributes inherited from QmitkToolGUI
mitk::Tool::Pointer m_Tool
 

Detailed Description

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.

There is only a slider for INT values in QT. So, if the working image has a float/double pixeltype, we need to convert the original float intensity into a respective int value for the slider. The slider range is then between 0 and 99.

If the pixeltype is INT, then we do not need any conversion.

Last contributor: $Author$

Definition at line 40 of file QmitkBinaryThresholdToolGUI.h.

Constructor & Destructor Documentation

QmitkBinaryThresholdToolGUI::QmitkBinaryThresholdToolGUI ( )
protected

Definition at line 28 of file QmitkBinaryThresholdToolGUI.cpp.

QmitkBinaryThresholdToolGUI::~QmitkBinaryThresholdToolGUI ( )
protectedvirtual

Member Function Documentation

Pointer QmitkBinaryThresholdToolGUI::Clone ( ) const
int QmitkBinaryThresholdToolGUI::DoubleToSliderInt ( double  val)
protected

When Spinner (double value) has changed, we need to convert it to a respective int value for the slider.

Definition at line 205 of file QmitkBinaryThresholdToolGUI.cpp.

References m_isFloat, m_Range, and m_RangeMin.

Referenced by OnSpinnerValueChanged(), and OnThresholdingValueChanged().

QmitkBinaryThresholdToolGUI::mitkClassMacro ( QmitkBinaryThresholdToolGUI  ,
QmitkToolGUI   
)
static Pointer QmitkBinaryThresholdToolGUI::New ( )
static
void QmitkBinaryThresholdToolGUI::OnNewToolAssociated ( mitk::Tool tool)
protectedslot
void QmitkBinaryThresholdToolGUI::OnSliderValueChanged ( int  value)
protectedslot

Called when Slider value has changed. Consider: Slider contains INT values.

Definition at line 126 of file QmitkBinaryThresholdToolGUI.cpp.

References m_BinaryThresholdTool, m_ChangingSlider, m_ChangingSpinner, m_Spinner, and SliderIntToDouble().

void QmitkBinaryThresholdToolGUI::OnSpinnerValueChanged ( )
protectedslot

Called when Spinner value has changed. Consider: Spinner contains DOUBLE values.

Definition at line 112 of file QmitkBinaryThresholdToolGUI.cpp.

References DoubleToSliderInt(), m_BinaryThresholdTool, m_ChangingSlider, m_ChangingSpinner, m_Slider, and m_Spinner.

void QmitkBinaryThresholdToolGUI::OnThresholdingIntervalBordersChanged ( double  lower,
double  upper,
bool  isFloat 
)
void QmitkBinaryThresholdToolGUI::OnThresholdingValueChanged ( double  current)
double QmitkBinaryThresholdToolGUI::SliderIntToDouble ( int  val)
protected

When Slider (int value) has changed, we need to convert it to a respective double value for the spinner.

Definition at line 193 of file QmitkBinaryThresholdToolGUI.cpp.

References m_isFloat, m_Range, and m_RangeMin.

Referenced by OnSliderValueChanged().

void QmitkBinaryThresholdToolGUI::thresholdAccepted ( )
signal

Emitted when threshold Accepted.

Referenced by OnAcceptThresholdPreview().

void QmitkBinaryThresholdToolGUI::thresholdCanceled ( )
signal

Emitted when threshold Canceled.

Member Data Documentation

bool QmitkBinaryThresholdToolGUI::m_ChangingSlider
protected

helper bool values to find out, which of the GUI elements has been touched by the user.

Definition at line 93 of file QmitkBinaryThresholdToolGUI.h.

Referenced by OnSliderValueChanged(), and OnSpinnerValueChanged().

bool QmitkBinaryThresholdToolGUI::m_ChangingSpinner
protected

Definition at line 93 of file QmitkBinaryThresholdToolGUI.h.

Referenced by OnSliderValueChanged(), and OnSpinnerValueChanged().

bool QmitkBinaryThresholdToolGUI::m_isFloat
protected

is image float or int?

Definition at line 86 of file QmitkBinaryThresholdToolGUI.h.

Referenced by DoubleToSliderInt(), OnThresholdingIntervalBordersChanged(), and SliderIntToDouble().

double QmitkBinaryThresholdToolGUI::m_Range
protected
double QmitkBinaryThresholdToolGUI::m_RangeMax
protected

Definition at line 89 of file QmitkBinaryThresholdToolGUI.h.

Referenced by OnThresholdingIntervalBordersChanged().

double QmitkBinaryThresholdToolGUI::m_RangeMin
protected
QSlider* QmitkBinaryThresholdToolGUI::m_Slider
protected
QDoubleSpinBox* QmitkBinaryThresholdToolGUI::m_Spinner
protected

The documentation for this class was generated from the following files: