18 #ifndef __itkMeasurementVectorTraits_h
19 #define __itkMeasurementVectorTraits_h
22 #include "vnl/vnl_vector_fixed.h"
61 template<
class TVectorType >
75 template<
class TValueType1,
unsigned int VLength,
class TValueType2,
unsigned int VLength2 >
78 const char *errMsg =
"Length Mismatch")
80 if ( VLength != VLength2 )
82 itkGenericExceptionMacro(<< errMsg);
87 template<
class TValueType1,
unsigned int VLength,
class TValueType2,
unsigned int VLength2 >
90 const char *errMsg =
"Length Mismatch")
92 if ( VLength != VLength2 )
94 itkGenericExceptionMacro(<< errMsg);
99 template<
class TValueType1,
class TValueType2 >
105 itkGenericExceptionMacro(<< errMsg);
110 template<
class TValueType1,
class TValueType2 >
116 itkGenericExceptionMacro(<< errMsg);
121 template<
class TValueType1,
class TValueType2 >
124 const char *errMsg =
"Length Mismatch")
128 itkGenericExceptionMacro(<< errMsg);
133 template<
class TValueType1,
class TValueType2 >
136 const char *errMsg =
"Length Mismatch")
140 itkGenericExceptionMacro(<< errMsg);
145 template<
class TValueType1,
class TValueType2 >
147 const std::vector< TValueType2 > & b,
const char *errMsg =
"Length Mismatch")
149 if ( b.size() != a.size() )
151 itkGenericExceptionMacro(<< errMsg);
156 template<
class TValueType1,
class TValueType2 >
158 const std::vector< TValueType2 > *b,
const char *errMsg =
"Length Mismatch")
160 if ( b->size() != a->size() )
162 itkGenericExceptionMacro(<< errMsg);
167 template<
class TValueType1,
unsigned int VLength,
class TValueType2 >
177 if ( b.
Size() != VLength )
179 itkGenericExceptionMacro(<< errMsg);
185 template<
class TValueType1,
unsigned int VLength,
class TValueType2 >
189 if ( b->
Size() == 0 )
193 else if ( b->
Size() != VLength )
195 itkGenericExceptionMacro(<< errMsg);
200 template<
class TValueType1,
unsigned int VLength,
class TValueType2 >
203 const char *errMsg =
"Length Mismatch")
211 if ( b.
Size() != VLength )
213 itkGenericExceptionMacro(<< errMsg);
219 template<
class TValueType1,
unsigned int VLength,
class TValueType2 >
222 const char *errMsg =
"Length Mismatch")
224 if ( b->
Size() == 0 )
228 else if ( b->
Size() != VLength )
230 itkGenericExceptionMacro(<< errMsg);
235 template<
class TValueType1,
unsigned int VLength,
class TValueType2 >
237 const std::vector< TValueType2 > & b,
const char *errMsg =
"Length Mismatch")
245 if ( b.size() != VLength )
247 itkGenericExceptionMacro(<< errMsg);
253 template<
class TValueType1,
unsigned int VLength,
class TValueType2 >
255 const std::vector< TValueType2 > *b,
const char *errMsg =
"Length Mismatch")
257 if ( b->size() == 0 )
261 else if ( b->size() != VLength )
263 itkGenericExceptionMacro(<< errMsg);
268 template<
class TValueType1,
unsigned int VLength >
276 else if ( l != VLength )
278 itkGenericExceptionMacro(<< errMsg);
283 template<
class TValueType1,
unsigned int VLength >
291 else if ( l != VLength )
293 itkGenericExceptionMacro(<< errMsg);
298 template<
class TValueType >
302 if ( ( ( l != 0 ) && ( a.
Size() != l ) ) || ( a.
Size() == 0 ) )
304 itkGenericExceptionMacro(<< errMsg);
313 template<
class TValueType >
317 if ( ( ( l != 0 ) && ( a->
Size() != l ) ) || ( a->
Size() == 0 ) )
319 itkGenericExceptionMacro(<< errMsg);
328 template<
class TValueType >
332 if ( ( ( l != 0 ) && ( a.
Size() != l ) ) || ( a.
Size() == 0 ) )
334 itkGenericExceptionMacro(<< errMsg);
343 template<
class TValueType >
347 if ( ( ( l != 0 ) && ( a->
Size() != l ) ) || ( a->
Size() == 0 ) )
349 itkGenericExceptionMacro(<< errMsg);
358 template<
class TValueType >
362 if ( ( ( l != 0 ) && ( a.size() != l ) ) || ( a.size() == 0 ) )
364 itkGenericExceptionMacro(<< errMsg);
373 template<
class TValueType >
377 if ( ( ( l != 0 ) && ( a->size() != l ) ) || ( a->size() == 0 ) )
379 itkGenericExceptionMacro(<< errMsg);
388 template<
class TArrayType >
389 static void Assign(TArrayType & m,
const TArrayType & v)
394 template<
class TValueType,
unsigned int VLength >
407 template<
class TMeasurementVector >
411 typedef typename TMeasurementVector::ValueType
ValueType;
424 template<
class TPixelType >
445 class MeasurementVectorPixelTraits< unsigned char >
452 class MeasurementVectorPixelTraits< signed char >
459 class MeasurementVectorPixelTraits< unsigned short >
466 class MeasurementVectorPixelTraits< signed short >
473 class MeasurementVectorPixelTraits< unsigned int >
480 class MeasurementVectorPixelTraits< signed int >
487 class MeasurementVectorPixelTraits< unsigned long >
494 class MeasurementVectorPixelTraits< signed long >
501 class MeasurementVectorPixelTraits< float >
508 class MeasurementVectorPixelTraits< double >
519 #endif // __itkMeasurementVectorTraits_h