OpenWalnut  1.5.0dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
WSegmentationAlgoThreshold Class Reference

A very simple threshold segmentation working in two modi: If in LOWER_THRESHOLD mode than voxels that have a value smaller than the threshold are set to 0, while the rest of the voxels are set to 1 where as in UPPER_THRESHOLD mode the opposite applies. More...

#include <WSegmentationAlgoThreshold.h>

+ Inheritance diagram for WSegmentationAlgoThreshold:
+ Collaboration diagram for WSegmentationAlgoThreshold:

Public Member Functions

 WSegmentationAlgoThreshold ()
 Standard constructor. More...
 
virtual ~WSegmentationAlgoThreshold ()
 Destructor. More...
 
virtual std::string getName ()
 Return the name of this algorithm. More...
 
virtual std::string getDescription ()
 Return a description of this algorithm. More...
 
virtual bool propChanged ()
 Checks if any properties were changed. More...
 
template<typename T >
DataSetPtr operator() (WValueSet< T > const *valueset) const
 Implements the operation. More...
 
template<typename T >
WSegmentationAlgo::DataSetPtr operator() (WValueSet< T > const *valueset) const
 This function call operator can be called by a visitor. More...
 
- Public Member Functions inherited from WSegmentationAlgo
 WSegmentationAlgo ()
 Standard constructor. More...
 
virtual ~WSegmentationAlgo ()
 Destructor. More...
 
std::shared_ptr< WConditiongetCondition ()
 Return a condition that indicates changes to the properties. More...
 
void initProperties (WPropGroup group)
 Initialize all properties for this algorithm. More...
 
DataSetPtr segment (DataSetPtr dataset)
 This is called to trigger the actual segmentation in the segmentation module. More...
 
void hideProperties (bool hide)
 Tell the property group to hide itself. More...
 

Private Member Functions

virtual void properties ()
 Initializes the algorithm's properties. More...
 
virtual DataSetPtr applyOperation ()
 A virtual function that calls the correct segmentation operation. More...
 

Private Attributes

WPropDouble m_low_threshold
 The lower threshold in %. More...
 
WPropDouble m_upp_threshold
 The upper threshold in %. More...
 
WPropBool m_binarize
 Whether the values inside range of thresholds should be keept, or resulting images should contain only 0 or 1 values (binarized). More...
 

Additional Inherited Members

- Public Types inherited from WSegmentationAlgo
typedef std::shared_ptr< WDataSetScalarDataSetPtr
 A conveniant typedef. More...
 
- Protected Attributes inherited from WSegmentationAlgo
WPropGroup m_properties
 The property group of this segmentation algorithm. More...
 
std::shared_ptr< WConditionm_propCondition
 The condition indicating changed to the properties. More...
 
DataSetPtr m_dataSet
 A pointer to the currently processed dataset. More...
 

Detailed Description

A very simple threshold segmentation working in two modi: If in LOWER_THRESHOLD mode than voxels that have a value smaller than the threshold are set to 0, while the rest of the voxels are set to 1 where as in UPPER_THRESHOLD mode the opposite applies.

Definition at line 41 of file WSegmentationAlgoThreshold.h.

Constructor & Destructor Documentation

◆ WSegmentationAlgoThreshold()

WSegmentationAlgoThreshold::WSegmentationAlgoThreshold ( )

Standard constructor.

Definition at line 29 of file WSegmentationAlgoThreshold.cpp.

◆ ~WSegmentationAlgoThreshold()

WSegmentationAlgoThreshold::~WSegmentationAlgoThreshold ( )
virtual

Destructor.

Definition at line 34 of file WSegmentationAlgoThreshold.cpp.

Member Function Documentation

◆ applyOperation()

WSegmentationAlgo::DataSetPtr WSegmentationAlgoThreshold::applyOperation ( )
privatevirtual

A virtual function that calls the correct segmentation operation.

Returns
The resulting dataset.

Implements WSegmentationAlgo.

Definition at line 66 of file WSegmentationAlgoThreshold.cpp.

References WSegmentationAlgo::m_dataSet.

◆ getDescription()

std::string WSegmentationAlgoThreshold::getDescription ( )
virtual

Return a description of this algorithm.

Returns
A description.

Implements WSegmentationAlgo.

Definition at line 56 of file WSegmentationAlgoThreshold.cpp.

◆ getName()

std::string WSegmentationAlgoThreshold::getName ( )
virtual

Return the name of this algorithm.

Returns
The name.

Implements WSegmentationAlgo.

Definition at line 51 of file WSegmentationAlgoThreshold.cpp.

◆ operator()() [1/2]

template<typename T >
DataSetPtr WSegmentationAlgoThreshold::operator() ( WValueSet< T > const *  valueset) const

Implements the operation.

Template Parameters
Thetype of the values in the dataset's valueset.
Parameters
valuesetThe dataset's valueset.
Returns
The resulting dataset.

◆ operator()() [2/2]

template<typename T >
WSegmentationAlgo::DataSetPtr WSegmentationAlgoThreshold::operator() ( WValueSet< T > const *  valueset) const

This function call operator can be called by a visitor.

It performs the actual segmentation as mentioned in the description of this class

Parameters
valuesetoperator will work on this set of values
Returns
The resulting values after applying the segmentation criterion.

Definition at line 114 of file WSegmentationAlgoThreshold.h.

References WValueSet< T >::getMaximumValue(), WValueSet< T >::getMinimumValue(), WValueSet< T >::getScalar(), m_binarize, WSegmentationAlgo::m_dataSet, m_low_threshold, m_upp_threshold, and WValueSet< T >::size().

+ Here is the call graph for this function:

◆ propChanged()

bool WSegmentationAlgoThreshold::propChanged ( )
virtual

Checks if any properties were changed.

Returns
True, iff any properties were changed.

Implements WSegmentationAlgo.

Definition at line 61 of file WSegmentationAlgoThreshold.cpp.

References m_binarize, m_low_threshold, and m_upp_threshold.

◆ properties()

void WSegmentationAlgoThreshold::properties ( )
privatevirtual

Initializes the algorithm's properties.

Implements WSegmentationAlgo.

Definition at line 38 of file WSegmentationAlgoThreshold.cpp.

References m_binarize, m_low_threshold, WSegmentationAlgo::m_propCondition, WSegmentationAlgo::m_properties, and m_upp_threshold.

Member Data Documentation

◆ m_binarize

WPropBool WSegmentationAlgoThreshold::m_binarize
private

Whether the values inside range of thresholds should be keept, or resulting images should contain only 0 or 1 values (binarized).

Definition at line 104 of file WSegmentationAlgoThreshold.h.

Referenced by operator()(), propChanged(), and properties().

◆ m_low_threshold

WPropDouble WSegmentationAlgoThreshold::m_low_threshold
private

The lower threshold in %.

Definition at line 95 of file WSegmentationAlgoThreshold.h.

Referenced by operator()(), propChanged(), and properties().

◆ m_upp_threshold

WPropDouble WSegmentationAlgoThreshold::m_upp_threshold
private

The upper threshold in %.

Definition at line 98 of file WSegmentationAlgoThreshold.h.

Referenced by operator()(), propChanged(), and properties().


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