ITK  6.0.0
Insight Toolkit
itkIOCommon.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 #ifndef itkIOCommon_h
19 #define itkIOCommon_h
20 #include "ITKIOImageBaseExport.h"
21 
22 
23 #include "itkIntTypes.h"
24 #include "itkProcessObject.h"
25 #include "itkSpatialOrientation.h"
26 
27 namespace itk
28 {
34 {
35 public:
40  enum class AtomicPixel : uint8_t
41  {
42  ITK_UCHAR, // aka uint8_t
43  ITK_CHAR,
44  ITK_USHORT, // aka uint16_t
45  ITK_SHORT,
46  ITK_UINT, // aka uint32_t
47  ITK_INT,
48  ITK_ULONG, // aka uint64_t
49  ITK_LONG,
50  ITK_FLOAT,
52  };
53 };
54 // Define how to print enumeration
55 extern ITKIOImageBase_EXPORT std::ostream &
56  operator<<(std::ostream & out, const IOCommonEnums::AtomicPixel value);
57 
63  enum class AtomicPixel : uint8_t
64  {
65  ITK_UCHAR, // aka uint8_t
66  ITK_CHAR,
67  ITK_USHORT, // aka uint16_t
68  ITK_SHORT,
69  ITK_UINT, // aka uint32_t
70  ITK_INT,
71  ITK_ULONG, // aka uint64_t
72  ITK_LONG,
73  ITK_FLOAT,
75  };
76 };
77 // Define how to print enumeration
78 extern ITKIOImageBase_EXPORT std::ostream &
79  operator<<(std::ostream & out, const IOCommonEnums::AtomicPixel value);
80  * \brief Centralized functionality for IO classes.
81  *
82  * This class provides encapsulated functionality to support the IO classes.
83  *
84  * \ingroup IOFilters
85  *
86  * \ingroup ITKIOImageBase
87  */
88 class ITKIOImageBase_EXPORT IOCommon
89 {
90 public:
92  {
93 
95  MAX_FILENAMELIST_SIZE = 512
96  };
97 
99 #if !defined(ITK_LEGACY_REMOVE)
100 
101  static constexpr AtomicPixelEnum ITK_UCHAR = AtomicPixelEnum::ITK_UCHAR;
102  static constexpr AtomicPixelEnum ITK_CHAR = AtomicPixelEnum::ITK_CHAR;
103  static constexpr AtomicPixelEnum ITK_USHORT = AtomicPixelEnum::ITK_USHORT;
104  static constexpr AtomicPixelEnum ITK_SHORT = AtomicPixelEnum::ITK_SHORT;
105  static constexpr AtomicPixelEnum ITK_UINT = AtomicPixelEnum::ITK_UINT;
106  static constexpr AtomicPixelEnum ITK_INT = AtomicPixelEnum::ITK_INT;
107  static constexpr AtomicPixelEnum ITK_ULONG = AtomicPixelEnum::ITK_ULONG;
108  static constexpr AtomicPixelEnum ITK_LONG = AtomicPixelEnum::ITK_LONG;
109  static constexpr AtomicPixelEnum ITK_FLOAT = AtomicPixelEnum::ITK_FLOAT;
110  static constexpr AtomicPixelEnum ITK_DOUBLE = AtomicPixelEnum::ITK_DOUBLE;
111 #endif
112 
113 
115  static std::string
116  AtomicPixelTypeToString(const AtomicPixelEnum pixelType);
117 
119  static unsigned int
120  ComputeSizeOfAtomicPixelType(const AtomicPixelEnum pixelType);
121 };
122 
123 extern const ITKIOImageBase_EXPORT char * const ITK_OnDiskStorageTypeName;
124 extern const ITKIOImageBase_EXPORT char * const ITK_ImageFileBaseName;
125 extern const ITKIOImageBase_EXPORT char * const ITK_VoxelUnits;
126 extern const ITKIOImageBase_EXPORT char * const ITK_OnDiskBitPerPixel;
127 extern const ITKIOImageBase_EXPORT char * const SPM_ROI_SCALE;
128 extern const ITKIOImageBase_EXPORT char * const ITK_FileNotes;
129 extern const ITKIOImageBase_EXPORT char * const ITK_Origin;
130 extern const ITKIOImageBase_EXPORT char * const ITK_Spacing;
131 extern const ITKIOImageBase_EXPORT char * const ITK_ZDirection;
132 extern const ITKIOImageBase_EXPORT char * const ITK_FileOriginator;
133 extern const ITKIOImageBase_EXPORT char * const ITK_OriginationDate;
134 extern const ITKIOImageBase_EXPORT char * const ITK_PatientID;
135 extern const ITKIOImageBase_EXPORT char * const ITK_ExperimentDate;
136 extern const ITKIOImageBase_EXPORT char * const ITK_ExperimentTime;
137 extern const ITKIOImageBase_EXPORT char * const ITK_InputFilterName;
138 extern const ITKIOImageBase_EXPORT char * const ITK_NumberOfDimensions;
139 extern const ITKIOImageBase_EXPORT char * const ITK_ImageType;
140 extern const ITKIOImageBase_EXPORT char * const ITK_PatientName;
141 extern const ITKIOImageBase_EXPORT char * const ITK_ScanID;
142 extern const ITKIOImageBase_EXPORT char * const ROI_NAME;
143 extern const ITKIOImageBase_EXPORT char * const ROI_X_SIZE;
144 extern const ITKIOImageBase_EXPORT char * const ROI_X_RESOLUTION;
145 extern const ITKIOImageBase_EXPORT char * const ROI_Y_SIZE;
146 extern const ITKIOImageBase_EXPORT char * const ROI_Y_RESOLUTION;
147 extern const ITKIOImageBase_EXPORT char * const ROI_Z_SIZE;
148 extern const ITKIOImageBase_EXPORT char * const ROI_Z_RESOLUTION;
149 extern const ITKIOImageBase_EXPORT char * const ROI_NUM_SEGMENTS;
150 extern const ITKIOImageBase_EXPORT char * const ROI_PLANE;
151 extern const ITKIOImageBase_EXPORT char * const ROI_SCAN_ID;
152 } // end namespace itk
153 
154 #endif // itkIOCommon_h
ROI_Z_SIZE
const ITKIOImageBase_EXPORT char *const ROI_Z_SIZE
itk::VariableLengthVectorExpression::operator<<
std::ostream & operator<<(std::ostream &os, const VariableLengthVectorExpression< TExpr1, TExpr2, TBinaryOp > &v)
Definition: itkVariableLengthVector.h:1359
ROI_SCAN_ID
const ITKIOImageBase_EXPORT char *const ROI_SCAN_ID
ROI_NUM_SEGMENTS
const ITKIOImageBase_EXPORT char *const ROI_NUM_SEGMENTS
itk::IOCommonEnums::AtomicPixel::ITK_FLOAT
itk::IOCommonEnums::AtomicPixel::ITK_CHAR
ITK_FileNotes
const ITKIOImageBase_EXPORT char *const ITK_FileNotes
itk::AtomicPixel::ITK_USHORT
itk::AtomicPixel::ITK_FLOAT
ITK_VoxelUnits
const ITKIOImageBase_EXPORT char *const ITK_VoxelUnits
SPM_ROI_SCALE
const ITKIOImageBase_EXPORT char *const SPM_ROI_SCALE
ITK_FileOriginator
const ITKIOImageBase_EXPORT char *const ITK_FileOriginator
IOCommon
Definition: itkIOCommon.h:88
ITK_ExperimentDate
const ITKIOImageBase_EXPORT char *const ITK_ExperimentDate
ROI_Z_RESOLUTION
const ITKIOImageBase_EXPORT char *const ROI_Z_RESOLUTION
itk::AtomicPixel::ITK_CHAR
IOCommon::SysConstants
SysConstants
Definition: itkIOCommon.h:91
ITK_OnDiskBitPerPixel
const ITKIOImageBase_EXPORT char *const ITK_OnDiskBitPerPixel
itk::operator<<
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
ITK_Origin
const ITKIOImageBase_EXPORT char *const ITK_Origin
ROI_PLANE
const ITKIOImageBase_EXPORT char *const ROI_PLANE
ITK_ZDirection
const ITKIOImageBase_EXPORT char *const ITK_ZDirection
ITK_NumberOfDimensions
const ITKIOImageBase_EXPORT char *const ITK_NumberOfDimensions
itk::IOCommonEnums::AtomicPixel::ITK_USHORT
ITK_ScanID
const ITKIOImageBase_EXPORT char *const ITK_ScanID
itk::AtomicPixel::ITK_INT
itk::IOCommonEnums
Contains all enum classes used by IOCommon class.
Definition: itkIOCommon.h:33
itk::AtomicPixel::ITK_UINT
ITK_OriginationDate
const ITKIOImageBase_EXPORT char *const ITK_OriginationDate
itkProcessObject.h
itk::AtomicPixel::ITK_DOUBLE
ITK_ImageType
const ITKIOImageBase_EXPORT char *const ITK_ImageType
itk::IOCommonEnums::AtomicPixel::ITK_LONG
ITK_InputFilterName
const ITKIOImageBase_EXPORT char *const ITK_InputFilterName
itk::IOCommonEnums::AtomicPixel::ITK_UINT
ITK_ImageFileBaseName
const ITKIOImageBase_EXPORT char *const ITK_ImageFileBaseName
itk::AtomicPixel::ITK_UCHAR
ROI_X_SIZE
const ITKIOImageBase_EXPORT char *const ROI_X_SIZE
ITK_PatientName
const ITKIOImageBase_EXPORT char *const ITK_PatientName
itkSpatialOrientation.h
itk::IOCommonEnums::AtomicPixel::ITK_SHORT
itk::AtomicPixel
AtomicPixel
Definition: itkIOCommon.h:63
IOCommon::AtomicPixelEnum
IOCommonEnums::AtomicPixel AtomicPixelEnum
Definition: itkIOCommon.h:98
itkIntTypes.h
itk::IOCommonEnums::AtomicPixel::ITK_INT
itk::IOCommonEnums::AtomicPixel
AtomicPixel
Definition: itkIOCommon.h:40
ROI_NAME
const ITKIOImageBase_EXPORT char *const ROI_NAME
itk::IOCommonEnums::AtomicPixel::ITK_ULONG
itk::AtomicPixel::ITK_ULONG
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
ITK_OnDiskStorageTypeName
const ITKIOImageBase_EXPORT char *const ITK_OnDiskStorageTypeName
ITK_ExperimentTime
const ITKIOImageBase_EXPORT char *const ITK_ExperimentTime
ROI_X_RESOLUTION
const ITKIOImageBase_EXPORT char *const ROI_X_RESOLUTION
ROI_Y_RESOLUTION
const ITKIOImageBase_EXPORT char *const ROI_Y_RESOLUTION
ITK_PatientID
const ITKIOImageBase_EXPORT char *const ITK_PatientID
ROI_Y_SIZE
const ITKIOImageBase_EXPORT char *const ROI_Y_SIZE
itk::IOCommonEnums::AtomicPixel::ITK_DOUBLE
ITK_Spacing
const ITKIOImageBase_EXPORT char *const ITK_Spacing
itk::AtomicPixel::ITK_SHORT
itk::AtomicPixel::ITK_LONG
itk::IOCommonEnums::AtomicPixel::ITK_UCHAR