My Project
pixeltype.hh
Go to the documentation of this file.
1/* -*- mia-c++ -*-
2 *
3 * This file is part of MIA - a toolbox for medical image analysis
4 * Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
5 *
6 * MIA is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with MIA; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef mia_core_pixeltype_hh
22#define mia_core_pixeltype_hh
23
24#include <mia/core/dictmap.hh>
25#include <miaconfig.h>
26
28
45 };
46
52 pc_range,
55 pc_opt,
61 };
62
63
66
69
72
75
80template <typename T>
81struct pixel_type {
82 static const EPixelType value = it_unknown;
83};
84
85template <>
86struct pixel_type<bool> {
87 static const EPixelType value = it_bit;
88};
89
90template <>
91struct pixel_type<int8_t> {
92 static const EPixelType value = it_sbyte;
93};
94
95template <>
96struct pixel_type<uint8_t> {
97 static const EPixelType value = it_ubyte;
98};
99
100template <>
101struct pixel_type<int16_t> {
102 static const EPixelType value = it_sshort;
103};
104
105template <>
106struct pixel_type<uint16_t> {
107 static const EPixelType value = it_ushort;
108};
109
110template <>
111struct pixel_type<int32_t> {
112 static const EPixelType value = it_sint;
113};
114
115template <>
116struct pixel_type<uint32_t> {
117 static const EPixelType value = it_uint;
118};
119
120template <>
121struct pixel_type<int64_t> {
122 static const EPixelType value = it_slong;
123};
124
125template <>
126struct pixel_type<uint64_t> {
127 static const EPixelType value = it_ulong;
128};
129
130template <>
131struct pixel_type<float> {
132 static const EPixelType value = it_float;
133};
134
135template <>
136struct pixel_type<double> {
137 static const EPixelType value = it_double;
138};
139
141
143
144#endif
A mapper from emums to string values. - usefull for names flags.
Definition: dictmap.hh:46
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition: defines.hh:33
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition: defines.hh:101
#define NS_MIA_END
conveniance define to end the mia namespace
Definition: defines.hh:36
EXPORT_CORE const TDictMap< EPixelType > CPixelTypeDict
dictionary for the pixel types
EPixelConversion
Definition: pixeltype.hh:50
@ pc_opt
Definition: pixeltype.hh:55
@ pc_range
Definition: pixeltype.hh:52
@ pc_opt_stat
Definition: pixeltype.hh:57
@ pc_copy
Definition: pixeltype.hh:50
@ pc_linear
Definition: pixeltype.hh:51
@ pc_unknown
Definition: pixeltype.hh:60
EXPORT_CORE const TDictMap< EPixelType >::Table PixelTypeTable[]
dictionary table for the pixel types
EXPORT_CORE const TDictMap< EPixelConversion > CPixelConversionDict
dictionary for the pixel conversion types
EPixelType
Definition: pixeltype.hh:32
@ it_slong
Definition: pixeltype.hh:39
@ it_ushort
Definition: pixeltype.hh:36
@ it_float
Definition: pixeltype.hh:41
@ it_unknown
Definition: pixeltype.hh:44
@ it_ubyte
Definition: pixeltype.hh:34
@ it_uint
Definition: pixeltype.hh:38
@ it_double
Definition: pixeltype.hh:42
@ it_none
Definition: pixeltype.hh:43
@ it_ulong
Definition: pixeltype.hh:40
@ it_sbyte
Definition: pixeltype.hh:33
@ it_sshort
Definition: pixeltype.hh:35
@ it_sint
Definition: pixeltype.hh:37
@ it_bit
Definition: pixeltype.hh:32
EXPORT_CORE const TDictMap< EPixelConversion >::Table ConversionTypeTable[]
dictionary table for the pixel conversion types