|
ITK
6.0.0
Insight Toolkit
|
Go to the documentation of this file.
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")
129 itkGenericExceptionMacro(<< errMsg);
134 template <
typename TValue1,
typename TValue2>
138 const char * errMsg =
"Length Mismatch")
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);
376 return static_cast<MeasurementVectorLength>(a.size());
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>
416 template <
typename TMeasurementVector>
420 using ValueType =
typename TMeasurementVector::ValueType;
423 template <
typename T>
433 template <
typename TPixelType>
454 class MeasurementVectorPixelTraits<unsigned char>
461 class MeasurementVectorPixelTraits<signed char>
468 class MeasurementVectorPixelTraits<unsigned short>
475 class MeasurementVectorPixelTraits<short>
482 class MeasurementVectorPixelTraits<unsigned int>
489 class MeasurementVectorPixelTraits<int>
496 class MeasurementVectorPixelTraits<unsigned long>
503 class MeasurementVectorPixelTraits<long>
510 class MeasurementVectorPixelTraits<unsigned long long>
517 class MeasurementVectorPixelTraits<long long>
524 class MeasurementVectorPixelTraits<float>
531 class MeasurementVectorPixelTraits<double>
542 #endif // itkMeasurementVectorTraits_h
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > &, const Array< 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 FixedArray< TValue1, VLength > &, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
IdentifierType InstanceIdentifier
NumericTraits< RelativeFrequencyType >::AccumulateType TotalRelativeFrequencyType
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > &, const FixedArray< TValue2, VLength2 > &, const char *errMsg="Length Mismatch")
vcl_size_t MeasurementVectorLength
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > *, const Array< 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 Array< TValue1 > *a, const Array< TValue2 > *b, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const std::vector< TValue1 > &a, const std::vector< TValue2 > &b, const char *errMsg="Length Mismatch")
static void Assign(TArrayType &m, const TArrayType &v)
TPixelType MeasurementVectorType
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")
InstanceIdentifier AbsoluteFrequencyType
static MeasurementVectorLength Assert(const FixedArray< TValue1, VLength > *, const FixedArray< TValue2, VLength2 > *, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const VariableLengthVector< 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")
unsigned int Size() const
static MeasurementVectorLength Assert(const VariableLengthVector< TValue1 > *a, const VariableLengthVector< TValue2 > *b, const char *errMsg="Length Mismatch")
static void Assign(FixedArray< TValue, VLength > &m, const TValue &v)
Represents an array whose length can be defined at run-time.
Simulate a standard C array with copy semantics.
static MeasurementVectorLength Assert(const Array< 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")
NumericTraits< AbsoluteFrequencyType >::RealType RelativeFrequencyType
static MeasurementVectorLength Assert(const VariableLengthVector< TValue1 > &a, const VariableLengthVector< TValue2 > &b, const char *errMsg="Length Mismatch")
static bool IsResizable(const TVectorType &)
static MeasurementVectorLength Assert(const std::vector< TValue1 > *a, const std::vector< TValue2 > *b, const char *errMsg="Length Mismatch")
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
static unsigned int GetLength()
NumericTraits< AbsoluteFrequencyType >::AccumulateType TotalAbsoluteFrequencyType
static MeasurementVectorLength Assert(const std::vector< TValue > *a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
Array class with size defined at construction time.
typename TMeasurementVector::ValueType ValueType
static MeasurementVectorLength Assert(const Array< TValue1 > &a, const Array< TValue2 > &b, const char *errMsg="Length Mismatch")
SizeValueType Size() const
static MeasurementVectorLength Assert(const VariableLengthVector< TValue > *a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
static MeasurementVectorLength Assert(const Array< TValue > &a, const MeasurementVectorLength l, const char *errMsg="Length Mismatch")
SizeValueType IdentifierType