go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxPixelType.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef elxPixelType_h
19 #define elxPixelType_h
20 
21 namespace elastix
22 {
23 // PixelType traits for writing types as strings to parameter files
24 
25 // Default implementation
26 template< typename T >
27 struct PixelType
28 {
29  static const char * ToString()
30  {
31  itkGenericExceptionMacro( "Pixel type \"" << typeid( T ).name() << "\" is not supported." )
32  }
33 
34 
35 };
36 
37 template< >
38 struct PixelType< char >
39 {
40  static const char * ToString()
41  {
42  return "char";
43  }
44 
45 
46 };
47 
48 template< >
49 struct PixelType< unsigned char >
50 {
51  static const char * ToString()
52  {
53  return "unsigned char";
54  }
55 
56 
57 };
58 
59 template< >
60 struct PixelType< short >
61 {
62  static const char * ToString()
63  {
64  return "short";
65  }
66 
67 
68 };
69 
70 template< >
71 struct PixelType< unsigned short >
72 {
73  static const char * ToString()
74  {
75  return "unsigned short";
76  }
77 
78 
79 };
80 
81 template< >
82 struct PixelType< int >
83 {
84  static const char * ToString()
85  {
86  return "int";
87  }
88 
89 
90 };
91 
92 template< >
93 struct PixelType< unsigned int >
94 {
95  static const char * ToString()
96  {
97  return "unsigned int";
98  }
99 
100 
101 };
102 
103 template< >
104 struct PixelType< long >
105 {
106  static const char * ToString()
107  {
108  return "long";
109  }
110 
111 
112 };
113 
114 template< >
115 struct PixelType< unsigned long >
116 {
117  static const char * ToString()
118  {
119  return "unsigned long";
120  }
121 
122 
123 };
124 
125 template< >
126 struct PixelType< float >
127 {
128  static const char * ToString()
129  {
130  return "float";
131  }
132 
133 
134 };
135 
136 template< >
137 struct PixelType< double >
138 {
139  static const char * ToString()
140  {
141  return "double";
142  }
143 
144 
145 };
146 
147 }
148 
149 #endif // elxPixelType_h
elastix::PixelType< unsigned long >::ToString
static const char * ToString()
Definition: elxPixelType.h:117
elastix::PixelType< unsigned int >::ToString
static const char * ToString()
Definition: elxPixelType.h:95
elastix::PixelType< char >::ToString
static const char * ToString()
Definition: elxPixelType.h:40
elastix::PixelType< float >::ToString
static const char * ToString()
Definition: elxPixelType.h:128
elastix::PixelType< short >::ToString
static const char * ToString()
Definition: elxPixelType.h:62
double
elastix::PixelType::ToString
static const char * ToString()
Definition: elxPixelType.h:29
elastix::PixelType< double >::ToString
static const char * ToString()
Definition: elxPixelType.h:139
elastix::PixelType
Definition: elxPixelType.h:28
elastix::PixelType< unsigned short >::ToString
static const char * ToString()
Definition: elxPixelType.h:73
elastix::PixelType< long >::ToString
static const char * ToString()
Definition: elxPixelType.h:106
elastix::PixelType< int >::ToString
static const char * ToString()
Definition: elxPixelType.h:84
elastix::PixelType< unsigned char >::ToString
static const char * ToString()
Definition: elxPixelType.h:51
elastix
Definition: elxFixedGenericPyramid.h:25
float
int


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.18 elastix logo