|
ITK
5.2.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>
75 template <
typename TValue1,
unsigned int VLength,
typename TValue2,
unsigned int VLength2>
79 const char * errMsg =
"Length Mismatch")
81 if (VLength != VLength2)
83 itkGenericExceptionMacro(<< errMsg);
88 template <
typename TValue1,
unsigned int VLength,
typename TValue2,
unsigned int VLength2>
92 const char * errMsg =
"Length Mismatch")
94 if (VLength != VLength2)
96 itkGenericExceptionMacro(<< errMsg);
101 template <
typename TValue1,
typename TValue2>
107 itkGenericExceptionMacro(<< errMsg);
112 template <
typename TValue1,
typename TValue2>
118 itkGenericExceptionMacro(<< errMsg);
123 template <
typename TValue1,
typename TValue2>
127 const char * errMsg =
"Length Mismatch")
131 itkGenericExceptionMacro(<< errMsg);
136 template <
typename TValue1,
typename TValue2>
140 const char * errMsg =
"Length Mismatch")
144 itkGenericExceptionMacro(<< errMsg);
149 template <
typename TValue1,
typename TValue2>
151 Assert(
const std::vector<TValue1> & a,
const std::vector<TValue2> & b,
const char * errMsg =
"Length Mismatch")
153 if (b.size() != a.size())
155 itkGenericExceptionMacro(<< errMsg);
160 template <
typename TValue1,
typename TValue2>
162 Assert(
const std::vector<TValue1> * a,
const std::vector<TValue2> * b,
const char * errMsg =
"Length Mismatch")
164 if (b->size() != a->size())
166 itkGenericExceptionMacro(<< errMsg);
171 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
181 if (b.
Size() != VLength)
183 itkGenericExceptionMacro(<< errMsg);
189 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
197 else if (b->
Size() != VLength)
199 itkGenericExceptionMacro(<< errMsg);
204 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
208 const char * errMsg =
"Length Mismatch")
216 if (b.
Size() != VLength)
218 itkGenericExceptionMacro(<< errMsg);
224 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
228 const char * errMsg =
"Length Mismatch")
234 else if (b->
Size() != VLength)
236 itkGenericExceptionMacro(<< errMsg);
241 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
251 if (b.size() != VLength)
253 itkGenericExceptionMacro(<< errMsg);
259 template <
typename TValue1,
unsigned int VLength,
typename TValue2>
267 else if (b->size() != VLength)
269 itkGenericExceptionMacro(<< errMsg);
274 template <
typename TValue1,
unsigned int VLength>
282 else if (l != VLength)
284 itkGenericExceptionMacro(<< errMsg);
289 template <
typename TValue1,
unsigned int VLength>
297 else if (l != VLength)
299 itkGenericExceptionMacro(<< errMsg);
304 template <
typename TValue>
308 if (((l != 0) && (a.
Size() != l)) || (a.
Size() == 0))
310 itkGenericExceptionMacro(<< errMsg);
319 template <
typename TValue>
323 if (((l != 0) && (a->
Size() != l)) || (a->
Size() == 0))
325 itkGenericExceptionMacro(<< errMsg);
334 template <
typename TValue>
338 const char * errMsg =
"Length Mismatch")
340 if (((l != 0) && (a.
Size() != l)) || (a.
Size() == 0))
342 itkGenericExceptionMacro(<< errMsg);
351 template <
typename TValue>
355 const char * errMsg =
"Length Mismatch")
357 if (((l != 0) && (a->
Size() != l)) || (a->
Size() == 0))
359 itkGenericExceptionMacro(<< errMsg);
368 template <
typename TValue>
372 if (((l != 0) && (a.size() != l)) || (a.empty()))
374 itkGenericExceptionMacro(<< errMsg);
378 return static_cast<MeasurementVectorLength>(a.size());
383 template <
typename TValue>
387 if (((l != 0) && (a->size() != l)) || (a->size() == 0))
389 itkGenericExceptionMacro(<< errMsg);
398 template <
typename TArrayType>
400 Assign(TArrayType & m,
const TArrayType & v)
405 template <
typename TValue,
unsigned int VLength>
419 template <
typename TMeasurementVector>
423 using ValueType =
typename TMeasurementVector::ValueType;
426 template <
typename T>
436 template <
typename TPixelType>
457 class MeasurementVectorPixelTraits<unsigned char>
464 class MeasurementVectorPixelTraits<signed char>
471 class MeasurementVectorPixelTraits<unsigned short>
478 class MeasurementVectorPixelTraits<signed short>
485 class MeasurementVectorPixelTraits<unsigned int>
492 class MeasurementVectorPixelTraits<signed int>
499 class MeasurementVectorPixelTraits<unsigned long>
506 class MeasurementVectorPixelTraits<signed long>
513 class MeasurementVectorPixelTraits<unsigned long long>
520 class MeasurementVectorPixelTraits<signed long long>
527 class MeasurementVectorPixelTraits<float>
534 class MeasurementVectorPixelTraits<double>
545 #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")
std::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