25 #ifndef WSEGMENTATIONALGOTHRESHOLD_H
26 #define WSEGMENTATIONALGOTHRESHOLD_H
32 #include "WSegmentationAlgo.h"
79 template<
typename T >
113 template<
typename T >
116 std::shared_ptr< std::vector< T > > values(
new std::vector< T >( valueset->
size() ) );
124 for( std::size_t k = 0; k < valueset->
size(); ++k )
126 val =
static_cast< double >( valueset->
getScalar( k ) );
127 ( *values )[k] =
static_cast< T
>( val < low_threshold || val > upp_threshold ? 0 : 1 );
132 for( std::size_t k = 0; k < valueset->
size(); ++k )
134 val =
static_cast< double >( valueset->
getScalar( k ) );
135 ( *values )[k] =
static_cast< T
>( val < low_threshold || val > upp_threshold ? 0 : val );
This data set type contains scalars as values.
A very simple threshold segmentation working in two modi: If in LOWER_THRESHOLD mode than voxels that...
WPropDouble m_upp_threshold
The upper threshold in %.
WSegmentationAlgoThreshold()
Standard constructor.
virtual bool propChanged()
Checks if any properties were changed.
virtual void properties()
Initializes the algorithm's properties.
DataSetPtr operator()(WValueSet< T > const *valueset) const
Implements the operation.
virtual std::string getDescription()
Return a description of this algorithm.
virtual std::string getName()
Return the name of this algorithm.
WPropBool m_binarize
Whether the values inside range of thresholds should be keept, or resulting images should contain onl...
virtual ~WSegmentationAlgoThreshold()
Destructor.
WPropDouble m_low_threshold
The lower threshold in %.
virtual DataSetPtr applyOperation()
A virtual function that calls the correct segmentation operation.
A base class for segmentation alorithms.
std::shared_ptr< WDataSetScalar > DataSetPtr
A conveniant typedef.
DataSetPtr m_dataSet
A pointer to the currently processed dataset.
Base Class for all value set types.
virtual size_t size() const
virtual T getScalar(size_t i) const
virtual double getMaximumValue() const
This method returns the largest value in the valueset.
virtual double getMinimumValue() const
This method returns the smallest value in the valueset.
An object that knows an appropriate dataType flag for the typename T.