go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
elxPixelTypeToString.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
21namespace elastix
22{
23// Helper function (template) for writing pixel types as strings to parameter files
24// `PixelTypeToString()` is only supported for the template specializations below here.
25template <typename>
26constexpr const char *
28
29
30template <>
31constexpr const char *
33{
34 return "char";
35}
36
37template <>
38constexpr const char *
40{
41 return "unsigned char";
42}
43
44template <>
45constexpr const char *
47{
48 return "short";
49}
50
51template <>
52constexpr const char *
54{
55 return "unsigned short";
56}
57
58template <>
59constexpr const char *
61{
62 return "int";
63}
64
65template <>
66constexpr const char *
68{
69 return "unsigned int";
70}
71
72template <>
73constexpr const char *
75{
76 return "long";
77}
78
79template <>
80constexpr const char *
82{
83 return "unsigned long";
84}
85
86template <>
87constexpr const char *
89{
90 return "float";
91}
92
93template <>
94constexpr const char *
96{
97 return "double";
98}
99
100} // namespace elastix
101
102#endif // elxPixelType_h
constexpr const char * PixelTypeToString< unsigned long >()
constexpr const char * PixelTypeToString< float >()
constexpr const char * PixelTypeToString< char >()
constexpr const char * PixelTypeToString()=delete
constexpr const char * PixelTypeToString< int >()
constexpr const char * PixelTypeToString< double >()
constexpr const char * PixelTypeToString< unsigned int >()
constexpr const char * PixelTypeToString< unsigned short >()
constexpr const char * PixelTypeToString< unsigned char >()
constexpr const char * PixelTypeToString< long >()
constexpr const char * PixelTypeToString< short >()


Generated on Wed 12 Apr 2023 for elastix by doxygen 1.9.6 elastix logo