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:
41  enum class AtomicPixel : uint8_t
42  {
43  ITK_UCHAR, // aka uint8_t
44  ITK_CHAR,
45  ITK_USHORT, // aka uint16_t
46  ITK_SHORT,
47  ITK_UINT, // aka uint32_t
48  ITK_INT,
49  ITK_ULONG, // aka uint64_t
50  ITK_LONG,
51  ITK_FLOAT,
53  };
54 };
55 // Define how to print enumeration
56 extern ITKIOImageBase_EXPORT std::ostream &
57  operator<<(std::ostream & out, const IOCommonEnums::AtomicPixel value);
58 
65  enum class AtomicPixel : uint8_t
66  {
67  ITK_UCHAR, // aka uint8_t
68  ITK_CHAR,
69  ITK_USHORT, // aka uint16_t
70  ITK_SHORT,
71  ITK_UINT, // aka uint32_t
72  ITK_INT,
73  ITK_ULONG, // aka uint64_t
74  ITK_LONG,
75  ITK_FLOAT,
77  };
78 };
79 // Define how to print enumeration
80 extern ITKIOImageBase_EXPORT std::ostream &
81  operator<<(std::ostream & out, const IOCommonEnums::AtomicPixel value);
82  * \brief Centralized functionality for IO classes.
83  *
84  * This class provides encapsulated functionality to support the IO classes.
85  *
86  * \ingroup IOFilters
87  *
88  * \ingroup ITKIOImageBase
89  */
90 class ITKIOImageBase_EXPORT IOCommon
91 {
92 public:
94  {
95 
97  MAX_FILENAMELIST_SIZE = 512
98  };
99 
101 #if !defined(ITK_LEGACY_REMOVE)
102 
103  static constexpr AtomicPixelEnum ITK_UCHAR = AtomicPixelEnum::ITK_UCHAR;
104  static constexpr AtomicPixelEnum ITK_CHAR = AtomicPixelEnum::ITK_CHAR;
105  static constexpr AtomicPixelEnum ITK_USHORT = AtomicPixelEnum::ITK_USHORT;
106  static constexpr AtomicPixelEnum ITK_SHORT = AtomicPixelEnum::ITK_SHORT;
107  static constexpr AtomicPixelEnum ITK_UINT = AtomicPixelEnum::ITK_UINT;
108  static constexpr AtomicPixelEnum ITK_INT = AtomicPixelEnum::ITK_INT;
109  static constexpr AtomicPixelEnum ITK_ULONG = AtomicPixelEnum::ITK_ULONG;
110  static constexpr AtomicPixelEnum ITK_LONG = AtomicPixelEnum::ITK_LONG;
111  static constexpr AtomicPixelEnum ITK_FLOAT = AtomicPixelEnum::ITK_FLOAT;
112  static constexpr AtomicPixelEnum ITK_DOUBLE = AtomicPixelEnum::ITK_DOUBLE;
113 #endif
114 
115 
117  static std::string
118  AtomicPixelTypeToString(const AtomicPixelEnum pixelType);
119 
121  static unsigned int
122  ComputeSizeOfAtomicPixelType(const AtomicPixelEnum pixelType);
123 };
124 
125 extern const ITKIOImageBase_EXPORT char * const ITK_OnDiskStorageTypeName;
126 extern const ITKIOImageBase_EXPORT char * const ITK_ImageFileBaseName;
127 extern const ITKIOImageBase_EXPORT char * const ITK_VoxelUnits;
128 extern const ITKIOImageBase_EXPORT char * const ITK_OnDiskBitPerPixel;
129 extern const ITKIOImageBase_EXPORT char * const SPM_ROI_SCALE;
130 extern const ITKIOImageBase_EXPORT char * const ITK_FileNotes;
131 extern const ITKIOImageBase_EXPORT char * const ITK_Origin;
132 extern const ITKIOImageBase_EXPORT char * const ITK_Spacing;
133 extern const ITKIOImageBase_EXPORT char * const ITK_ZDirection;
134 extern const ITKIOImageBase_EXPORT char * const ITK_FileOriginator;
135 extern const ITKIOImageBase_EXPORT char * const ITK_OriginationDate;
136 extern const ITKIOImageBase_EXPORT char * const ITK_PatientID;
137 extern const ITKIOImageBase_EXPORT char * const ITK_ExperimentDate;
138 extern const ITKIOImageBase_EXPORT char * const ITK_ExperimentTime;
139 extern const ITKIOImageBase_EXPORT char * const ITK_InputFilterName;
140 extern const ITKIOImageBase_EXPORT char * const ITK_NumberOfDimensions;
141 extern const ITKIOImageBase_EXPORT char * const ITK_ImageType;
142 extern const ITKIOImageBase_EXPORT char * const ITK_PatientName;
143 extern const ITKIOImageBase_EXPORT char * const ITK_ScanID;
144 extern const ITKIOImageBase_EXPORT char * const ROI_NAME;
145 extern const ITKIOImageBase_EXPORT char * const ROI_X_SIZE;
146 extern const ITKIOImageBase_EXPORT char * const ROI_X_RESOLUTION;
147 extern const ITKIOImageBase_EXPORT char * const ROI_Y_SIZE;
148 extern const ITKIOImageBase_EXPORT char * const ROI_Y_RESOLUTION;
149 extern const ITKIOImageBase_EXPORT char * const ROI_Z_SIZE;
150 extern const ITKIOImageBase_EXPORT char * const ROI_Z_RESOLUTION;
151 extern const ITKIOImageBase_EXPORT char * const ROI_NUM_SEGMENTS;
152 extern const ITKIOImageBase_EXPORT char * const ROI_PLANE;
153 extern const ITKIOImageBase_EXPORT char * const ROI_SCAN_ID;
154 } // end namespace itk
155 
156 #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:90
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:93
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:65
IOCommon::AtomicPixelEnum
IOCommonEnums::AtomicPixel AtomicPixelEnum
Definition: itkIOCommon.h:100
itkIntTypes.h
itk::IOCommonEnums::AtomicPixel::ITK_INT
itk::IOCommonEnums::AtomicPixel
AtomicPixel
Definition: itkIOCommon.h:41
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