 |
ITK
5.4.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"
60 template <
typename TVectorType>
74 template <
typename TValue1,
unsigned int VLength,
typename TValue2,
unsigned int VLength2>
78 const char * errMsg =
"Length Mismatch")
80 if (VLength != VLength2)
82 itkGenericExceptionMacro(<< errMsg);
87 template <
typename TValue1,
unsigned int VLength,
typename TValue2,
unsigned int VLength2>
91 const char * errMsg =
"Length Mismatch")
93 if (VLength != VLength2)
95 itkGenericExceptionMacro(<< errMsg);
100 template <
typename TValue1,
typename TValue2>
106 itkGenericExceptionMacro(<< errMsg);
111 template <
typename TValue1,
typename TValue2>
117 itkGenericExceptionMacro(<< errMsg);
122 template <
typename TValue1,
typename TValue2>
126 const char * errMsg =
"Length Mismatch")
130 itkGenericExceptionMacro(<< errMsg);
135 template <
typename TValue1,
typename TValue2>
139 const char * errMsg =
"Length Mismatch")
143 itkGenericExceptionMacro(<< errMsg);
148 template <
typename TValue1,
typename TValue2>
150 Assert(
const std::vector<TValue1> & a,
const std::vector<TValue2> & b,
const char * errMsg =
"Length Mismatch")
152 if (b.size() != a.size())
154 itkGenericExceptionMacro(<< errMsg);
159 template <
typename TValue1,
typename TValue2>
161 Assert(
const std::vector<TValue1> * a,
const std::vector<TValue2> * b,
const char * errMsg =
"Length Mismatch")
163 if (b->size() != a->size())
165 itkGenericExceptionMacro(<< errMsg);
170 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
180 if (b.
Size() != VLength)
182 itkGenericExceptionMacro(<< errMsg);
188 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
196 else if (b->
Size() != VLength)
198 itkGenericExceptionMacro(<< errMsg);
203 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
207 const char * errMsg =
"Length Mismatch")
215 if (b.
Size() != VLength)
217 itkGenericExceptionMacro(<< errMsg);
223 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
227 const char * errMsg =
"Length Mismatch")
233 else if (b->
Size() != VLength)
235 itkGenericExceptionMacro(<< errMsg);
240 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
250 if (b.size() != VLength)
252 itkGenericExceptionMacro(<< errMsg);
258 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
266 else if (b->size() != VLength)
268 itkGenericExceptionMacro(<< errMsg);
273 template <
typename TValue1,
unsigned int VLength>
281 else if (l != VLength)
283 itkGenericExceptionMacro(<< errMsg);
288 template <
typename TValue1,
unsigned int VLength>
296 else if (l != VLength)
298 itkGenericExceptionMacro(<< errMsg);
303 template <
typename TValue>
307 if (((l != 0) && (a.
Size() != l)) || (a.
Size() == 0))
309 itkGenericExceptionMacro(<< errMsg);
318 template <
typename TValue>
322 if (((l != 0) && (a->
Size() != l)) || (a->
Size() == 0))
324 itkGenericExceptionMacro(<< errMsg);
333 template <
typename TValue>
337 const char * errMsg =
"Length Mismatch")
339 if (((l != 0) && (a.
Size() != l)) || (a.
Size() == 0))
341 itkGenericExceptionMacro(<< errMsg);
350 template <
typename TValue>
354 const char * errMsg =
"Length Mismatch")
356 if (((l != 0) && (a->
Size() != l)) || (a->
Size() == 0))
358 itkGenericExceptionMacro(<< errMsg);
367 template <
typename TValue>
371 if (((l != 0) && (a.size() != l)) || (a.empty()))
373 itkGenericExceptionMacro(<< errMsg);
377 return static_cast<MeasurementVectorLength>(a.size());
382 template <
typename TValue>
386 if (((l != 0) && (a->size() != l)) || (a->size() == 0))
388 itkGenericExceptionMacro(<< errMsg);
397 template <
typename TArrayType>
399 Assign(TArrayType & m,
const TArrayType & v)
404 template <
typename TValue,
unsigned int VLength>
418 template <
typename TMeasurementVector>
422 using ValueType =
typename TMeasurementVector::ValueType;
425 template <
typename T>
435 template <
typename TPixelType>
456 class MeasurementVectorPixelTraits<unsigned char>
463 class MeasurementVectorPixelTraits<signed char>
470 class MeasurementVectorPixelTraits<unsigned short>
477 class MeasurementVectorPixelTraits<short>
484 class MeasurementVectorPixelTraits<unsigned int>
491 class MeasurementVectorPixelTraits<int>
498 class MeasurementVectorPixelTraits<unsigned long>
505 class MeasurementVectorPixelTraits<long>
512 class MeasurementVectorPixelTraits<unsigned long long>
519 class MeasurementVectorPixelTraits<long long>
526 class MeasurementVectorPixelTraits<float>
533 class MeasurementVectorPixelTraits<double>
544 #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