ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkGDCMImageIO.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 *
20 * Portions of this file are subject to the VTK Toolkit Version 3 copyright.
21 *
22 * Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
23 *
24 * For complete copyright, license and disclaimer of warranty information
25 * please refer to the NOTICE file at the top of the ITK source tree.
26 *
27 *=========================================================================*/
28#ifndef itkGDCMImageIO_h
29#define itkGDCMImageIO_h
30
31#include "itkCommonEnums.h"
32#include "itkImageIOBase.h"
33#include "ITKIOGDCMExport.h"
34#include <fstream>
35#include <string>
36
37
38namespace itk
39{
44{
45public:
50 enum class Compression : uint8_t
51 {
52 JPEG = 0,
57 };
58};
59
60// Define how to print enumeration
61extern ITKIOGDCM_EXPORT std::ostream &
62 operator<<(std::ostream & out, const GDCMImageIOEnums::Compression value);
103class InternalHeader;
104class ITKIOGDCM_EXPORT GDCMImageIO : public ImageIOBase
105{
106public:
107 ITK_DISALLOW_COPY_AND_MOVE(GDCMImageIO);
109
114
116 itkNewMacro(Self);
117
119 itkOverrideGetNameOfClassMacro(GDCMImageIO);
120
121 /*-------- This part of the interface deals with reading data. ------ */
122
125 bool
126 CanReadFile(const char *) override;
127
129 void
131
133 void
134 Read(void * pointer) override;
135
139 itkGetEnumMacro(InternalComponentType, itk::CommonEnums::IOComponent);
140 itkSetEnumMacro(InternalComponentType, itk::CommonEnums::IOComponent);
142
143 /*-------- This part of the interfaces deals with writing data. ----- */
144
147 bool
148 CanWriteFile(const char *) override;
149
152 void
154
157 void
158 Write(const void * buffer) override;
159
161 itkGetConstMacro(RescaleSlope, double);
162 itkGetConstMacro(RescaleIntercept, double);
164
168 itkGetStringMacro(UIDPrefix);
169 itkSetStringMacro(UIDPrefix);
171
173 itkGetStringMacro(StudyInstanceUID);
174 itkGetStringMacro(SeriesInstanceUID);
175 itkGetStringMacro(FrameOfReferenceInstanceUID);
177
179 itkSetMacro(KeepOriginalUID, bool);
180 itkGetConstMacro(KeepOriginalUID, bool);
181 itkBooleanMacro(KeepOriginalUID);
183
186 itkSetMacro(LoadPrivateTags, bool);
187 itkGetConstMacro(LoadPrivateTags, bool);
188 itkBooleanMacro(LoadPrivateTags);
190
193 itkSetMacro(ReadYBRtoRGB, bool);
194 itkGetConstMacro(ReadYBRtoRGB, bool);
195 itkBooleanMacro(ReadYBRtoRGB);
197
200 bool
201 GetValueFromTag(const std::string & tag, std::string & value);
202
209 static bool
210 GetLabelFromTag(const std::string & tag, std::string & labelId);
211
212
214#if !defined(ITK_LEGACY_REMOVE)
215 // We need to expose the enum values at the class level
216 // for backwards compatibility
217 static constexpr CompressionEnum JPEG = CompressionEnum::JPEG;
218 static constexpr CompressionEnum JPEG2000 = CompressionEnum::JPEG2000;
219 static constexpr CompressionEnum JPEGLS = CompressionEnum::JPEGLS;
220 static constexpr CompressionEnum RLE = CompressionEnum::RLE;
221#endif
222
233 itkSetEnumMacro(CompressionType, CompressionEnum);
234 itkGetEnumMacro(CompressionType, CompressionEnum);
236
237 void
238 InternalSetCompressor(const std::string & _compressor) override;
239
240protected:
242 ~GDCMImageIO() override;
243 void
244 PrintSelf(std::ostream & os, Indent indent) const override;
245
246 void
248
250
252
253 std::string m_UIDPrefix{};
254
255 std::string m_StudyInstanceUID{};
256
257 std::string m_SeriesInstanceUID{};
258
260
262
264
266
267private:
269
271
273
275
276 InternalHeader * m_DICOMHeader{};
277};
278
279} // end namespace itk
280
281#endif // itkGDCMImageIO_h
CompressionEnum m_CompressionType
InternalHeader * m_DICOMHeader
std::string m_UIDPrefix
unsigned int m_GlobalNumberOfDimensions
GDCMImageIOEnums::Compression CompressionEnum
std::string m_SeriesInstanceUID
void WriteImageInformation() override
void InternalReadImageInformation()
void ReadImageInformation() override
~GDCMImageIO() override
std::string m_FrameOfReferenceInstanceUID
void PrintSelf(std::ostream &os, Indent indent) const override
bool CanWriteFile(const char *) override
bool CanReadFile(const char *) override
void InternalSetCompressor(const std::string &_compressor) override
IOComponentEnum m_InternalComponentType
SmartPointer< Self > Pointer
bool GetValueFromTag(const std::string &tag, std::string &value)
static bool GetLabelFromTag(const std::string &tag, std::string &labelId)
ImageIOBase Superclass
std::string m_StudyInstanceUID
void Write(const void *buffer) override
void Read(void *pointer) override
itk::IOComponentEnum IOComponentEnum
Control indentation during Print() invocation.
Definition itkIndent.h:50
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)