25 #ifndef WVALUESETBASE_H
26 #define WVALUESETBASE_H
32 #include <boost/shared_ptr.hpp>
35 #include <boost/variant.hpp>
38 #include "../common/math/WValue.h"
39 #include "WDataHandlerEnums.h"
43 template<
typename T >
47 typedef boost::variant< WValueSet< uint8_t >
const*,
69 typedef boost::shared_ptr< WValueSetBase >
SPtr;
74 typedef boost::shared_ptr< const WValueSetBase >
ConstSPtr;
93 virtual size_t size()
const = 0;
98 virtual size_t rawSize()
const = 0;
135 return static_cast< size_t >( std::pow( static_cast< double >(
m_dimension ), static_cast< int >(
m_order ) ) );
170 template<
typename Func_T >
173 return boost::apply_visitor( func,
getVariant() );
200 return WValueSetVariant();
204 #endif // WVALUESETBASE_H
boost::shared_ptr< WValueSetBase > SPtr
Shared pointer to an instance of this class.
virtual size_t order() const
const size_t m_dimension
The dimension of the tensors for this ValueSet.
Func_T::result_type applyFunction(Func_T const &func)
Apply a function object to this valueset.
virtual WValueSetVariant const getVariant() const
Creates a boost::variant reference.
const dataType m_dataType
The data type of the values' elements.
virtual double getMinimumValue() const =0
This method returns the smallest value in the valueset.
boost::shared_ptr< const WValueSetBase > ConstSPtr
Shared pointer to an const instance of this class.
virtual dataType getDataType() const
virtual WValue< double > getWValueDouble(size_t i) const =0
virtual double getScalarDouble(size_t i) const =0
virtual size_t rawSize() const =0
virtual double getMaximumValue() const =0
This method returns the largest value in the valueset.
dataType
Data types and number values taken from the nifti1.h, at this point it's unknown if it makes sense to...
virtual size_t elementsPerValue() const
Returns the number of elements of type T per value.
virtual ~WValueSetBase()=0
Dummy since each class with virtual member functions needs one.
Base Class for all value set types.
WValueSetBase(size_t order, size_t dimension, dataType inDataType)
Despite this is an abstract class all subclasses should have an order and dimension.
Abstract base class to all WValueSets.
virtual size_t dimension() const
virtual size_t size() const =0
const size_t m_order
The order of the tensors for this ValueSet.