ITK  5.2.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  * http://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);
67 class ITKIOImageBase_EXPORT IOCommon
68 {
69 public:
70  using SysConstants = enum
71 
72  {
73 
76  MAX_FILENAMELIST_SIZE = 512
77 
78  };
79 
81 #if !defined(ITK_LEGACY_REMOVE)
82 
83  static constexpr AtomicPixelEnum ITK_UCHAR = AtomicPixelEnum::ITK_UCHAR;
84  static constexpr AtomicPixelEnum ITK_CHAR = AtomicPixelEnum::ITK_CHAR;
85  static constexpr AtomicPixelEnum ITK_USHORT = AtomicPixelEnum::ITK_USHORT;
86  static constexpr AtomicPixelEnum ITK_SHORT = AtomicPixelEnum::ITK_SHORT;
87  static constexpr AtomicPixelEnum ITK_UINT = AtomicPixelEnum::ITK_UINT;
88  static constexpr AtomicPixelEnum ITK_INT = AtomicPixelEnum::ITK_INT;
89  static constexpr AtomicPixelEnum ITK_ULONG = AtomicPixelEnum::ITK_ULONG;
90  static constexpr AtomicPixelEnum ITK_LONG = AtomicPixelEnum::ITK_LONG;
91  static constexpr AtomicPixelEnum ITK_FLOAT = AtomicPixelEnum::ITK_FLOAT;
92  static constexpr AtomicPixelEnum ITK_DOUBLE = AtomicPixelEnum::ITK_DOUBLE;
93 #endif
94 
95 
97  static std::string
98  AtomicPixelTypeToString(const AtomicPixelEnum pixelType);
99 
101  static unsigned int
102  ComputeSizeOfAtomicPixelType(const AtomicPixelEnum pixelType);
103 };
104 
105 extern ITKIOImageBase_EXPORT const char * const ITK_OnDiskStorageTypeName;
106 extern ITKIOImageBase_EXPORT const char * const ITK_ImageFileBaseName;
107 extern ITKIOImageBase_EXPORT const char * const ITK_VoxelUnits;
108 extern ITKIOImageBase_EXPORT const char * const ITK_OnDiskBitPerPixel;
109 extern ITKIOImageBase_EXPORT const char * const SPM_ROI_SCALE;
110 extern ITKIOImageBase_EXPORT const char * const ITK_FileNotes;
111 extern ITKIOImageBase_EXPORT const char * const ITK_Origin;
112 extern ITKIOImageBase_EXPORT const char * const ITK_Spacing;
113 extern ITKIOImageBase_EXPORT const char * const ITK_ZDirection;
114 extern ITKIOImageBase_EXPORT const char * const ITK_FileOriginator;
115 extern ITKIOImageBase_EXPORT const char * const ITK_OriginationDate;
116 extern ITKIOImageBase_EXPORT const char * const ITK_PatientID;
117 extern ITKIOImageBase_EXPORT const char * const ITK_ExperimentDate;
118 extern ITKIOImageBase_EXPORT const char * const ITK_ExperimentTime;
119 extern ITKIOImageBase_EXPORT const char * const ITK_InputFilterName;
120 extern ITKIOImageBase_EXPORT const char * const ITK_NumberOfDimensions;
121 extern ITKIOImageBase_EXPORT const char * const ITK_ImageType;
122 extern ITKIOImageBase_EXPORT const char * const ITK_PatientName;
123 extern ITKIOImageBase_EXPORT const char * const ITK_ScanID;
124 extern ITKIOImageBase_EXPORT const char * const ROI_NAME;
125 extern ITKIOImageBase_EXPORT const char * const ROI_X_SIZE;
126 extern ITKIOImageBase_EXPORT const char * const ROI_X_RESOLUTION;
127 extern ITKIOImageBase_EXPORT const char * const ROI_Y_SIZE;
128 extern ITKIOImageBase_EXPORT const char * const ROI_Y_RESOLUTION;
129 extern ITKIOImageBase_EXPORT const char * const ROI_Z_SIZE;
130 extern ITKIOImageBase_EXPORT const char * const ROI_Z_RESOLUTION;
131 extern ITKIOImageBase_EXPORT const char * const ROI_NUM_SEGMENTS;
132 extern ITKIOImageBase_EXPORT const char * const ROI_PLANE;
133 extern ITKIOImageBase_EXPORT const char * const ROI_SCAN_ID;
134 } // end namespace itk
135 
136 #endif // itkIOCommon_h
itk::ITK_ImageFileBaseName
const ITKIOImageBase_EXPORT char *const ITK_ImageFileBaseName
itk::IOCommonEnums::AtomicPixel::ITK_ULONG
itk::IOCommonEnums::AtomicPixel::ITK_DOUBLE
itk::ROI_Y_RESOLUTION
const ITKIOImageBase_EXPORT char *const ROI_Y_RESOLUTION
itk::uint8_t
::uint8_t uint8_t
Definition: itkIntTypes.h:29
itk::IOCommon
Centralized functionality for IO classes.
Definition: itkIOCommon.h:67
itk::ITK_OnDiskBitPerPixel
const ITKIOImageBase_EXPORT char *const ITK_OnDiskBitPerPixel
itk::IOCommonEnums::AtomicPixel::ITK_USHORT
itk::ITK_ZDirection
const ITKIOImageBase_EXPORT char *const ITK_ZDirection
itk::ITK_ExperimentTime
const ITKIOImageBase_EXPORT char *const ITK_ExperimentTime
itk::operator<<
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
Definition: itkArray.h:218
itk::ROI_X_RESOLUTION
const ITKIOImageBase_EXPORT char *const ROI_X_RESOLUTION
itk::SPM_ROI_SCALE
const ITKIOImageBase_EXPORT char *const SPM_ROI_SCALE
itk::ITK_Spacing
const ITKIOImageBase_EXPORT char *const ITK_Spacing
itk::ROI_NUM_SEGMENTS
const ITKIOImageBase_EXPORT char *const ROI_NUM_SEGMENTS
itk::ROI_PLANE
const ITKIOImageBase_EXPORT char *const ROI_PLANE
itk::ROI_SCAN_ID
const ITKIOImageBase_EXPORT char *const ROI_SCAN_ID
itk::ITK_Origin
const ITKIOImageBase_EXPORT char *const ITK_Origin
itk::ROI_Z_SIZE
const ITKIOImageBase_EXPORT char *const ROI_Z_SIZE
itk::ITK_ExperimentDate
const ITKIOImageBase_EXPORT char *const ITK_ExperimentDate
itk::IOCommonEnums::AtomicPixel::ITK_INT
itk::IOCommon::SysConstants
enum { MAX_FILENAMELIST_SIZE=512 } SysConstants
Definition: itkIOCommon.h:78
itk::ITK_VoxelUnits
const ITKIOImageBase_EXPORT char *const ITK_VoxelUnits
itk::ITK_InputFilterName
const ITKIOImageBase_EXPORT char *const ITK_InputFilterName
itk::IOCommonEnums::AtomicPixel::ITK_FLOAT
itk::IOCommonEnums::AtomicPixel::ITK_SHORT
itk::IOCommonEnums
Contains all enum classes used by IOCommon class.
Definition: itkIOCommon.h:33
AtomicPixel
itkProcessObject.h
itk::IOCommonEnums::AtomicPixel
AtomicPixel
Definition: itkIOCommon.h:41
itk::ITK_OriginationDate
const ITKIOImageBase_EXPORT char *const ITK_OriginationDate
itkSpatialOrientation.h
itk::ITK_ImageType
const ITKIOImageBase_EXPORT char *const ITK_ImageType
itk::ITK_FileNotes
const ITKIOImageBase_EXPORT char *const ITK_FileNotes
itkIntTypes.h
itk::IOCommonEnums::AtomicPixel::ITK_UCHAR
itk::IOCommonEnums::AtomicPixel::ITK_LONG
itk::ROI_NAME
const ITKIOImageBase_EXPORT char *const ROI_NAME
itk::IOCommonEnums::AtomicPixel::ITK_UINT
itk::ITK_ScanID
const ITKIOImageBase_EXPORT char *const ITK_ScanID
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::ITK_OnDiskStorageTypeName
const ITKIOImageBase_EXPORT char *const ITK_OnDiskStorageTypeName
itk::ROI_Z_RESOLUTION
const ITKIOImageBase_EXPORT char *const ROI_Z_RESOLUTION
itk::ITK_FileOriginator
const ITKIOImageBase_EXPORT char *const ITK_FileOriginator
itk::ITK_PatientID
const ITKIOImageBase_EXPORT char *const ITK_PatientID
itk::IOCommonEnums::AtomicPixel::ITK_CHAR
itk::ITK_NumberOfDimensions
const ITKIOImageBase_EXPORT char *const ITK_NumberOfDimensions
itk::ROI_X_SIZE
const ITKIOImageBase_EXPORT char *const ROI_X_SIZE
itk::ITK_PatientName
const ITKIOImageBase_EXPORT char *const ITK_PatientName
itk::ROI_Y_SIZE
const ITKIOImageBase_EXPORT char *const ROI_Y_SIZE