| 1 |
|
/*========================================================================= |
| 2 |
|
|
| 3 |
|
Program: Insight Segmentation & Registration Toolkit |
| 4 |
|
Module: $RCSfile: itkNumericTraitsVariableLengthVectorPixel.h.html,v $ |
| 5 |
|
Language: C++ |
| 6 |
|
Date: $Date: 2006/01/17 19:15:42 $ |
| 7 |
|
Version: $Revision: 1.4 $ |
| 8 |
|
|
| 9 |
|
Copyright (c) Insight Software Consortium. All rights reserved. |
| 10 |
|
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. |
| 11 |
|
|
| 12 |
|
This software is distributed WITHOUT ANY WARRANTY; without even |
| 13 |
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
| 14 |
|
PURPOSE. See the above copyright notices for more information. |
| 15 |
|
|
| 16 |
|
=========================================================================*/ |
| 17 |
DEF |
#ifndef __itkNumericTraitsVariableLengthVector_h |
| 18 |
DEF |
#define __itkNumericTraitsVariableLengthVector_h |
| 19 |
|
|
| 20 |
|
#include "itkNumericTraits.h" |
| 21 |
|
#include "itkVariableLengthVector.h" |
| 22 |
|
|
| 23 |
LEN |
// This file is defines numeric traits for VariableLengthVector< T > as pixel type |
| 24 |
LEN |
// Note that the Zero and the One methods here take references to a pixel as input. |
| 25 |
|
// This is due to the fact that the length of the VariableLengthVector is not |
| 26 |
|
// known until run-time. Since the most common use of Zero and One is for |
| 27 |
|
// comparison purposes or initialization of sums etc, this might just as easily |
| 28 |
LEN |
// be re-written with a pixel passed in as a reference and the length is inferred |
| 29 |
|
// from this pixel. |
| 30 |
|
// |
| 31 |
|
// This work is part of the National Alliance for Medical Image Computing |
| 32 |
|
// (NAMIC), funded by the National Institutes of Health through the NIH Roadmap |
| 33 |
|
// for Medical Research, Grant U54 EB005149. |
| 34 |
|
|
| 35 |
|
namespace itk |
| 36 |
|
{ |
| 37 |
|
template <> class NumericTraits<VariableLengthVector<unsigned char > > { |
| 38 |
|
public: |
| 39 |
|
typedef VariableLengthVector<unsigned char> ValueType; |
| 40 |
|
typedef VariableLengthVector<unsigned char> PrintType; |
| 41 |
|
typedef VariableLengthVector<unsigned char> AbsType; |
| 42 |
TDA |
typedef VariableLengthVector<unsigned short> AccumulateType; |
| 43 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 44 |
TDA |
typedef double ScalarRealType; |
| 45 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 46 |
|
static const VariableLengthVector<unsigned char> ITKCommon_EXPORT |
| 47 |
IND |
************************Zero( const VariableLengthVector< unsigned char > & ); |
| 48 |
|
static const VariableLengthVector<unsigned char> ITKCommon_EXPORT |
| 49 |
IND |
************************One(const VariableLengthVector< unsigned char >&); |
| 50 |
|
}; |
| 51 |
|
template <> class NumericTraits<VariableLengthVector<signed char> > { |
| 52 |
|
public: |
| 53 |
|
typedef VariableLengthVector<signed char> ValueType; |
| 54 |
|
typedef VariableLengthVector<signed char> PrintType; |
| 55 |
TDA |
typedef VariableLengthVector<unsigned char> AbsType; |
| 56 |
TDA |
typedef VariableLengthVector<short> AccumulateType; |
| 57 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 58 |
TDA |
typedef double ScalarRealType; |
| 59 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 60 |
|
static const VariableLengthVector<signed char> ITKCommon_EXPORT |
| 61 |
IND |
************************Zero( const VariableLengthVector< signed char > & ); |
| 62 |
|
static const VariableLengthVector<signed char> ITKCommon_EXPORT |
| 63 |
IND |
************************One(const VariableLengthVector< signed char >&); |
| 64 |
|
}; |
| 65 |
|
template <> class NumericTraits<VariableLengthVector<char> > { |
| 66 |
|
public: |
| 67 |
|
typedef VariableLengthVector<char> ValueType; |
| 68 |
|
typedef VariableLengthVector<char> PrintType; |
| 69 |
TDA |
typedef VariableLengthVector<unsigned char> AbsType; |
| 70 |
TDA |
typedef VariableLengthVector<short> AccumulateType; |
| 71 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 72 |
TDA |
typedef double ScalarRealType; |
| 73 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 74 |
|
static const VariableLengthVector<char> ITKCommon_EXPORT |
| 75 |
IND |
************************Zero( const VariableLengthVector< char > & ); |
| 76 |
|
static const VariableLengthVector<char> ITKCommon_EXPORT |
| 77 |
IND |
************************One(const VariableLengthVector< char >&); |
| 78 |
|
}; |
| 79 |
|
template <> class NumericTraits<VariableLengthVector<short> > { |
| 80 |
|
public: |
| 81 |
|
typedef VariableLengthVector<short> ValueType; |
| 82 |
|
typedef VariableLengthVector<short> PrintType; |
| 83 |
TDA |
typedef VariableLengthVector<unsigned short> AbsType; |
| 84 |
TDA |
typedef VariableLengthVector<int> AccumulateType; |
| 85 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 86 |
TDA |
typedef double ScalarRealType; |
| 87 |
|
typedef VariableLengthVector<float> FloatType; |
| 88 |
|
static const VariableLengthVector<short> ITKCommon_EXPORT |
| 89 |
IND |
************************Zero( const VariableLengthVector< short > & ); |
| 90 |
|
static const VariableLengthVector<short> ITKCommon_EXPORT |
| 91 |
IND |
************************One(const VariableLengthVector< short >&); |
| 92 |
|
}; |
| 93 |
|
template <> class NumericTraits<VariableLengthVector<unsigned short> > { |
| 94 |
|
public: |
| 95 |
|
typedef VariableLengthVector<unsigned short> ValueType; |
| 96 |
|
typedef VariableLengthVector<unsigned short> PrintType; |
| 97 |
|
typedef VariableLengthVector<unsigned short> AbsType; |
| 98 |
TDA |
typedef VariableLengthVector<unsigned int> AccumulateType; |
| 99 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 100 |
TDA |
typedef double ScalarRealType; |
| 101 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 102 |
|
static const VariableLengthVector<unsigned short> ITKCommon_EXPORT |
| 103 |
IND |
************************Zero( const VariableLengthVector< unsigned short > & ); |
| 104 |
|
static const VariableLengthVector<unsigned short> ITKCommon_EXPORT |
| 105 |
IND |
************************One(const VariableLengthVector< unsigned short >&); |
| 106 |
|
}; |
| 107 |
|
template <> class NumericTraits<VariableLengthVector<int> > { |
| 108 |
|
public: |
| 109 |
|
typedef VariableLengthVector<int> ValueType; |
| 110 |
|
typedef VariableLengthVector<int> PrintType; |
| 111 |
TDA |
typedef VariableLengthVector<unsigned int> AbsType; |
| 112 |
TDA |
typedef VariableLengthVector<long> AccumulateType; |
| 113 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 114 |
TDA |
typedef double ScalarRealType; |
| 115 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 116 |
|
static const VariableLengthVector<int> ITKCommon_EXPORT |
| 117 |
IND |
************************Zero( const VariableLengthVector< int > & ); |
| 118 |
|
static const VariableLengthVector<int> ITKCommon_EXPORT |
| 119 |
IND |
************************One(const VariableLengthVector< int >&); |
| 120 |
|
}; |
| 121 |
|
template <> class NumericTraits<VariableLengthVector<unsigned int> > { |
| 122 |
|
public: |
| 123 |
|
typedef VariableLengthVector<unsigned int> ValueType; |
| 124 |
|
typedef VariableLengthVector<unsigned int> PrintType; |
| 125 |
|
typedef VariableLengthVector<unsigned int> AbsType; |
| 126 |
TDA |
typedef VariableLengthVector<unsigned long> AccumulateType; |
| 127 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 128 |
TDA |
typedef double ScalarRealType; |
| 129 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 130 |
|
static const VariableLengthVector<unsigned int> ITKCommon_EXPORT |
| 131 |
IND |
************************Zero( const VariableLengthVector< unsigned int > & ); |
| 132 |
|
static const VariableLengthVector<unsigned int> ITKCommon_EXPORT |
| 133 |
IND |
************************One(const VariableLengthVector< unsigned int >&); |
| 134 |
|
}; |
| 135 |
|
template <> class NumericTraits<VariableLengthVector<long> > { |
| 136 |
|
public: |
| 137 |
|
typedef VariableLengthVector<long> ValueType; |
| 138 |
|
typedef VariableLengthVector<long> PrintType; |
| 139 |
TDA |
typedef VariableLengthVector<unsigned long> AbsType; |
| 140 |
|
typedef VariableLengthVector<long> AccumulateType; |
| 141 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 142 |
TDA |
typedef double ScalarRealType; |
| 143 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 144 |
|
static const VariableLengthVector<long> ITKCommon_EXPORT |
| 145 |
IND |
************************Zero( const VariableLengthVector< long > & ); |
| 146 |
|
static const VariableLengthVector<long> ITKCommon_EXPORT |
| 147 |
IND |
************************One(const VariableLengthVector< long >&); |
| 148 |
|
}; |
| 149 |
|
template <> class NumericTraits<VariableLengthVector<unsigned long> > { |
| 150 |
|
public: |
| 151 |
|
typedef VariableLengthVector<unsigned long> ValueType; |
| 152 |
|
typedef VariableLengthVector<unsigned long> PrlongType; |
| 153 |
|
typedef VariableLengthVector<unsigned long> AbsType; |
| 154 |
|
typedef VariableLengthVector<unsigned long> AccumulateType; |
| 155 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 156 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 157 |
|
static const VariableLengthVector<unsigned long> ITKCommon_EXPORT |
| 158 |
IND |
************************Zero( const VariableLengthVector< unsigned long > & ); |
| 159 |
|
static const VariableLengthVector<unsigned long> ITKCommon_EXPORT |
| 160 |
IND |
************************One(const VariableLengthVector< unsigned long >&); |
| 161 |
|
}; |
| 162 |
|
template <> class NumericTraits<VariableLengthVector<float> > { |
| 163 |
|
public: |
| 164 |
|
typedef VariableLengthVector<float> ValueType; |
| 165 |
|
typedef VariableLengthVector<float> PrintType; |
| 166 |
|
typedef VariableLengthVector<float> AbsType; |
| 167 |
TDA |
typedef VariableLengthVector<double> AccumulateType; |
| 168 |
TDA |
typedef VariableLengthVector<double> RealType; |
| 169 |
TDA |
typedef double ScalarRealType; |
| 170 |
|
typedef VariableLengthVector<float> FloatType; |
| 171 |
|
static const VariableLengthVector<float> ITKCommon_EXPORT |
| 172 |
IND |
************************Zero( const VariableLengthVector< float > & ); |
| 173 |
|
static const VariableLengthVector<float> ITKCommon_EXPORT |
| 174 |
IND |
************************One(const VariableLengthVector< float >&); |
| 175 |
|
}; |
| 176 |
|
template <> class NumericTraits<VariableLengthVector<double> > { |
| 177 |
|
public: |
| 178 |
|
typedef VariableLengthVector<double> ValueType; |
| 179 |
|
typedef VariableLengthVector<double> PrintType; |
| 180 |
|
typedef VariableLengthVector<double> AbsType; |
| 181 |
TDA |
typedef VariableLengthVector<long double> AccumulateType; |
| 182 |
|
typedef VariableLengthVector<double> RealType; |
| 183 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 184 |
TDA |
typedef double ScalarRealType; |
| 185 |
|
static const VariableLengthVector<double> ITKCommon_EXPORT |
| 186 |
IND |
************************Zero( const VariableLengthVector< double > & ); |
| 187 |
|
static const VariableLengthVector<double> ITKCommon_EXPORT |
| 188 |
IND |
************************One(const VariableLengthVector< double >&); |
| 189 |
|
}; |
| 190 |
|
template <> class NumericTraits<VariableLengthVector<long double> > { |
| 191 |
|
public: |
| 192 |
|
typedef VariableLengthVector<long double> ValueType; |
| 193 |
|
typedef VariableLengthVector<long double> PrintType; |
| 194 |
|
typedef VariableLengthVector<long double> AbsType; |
| 195 |
|
typedef VariableLengthVector<long double> AccumulateType; |
| 196 |
|
typedef VariableLengthVector<long double> RealType; |
| 197 |
TDA |
typedef long double ScalarRealType; |
| 198 |
TDA |
typedef VariableLengthVector<float> FloatType; |
| 199 |
|
static const VariableLengthVector<long double> ITKCommon_EXPORT |
| 200 |
IND |
************************Zero( const VariableLengthVector< long double > & ); |
| 201 |
|
static const VariableLengthVector<long double> ITKCommon_EXPORT |
| 202 |
IND |
************************One(const VariableLengthVector< long double >&); |
| 203 |
|
}; |
| 204 |
|
|
| 205 |
|
} // end namespace itk |
| 206 |
|
|
| 207 |
|
#endif // __itkNumericTraitsVariableLengthVector_h |
| 208 |
|
|
| 209 |
EOF |
|