Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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)
 
void Register () const override
 
void UnRegister () const ITK_NOEXCEPT ITK_OVERRIDE
 
void SetReferenceCount (int) override
 
 ~QmitkToolGUI () override
 

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 ()
 
 ~QmitkBinaryThresholdToolGUI () override
 
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 36 of file QmitkBinaryThresholdToolGUI.h.

Constructor & Destructor Documentation

◆ QmitkBinaryThresholdToolGUI()

QmitkBinaryThresholdToolGUI::QmitkBinaryThresholdToolGUI ( )
protected

Definition at line 24 of file QmitkBinaryThresholdToolGUI.cpp.

◆ ~QmitkBinaryThresholdToolGUI()

QmitkBinaryThresholdToolGUI::~QmitkBinaryThresholdToolGUI ( )
overrideprotected

Member Function Documentation

◆ Clone()

Pointer QmitkBinaryThresholdToolGUI::Clone ( ) const

◆ DoubleToSliderInt()

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 201 of file QmitkBinaryThresholdToolGUI.cpp.

References m_isFloat, m_Range, and m_RangeMin.

Referenced by OnSpinnerValueChanged(), and OnThresholdingValueChanged().

◆ mitkClassMacro()

QmitkBinaryThresholdToolGUI::mitkClassMacro ( QmitkBinaryThresholdToolGUI  ,
QmitkToolGUI   
)

◆ New()

static Pointer QmitkBinaryThresholdToolGUI::New ( )
static

◆ OnAcceptThresholdPreview

◆ OnNewToolAssociated

void QmitkBinaryThresholdToolGUI::OnNewToolAssociated ( mitk::Tool tool)
protectedslot

◆ OnSliderValueChanged

void QmitkBinaryThresholdToolGUI::OnSliderValueChanged ( int  value)
protectedslot

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

Definition at line 122 of file QmitkBinaryThresholdToolGUI.cpp.

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

◆ OnSpinnerValueChanged

void QmitkBinaryThresholdToolGUI::OnSpinnerValueChanged ( )
protectedslot

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

Definition at line 108 of file QmitkBinaryThresholdToolGUI.cpp.

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

◆ OnThresholdingIntervalBordersChanged()

void QmitkBinaryThresholdToolGUI::OnThresholdingIntervalBordersChanged ( double  lower,
double  upper,
bool  isFloat 
)

◆ OnThresholdingValueChanged()

void QmitkBinaryThresholdToolGUI::OnThresholdingValueChanged ( double  current)

◆ SliderIntToDouble()

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 189 of file QmitkBinaryThresholdToolGUI.cpp.

References m_isFloat, m_Range, and m_RangeMin.

Referenced by OnSliderValueChanged().

◆ thresholdAccepted

void QmitkBinaryThresholdToolGUI::thresholdAccepted ( )
signal

Emitted when threshold Accepted.

Referenced by OnAcceptThresholdPreview().

◆ thresholdCanceled

void QmitkBinaryThresholdToolGUI::thresholdCanceled ( )
signal

Emitted when threshold Canceled.

Member Data Documentation

◆ m_BinaryThresholdTool

◆ m_ChangingSlider

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 90 of file QmitkBinaryThresholdToolGUI.h.

Referenced by OnSliderValueChanged(), and OnSpinnerValueChanged().

◆ m_ChangingSpinner

bool QmitkBinaryThresholdToolGUI::m_ChangingSpinner
protected

Definition at line 90 of file QmitkBinaryThresholdToolGUI.h.

Referenced by OnSliderValueChanged(), and OnSpinnerValueChanged().

◆ m_isFloat

bool QmitkBinaryThresholdToolGUI::m_isFloat
protected

is image float or int?

Definition at line 83 of file QmitkBinaryThresholdToolGUI.h.

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

◆ m_Range

double QmitkBinaryThresholdToolGUI::m_Range
protected

◆ m_RangeMax

double QmitkBinaryThresholdToolGUI::m_RangeMax
protected

Definition at line 86 of file QmitkBinaryThresholdToolGUI.h.

Referenced by OnThresholdingIntervalBordersChanged().

◆ m_RangeMin

double QmitkBinaryThresholdToolGUI::m_RangeMin
protected

◆ m_Slider

QSlider* QmitkBinaryThresholdToolGUI::m_Slider
protected

◆ m_Spinner

QDoubleSpinBox* QmitkBinaryThresholdToolGUI::m_Spinner
protected

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