ITK  5.4.0
Insight Toolkit
itkCommonEnums.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
19// Place common enumerations to be used throughout the toolkit in this file
20#ifndef itkCommonEnums_h
21#define itkCommonEnums_h
22
23#include "itkIntTypes.h"
24#include <ostream>
25
26namespace itk
27{
28
39{
40public:
41 // Used in Input/Output for Images/Mesh/Transform types
49 enum class IOPixel : uint8_t
50 {
51 UNKNOWNPIXELTYPE,
52 SCALAR,
53 RGB,
54 RGBA,
55 OFFSET,
56 VECTOR,
57 POINT,
58 COVARIANTVECTOR,
59 SYMMETRICSECONDRANKTENSOR,
60 DIFFUSIONTENSOR3D,
61 COMPLEX,
62 FIXEDARRAY,
63 ARRAY,
64 MATRIX,
65 VARIABLELENGTHVECTOR,
66 VARIABLESIZEMATRIX
67 };
68
76 enum class IOComponent : uint8_t
77 {
78 UNKNOWNCOMPONENTTYPE,
79 UCHAR,
80 CHAR,
81 USHORT,
82 SHORT,
83 UINT,
84 INT,
85 ULONG,
86 LONG,
87 LONGLONG,
88 ULONGLONG,
89 FLOAT,
90 DOUBLE,
91 LDOUBLE
92 };
93
100 enum class IOFile : uint8_t
101 {
102 ASCII = 0,
103 Binary = 1,
104 TypeNotApplicable = 2,
105 // for backward compatibility
106 BINARY = 1, // Spelling difference between IOMeshBase and IOImageBase
107 TYPENOTAPPLICABLE = 2 // Spelling difference between IOMeshBase and IOImageBase
108 };
109
115 enum class IOFileMode : uint8_t
116 {
117 ReadMode,
118 WriteMode
119 };
120
127 enum class IOByteOrder : uint8_t
128 {
129 BigEndian,
130 LittleEndian,
131 OrderNotApplicable
132 };
133
138 enum class CellGeometry : uint8_t
139 {
140 VERTEX_CELL = 0,
141 LINE_CELL = 1,
142 TRIANGLE_CELL = 2,
143 QUADRILATERAL_CELL = 3,
144 POLYGON_CELL = 4,
145 TETRAHEDRON_CELL = 5,
146 HEXAHEDRON_CELL = 6,
147 QUADRATIC_EDGE_CELL = 7,
148 QUADRATIC_TRIANGLE_CELL = 8,
149 LAST_ITK_CELL = 9,
150 POLYLINE_CELL = 10,
151 MAX_ITK_CELLS = 255
152 };
153
154}; // CommonEnums
155
156// Convenience
163
164#if !defined(ITK_LEGACY_REMOVE)
166using IOPixelType = CommonEnums::IOPixel;
167using IOComponentType = CommonEnums::IOComponent;
168using IOFileType = CommonEnums::IOFile;
169using IOFileModeType = CommonEnums::IOFileMode;
170using IOByteOrderType = CommonEnums::IOByteOrder;
171using CellGeometryType = CommonEnums::CellGeometry;
172#endif
173// Define how to print enumeration
174extern ITKCommon_EXPORT std::ostream &
175 operator<<(std::ostream & out, IOPixelEnum value);
176extern ITKCommon_EXPORT std::ostream &
177 operator<<(std::ostream & out, IOComponentEnum value);
178extern ITKCommon_EXPORT std::ostream &
179 operator<<(std::ostream & out, IOFileEnum value);
180extern ITKCommon_EXPORT std::ostream &
181 operator<<(std::ostream & out, IOFileModeEnum value);
182extern ITKCommon_EXPORT std::ostream &
183 operator<<(std::ostream & out, IOByteOrderEnum value);
184extern ITKCommon_EXPORT std::ostream &
185 operator<<(std::ostream & out, CellGeometryEnum value);
192{
193public:
199 {
200 CellsAllocationMethodUndefined,
201 CellsAllocatedAsStaticArray,
202 CellsAllocatedAsADynamicArray,
203 CellsAllocatedDynamicallyCellByCell
204 };
205};
206extern ITKCommon_EXPORT std::ostream &
207 operator<<(std::ostream & out, MeshEnums::MeshClassCellsAllocationMethod value);
213{
214public:
215
221 enum class Octree : uint8_t
222 {
223 UNKNOWN_PLANE,
224 SAGITAL_PLANE,
225 CORONAL_PLANE,
226 TRANSVERSE_PLANE
227 };
228
229 /***
230 * \class LeafIdentifier
231 * \ingroup ITKCommon
232 */
233 enum class LeafIdentifier : uint8_t
234 {
235 ZERO = 0,
236 ONE = 1,
237 TWO = 2,
238 THREE = 3,
239 FOUR = 4,
240 FIVE = 5,
241 SIX = 6,
242 SEVEN = 7
243 };
244};
245
246// Define how to print enumeration
247extern ITKCommon_EXPORT std::ostream &
248 operator<<(std::ostream & out, const OctreeEnums::Octree value);
249extern ITKCommon_EXPORT std::ostream &
250 operator<<(std::ostream & out, const OctreeEnums::LeafIdentifier value);
255{
256public:
260 enum class RegionEnum : uint8_t
261 {
262 ITK_UNSTRUCTURED_REGION,
263 ITK_STRUCTURED_REGION
264 };
265};
266
267extern ITKCommon_EXPORT std::ostream &
268 operator<<(std::ostream & out, const ObjectEnums::RegionEnum value);
269
274{
275public:
281 enum class InsertionPosition : uint8_t
282 {
283 INSERT_AT_FRONT,
284 INSERT_AT_BACK,
285 INSERT_AT_POSITION
286 };
287};
288extern ITKCommon_EXPORT std::ostream &
289 operator<<(std::ostream & out, const ObjectFactoryEnums::InsertionPosition value);
290
291} // namespace itk
292
293#endif // itkCommonEnums_h
Common enums used across the toolkit.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:216