|
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 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);
370 return static_cast<MeasurementVectorLength>(a.size());
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>
410 template <
typename TMeasurementVector>
414 using ValueType =
typename TMeasurementVector::ValueType;
417 template <
typename T>
427 template <
typename TPixelType>
448 class MeasurementVectorPixelTraits<unsigned char>
455 class MeasurementVectorPixelTraits<signed char>
462 class MeasurementVectorPixelTraits<unsigned short>
469 class MeasurementVectorPixelTraits<short>
476 class MeasurementVectorPixelTraits<unsigned int>
483 class MeasurementVectorPixelTraits<int>
490 class MeasurementVectorPixelTraits<unsigned long>
497 class MeasurementVectorPixelTraits<long>
504 class MeasurementVectorPixelTraits<unsigned long long>
511 class MeasurementVectorPixelTraits<long long>
518 class MeasurementVectorPixelTraits<float>
525 class MeasurementVectorPixelTraits<double>
536 #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