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 else if (b->
Size() != VLength)
197 itkGenericExceptionMacro(<< errMsg);
202 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
206 const char * errMsg =
"Length Mismatch")
214 if (b.Size() != VLength)
216 itkGenericExceptionMacro(<< errMsg);
222 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
226 const char * errMsg =
"Length Mismatch")
232 else if (b->Size() != VLength)
234 itkGenericExceptionMacro(<< errMsg);
239 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
249 if (b.size() != VLength)
251 itkGenericExceptionMacro(<< errMsg);
257 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
265 else if (b->size() != VLength)
267 itkGenericExceptionMacro(<< errMsg);
272 template <
typename TValue1,
unsigned int VLength>
280 else if (l != VLength)
282 itkGenericExceptionMacro(<< errMsg);
287 template <
typename TValue1,
unsigned int VLength>
295 else if (l != VLength)
297 itkGenericExceptionMacro(<< errMsg);
302 template <
typename TValue>
306 if (((l != 0) && (a.
Size() != l)) || (a.
Size() == 0))
308 itkGenericExceptionMacro(<< errMsg);
317 template <
typename TValue>
321 if (((l != 0) && (a->
Size() != l)) || (a->
Size() == 0))
323 itkGenericExceptionMacro(<< errMsg);
332 template <
typename TValue>
336 const char * errMsg =
"Length Mismatch")
338 if (((l != 0) && (a.Size() != l)) || (a.Size() == 0))
340 itkGenericExceptionMacro(<< errMsg);
349 template <
typename TValue>
353 const char * errMsg =
"Length Mismatch")
355 if (((l != 0) && (a->Size() != l)) || (a->Size() == 0))
357 itkGenericExceptionMacro(<< errMsg);
366 template <
typename TValue>
370 if (((l != 0) && (a.size() != l)) || (a.empty()))
372 itkGenericExceptionMacro(<< errMsg);
381 template <
typename TValue>
385 if (((l != 0) && (a->size() != l)) || (a->size() == 0))
387 itkGenericExceptionMacro(<< errMsg);
396 template <
typename TArrayType>
398 Assign(TArrayType & m,
const TArrayType & v)
403 template <
typename TValue,
unsigned int VLength>
416template <
typename TMeasurementVector>
420 using ValueType =
typename TMeasurementVector::ValueType;
433template <
typename TPixelType>
454class MeasurementVectorPixelTraits<unsigned char>
461class MeasurementVectorPixelTraits<signed char>
468class MeasurementVectorPixelTraits<unsigned short>
475class MeasurementVectorPixelTraits<short>
482class MeasurementVectorPixelTraits<unsigned int>
489class MeasurementVectorPixelTraits<int>
496class MeasurementVectorPixelTraits<unsigned long>
503class MeasurementVectorPixelTraits<long>
510class MeasurementVectorPixelTraits<unsigned long long>
517class MeasurementVectorPixelTraits<long long>
524class MeasurementVectorPixelTraits<float>
531class MeasurementVectorPixelTraits<double>
Array class with size defined at construction time.
SizeValueType Size() const
Simulate a standard C array with copy semantics.
static unsigned int GetLength()
TPixelType MeasurementVectorType
typename TMeasurementVector::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