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