18#ifndef itkMeasurementVectorTraits_h
19#define itkMeasurementVectorTraits_h
22#include "vnl/vnl_vector_fixed.h"
59 template <
typename TVectorType>
73 template <
typename TValue1,
unsigned int VLength,
typename TValue2,
unsigned int VLength2>
77 const char * errMsg =
"Length Mismatch")
79 if (VLength != VLength2)
81 itkGenericExceptionMacro(<< errMsg);
86 template <
typename TValue1,
unsigned int VLength,
typename TValue2,
unsigned int VLength2>
90 const char * errMsg =
"Length Mismatch")
92 if (VLength != VLength2)
94 itkGenericExceptionMacro(<< errMsg);
99 template <
typename TValue1,
typename TValue2>
105 itkGenericExceptionMacro(<< errMsg);
110 template <
typename TValue1,
typename TValue2>
116 itkGenericExceptionMacro(<< errMsg);
121 template <
typename TValue1,
typename TValue2>
125 const char * errMsg =
"Length Mismatch")
127 if (b.Size() != a.Size())
129 itkGenericExceptionMacro(<< errMsg);
134 template <
typename TValue1,
typename TValue2>
138 const char * errMsg =
"Length Mismatch")
140 if (b->Size() != a->Size())
142 itkGenericExceptionMacro(<< errMsg);
147 template <
typename TValue1,
typename TValue2>
149 Assert(
const std::vector<TValue1> & a,
const std::vector<TValue2> & b,
const char * errMsg =
"Length Mismatch")
151 if (b.size() != a.size())
153 itkGenericExceptionMacro(<< errMsg);
158 template <
typename TValue1,
typename TValue2>
160 Assert(
const std::vector<TValue1> * a,
const std::vector<TValue2> * b,
const char * errMsg =
"Length Mismatch")
162 if (b->size() != a->size())
164 itkGenericExceptionMacro(<< errMsg);
169 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
179 if (b.
Size() != VLength)
181 itkGenericExceptionMacro(<< errMsg);
187 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
195 if (b->
Size() != VLength)
197 itkGenericExceptionMacro(<< errMsg);
202 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
206 const char * errMsg =
"Length Mismatch")
212 if (b.Size() != VLength)
214 itkGenericExceptionMacro(<< errMsg);
219 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
223 const char * errMsg =
"Length Mismatch")
229 if (b->Size() != VLength)
231 itkGenericExceptionMacro(<< errMsg);
236 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
244 if (b.size() != VLength)
246 itkGenericExceptionMacro(<< errMsg);
251 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
259 if (b->size() != VLength)
261 itkGenericExceptionMacro(<< errMsg);
266 template <
typename TValue1,
unsigned int VLength>
276 itkGenericExceptionMacro(<< errMsg);
281 template <
typename TValue1,
unsigned int VLength>
291 itkGenericExceptionMacro(<< errMsg);
296 template <
typename TValue>
300 if (((l != 0) && (a.
Size() != l)) || (a.
Size() == 0))
302 itkGenericExceptionMacro(<< errMsg);
311 template <
typename TValue>
315 if (((l != 0) && (a->
Size() != l)) || (a->
Size() == 0))
317 itkGenericExceptionMacro(<< errMsg);
326 template <
typename TValue>
330 const char * errMsg =
"Length Mismatch")
332 if (((l != 0) && (a.Size() != l)) || (a.Size() == 0))
334 itkGenericExceptionMacro(<< errMsg);
343 template <
typename TValue>
347 const char * errMsg =
"Length Mismatch")
349 if (((l != 0) && (a->Size() != l)) || (a->Size() == 0))
351 itkGenericExceptionMacro(<< errMsg);
360 template <
typename TValue>
364 if (((l != 0) && (a.size() != l)) || (a.empty()))
366 itkGenericExceptionMacro(<< errMsg);
375 template <
typename TValue>
379 if (((l != 0) && (a->size() != l)) || (a->size() == 0))
381 itkGenericExceptionMacro(<< errMsg);
390 template <
typename TArrayType>
392 Assign(TArrayType & m,
const TArrayType & v)
397 template <
typename TValue,
unsigned int VLength>
410template <
typename TMeasurementVector>
414 using ValueType =
typename TMeasurementVector::ValueType;
427template <
typename TPixelType>
448class MeasurementVectorPixelTraits<unsigned char>
455class MeasurementVectorPixelTraits<signed char>
Array class with size defined at construction time.
SizeValueType Size() const
Simulate a standard C array with copy semantics.
static unsigned int GetLength()
PixelType MeasurementVectorType
typename MeasurementVectorType::ValueType ValueType
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > &, const Array< TValue2 > &b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const Array< TValue > &a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > *, const std::vector< TValue2 > *b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > &, const VariableLengthVector< TValue2 > &b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const VariableLengthVector< TValue > &a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const Array< TValue1 > *a, const Array< TValue2 > *b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > *, const Array< TValue2 > *b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const VariableLengthVector< TValue1 > &a, const VariableLengthVector< TValue2 > &b, const char *errMsg="Length Mismatch")
NumericTraits< RelativeFrequencyType >::AccumulateType TotalRelativeFrequencyType
static MeasurementVectorLength Assert(const std::vector< TValue1 > &a, const std::vector< TValue2 > &b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > *, const FixedArray< TValue2, VLength2 > *, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const Array< TValue1 > &a, const Array< TValue2 > &b, const char *errMsg="Length Mismatch")
NumericTraits< AbsoluteFrequencyType >::AccumulateType TotalAbsoluteFrequencyType
static MeasurementVectorLength Assert(const std::vector< TValue > &a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > *, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > &, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const VariableLengthVector< TValue > *a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
IdentifierType InstanceIdentifier
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > &, const std::vector< TValue2 > &b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const VariableLengthVector< TValue1 > *a, const VariableLengthVector< TValue2 > *b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const std::vector< TValue > *a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > &, const FixedArray< TValue2, VLength2 > &, const char *errMsg="Length Mismatch")
static void Assign(FixedArray< TValue, VLength > &m, const TValue &v)
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > *, const VariableLengthVector< TValue2 > *b, const char *errMsg="Length Mismatch")
vcl_size_t MeasurementVectorLength
static void Assign(TArrayType &m, const TArrayType &v)
static MeasurementVectorLength Assert(const std::vector< TValue1 > *a, const std::vector< TValue2 > *b, const char *errMsg="Length Mismatch")
InstanceIdentifier AbsoluteFrequencyType
static bool IsResizable(const TVectorType &)
NumericTraits< AbsoluteFrequencyType >::RealType RelativeFrequencyType
static MeasurementVectorLength Assert(const Array< TValue > *a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType