File: itkCommonEnums.h

package info (click to toggle)
insighttoolkit5 5.4.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 704,384 kB
  • sloc: cpp: 783,592; ansic: 628,724; xml: 44,704; fortran: 34,250; python: 22,874; sh: 4,078; pascal: 2,636; lisp: 2,158; makefile: 464; yacc: 328; asm: 205; perl: 203; lex: 146; tcl: 132; javascript: 98; csh: 81
file content (290 lines) | stat: -rw-r--r-- 7,541 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
/*=========================================================================
 *
 *  Copyright NumFOCUS
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *         https://www.apache.org/licenses/LICENSE-2.0.txt
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *=========================================================================*/

// Place common enumerations to be used throughout the toolkit in this file
#ifndef itkCommonEnums_h
#define itkCommonEnums_h

#include "itkIntTypes.h"
#include <ostream>

namespace itk
{

/** \class CommonEnums
 *
 * \brief Common enums used across the toolkit
 *
 * This class encapsulates the common enum classes. It is required for
 * wrapping.
 *
 * \ingroup ITKCommon
 **/
class CommonEnums
{
public:
  // Used in Input/Output for Images/Mesh/Transform types
  /**
   * \class IOPixel
   * \ingroup ITKCommon
   * Enums used to manipulate the point/cell pixel type. The pixel type provides
   * context for automatic data conversions (for instance, RGB to
   * SCALAR, VECTOR to SCALAR).
   */
  enum class IOPixel : uint8_t
  {
    UNKNOWNPIXELTYPE,
    SCALAR,
    RGB,
    RGBA,
    OFFSET,
    VECTOR,
    POINT,
    COVARIANTVECTOR,
    SYMMETRICSECONDRANKTENSOR,
    DIFFUSIONTENSOR3D,
    COMPLEX,
    FIXEDARRAY,
    ARRAY,
    MATRIX,
    VARIABLELENGTHVECTOR,
    VARIABLESIZEMATRIX
  };

  /**
   * \class IOComponent
   * \ingroup ITKCommon
   * Enums used to manipulate the component type. The component type
   * refers to the actual storage class associated with either a
   * SCALAR pixel type or elements of a compound pixel.
   */
  enum class IOComponent : uint8_t
  {
    UNKNOWNCOMPONENTTYPE,
    UCHAR,
    CHAR,
    USHORT,
    SHORT,
    UINT,
    INT,
    ULONG,
    LONG,
    LONGLONG,
    ULONGLONG,
    FLOAT,
    DOUBLE,
    LDOUBLE
  };

  /**
   * \class IOFile
   * \ingroup ITKCommon
   * Enums used to specify write style: whether binary or ASCII. Some
   * subclasses use this, some ignore it.
   */
  enum class IOFile : uint8_t
  {
    ASCII = 0,
    Binary = 1,
    TypeNotApplicable = 2,
    // for backward compatibility
    BINARY = 1,           // Spelling difference between IOMeshBase and IOImageBase
    TYPENOTAPPLICABLE = 2 // Spelling difference between IOMeshBase and IOImageBase
  };

  /**
   * \class IOFileMode
   * \ingroup ITKCommon
   * Mode in which the files is intended to be used
   */
  enum class IOFileMode : uint8_t
  {
    ReadMode,
    WriteMode
  };

  /**
   * \class IOByteOrder
   * \ingroup ITKCommon
   * Enums used to specify byte order; whether Big Endian or Little Endian.
   * Some subclasses use this, some ignore it.
   */
  enum class IOByteOrder : uint8_t
  {
    BigEndian,
    LittleEndian,
    OrderNotApplicable
  };

  /**
   * \class CellGeometry
   * \ingroup ITKCommon
   * Enums used to specify cell type */
  enum class CellGeometry : uint8_t
  {
    VERTEX_CELL = 0,
    LINE_CELL = 1,
    TRIANGLE_CELL = 2,
    QUADRILATERAL_CELL = 3,
    POLYGON_CELL = 4,
    TETRAHEDRON_CELL = 5,
    HEXAHEDRON_CELL = 6,
    QUADRATIC_EDGE_CELL = 7,
    QUADRATIC_TRIANGLE_CELL = 8,
    LAST_ITK_CELL = 9,
    POLYLINE_CELL = 10,
    MAX_ITK_CELLS = 255
  };

}; // CommonEnums

// Convenience
using IOPixelEnum = CommonEnums::IOPixel;
using IOComponentEnum = CommonEnums::IOComponent;
using IOFileEnum = CommonEnums::IOFile;
using IOFileModeEnum = CommonEnums::IOFileMode;
using IOByteOrderEnum = CommonEnums::IOByteOrder;
using CellGeometryEnum = CommonEnums::CellGeometry;

#if !defined(ITK_LEGACY_REMOVE)
/** Expose old names for backwards compatibility*/
using IOPixelType = CommonEnums::IOPixel;
using IOComponentType = CommonEnums::IOComponent;
using IOFileType = CommonEnums::IOFile;
using IOFileModeType = CommonEnums::IOFileMode;
using IOByteOrderType = CommonEnums::IOByteOrder;
using CellGeometryType = CommonEnums::CellGeometry;
#endif
// Define how to print enumeration
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, IOPixelEnum value);
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, IOComponentEnum value);
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, IOFileEnum value);
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, IOFileModeEnum value);
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, IOByteOrderEnum value);
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, CellGeometryEnum value);

/** \class MeshEnums
 * \ingroup ITKCommon
 */
class MeshEnums
{
public:
  /** \class MeshClassCellsAllocationMethod
   * \ingroup ITKCommon
   * Enum defining the possible methods used to allocate memory for
   * the Cells */
  enum class MeshClassCellsAllocationMethod : uint8_t
  {
    CellsAllocationMethodUndefined,
    CellsAllocatedAsStaticArray,
    CellsAllocatedAsADynamicArray,
    CellsAllocatedDynamicallyCellByCell
  };
};
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, MeshEnums::MeshClassCellsAllocationMethod value);
/**
 * \class OctreeEnums
 * \ingroup ITKCommon
 */
class OctreeEnums
{
public:
  /**
   * \class Octree
   * \ingroup ITKCommon
   * The enumeration to define the planar orientation of the octree
   */
  enum class Octree : uint8_t
  {
    UNKNOWN_PLANE,   ///< The plane is Unknown
    SAGITAL_PLANE,   ///< The plane is Sagittal
    CORONAL_PLANE,   ///< The plane is Coronal
    TRANSVERSE_PLANE ///< The plane is Transverse
  };
  /***
   * \class LeafIdentifier
   * \ingroup ITKCommon
   */
  enum class LeafIdentifier : uint8_t
  {
    ZERO = 0,
    ONE = 1,
    TWO = 2,
    THREE = 3,
    FOUR = 4,
    FIVE = 5,
    SIX = 6,
    SEVEN = 7
  };
};

// Define how to print enumeration
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, const OctreeEnums::Octree value);
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, const OctreeEnums::LeafIdentifier value);
/** \class ObjectEnums
 * \ingroup ITKCommon
 */
class ObjectEnums
{
public:
  /** \class RegionEnum
   * \ingroup ITKCommon
   * Enums used to describe the extent types. */
  enum class RegionEnum : uint8_t
  {
    ITK_UNSTRUCTURED_REGION,
    ITK_STRUCTURED_REGION
  };
};

extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, const ObjectEnums::RegionEnum value);

/** \class ObjectFactoryEnums
 * \ingroup ITKCommon
 */
class ObjectFactoryEnums
{
public:
  /** \class InsertionPosition
   *  \ingroup ITKCommon
   *  Position at which the new factory will be registered in the
   *  internal factory container.
   */
  enum class InsertionPosition : uint8_t
  {
    INSERT_AT_FRONT,
    INSERT_AT_BACK,
    INSERT_AT_POSITION
  };
};
extern ITKCommon_EXPORT std::ostream &
                        operator<<(std::ostream & out, const ObjectFactoryEnums::InsertionPosition value);

} // namespace itk

#endif // itkCommonEnums_h