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);
123class ITKIOGDCM_EXPORT GDCMImageIO : public ImageIOBase
124{
125public:
126 ITK_DISALLOW_COPY_AND_MOVE(GDCMImageIO);
127
132
134 itkNewMacro(Self);
135
137 itkOverrideGetNameOfClassMacro(GDCMImageIO);
138
139 /*-------- This part of the interface deals with reading data. ------ */
140
143 bool
144 CanReadFile(const char *) override;
145
147 void
149
151 void
152 Read(void * pointer) override;
153
158 itkGetEnumMacro(InternalComponentType, itk::CommonEnums::IOComponent);
159 itkSetEnumMacro(InternalComponentType, itk::CommonEnums::IOComponent);
161 /*-------- This part of the interfaces deals with writing data. ----- */
162
165 bool
166 CanWriteFile(const char *) override;
167
170 void
172
175 void
176 Write(const void * buffer) override;
177
180 itkGetConstMacro(RescaleSlope, double);
181 itkGetConstMacro(RescaleIntercept, double);
187 itkGetStringMacro(UIDPrefix);
188 itkSetStringMacro(UIDPrefix);
192 itkGetStringMacro(StudyInstanceUID);
193 itkGetStringMacro(SeriesInstanceUID);
194 itkGetStringMacro(FrameOfReferenceInstanceUID);
198 itkSetMacro(KeepOriginalUID, bool);
199 itkGetConstMacro(KeepOriginalUID, bool);
200 itkBooleanMacro(KeepOriginalUID);
205 itkSetMacro(LoadPrivateTags, bool);
206 itkGetConstMacro(LoadPrivateTags, bool);
207 itkBooleanMacro(LoadPrivateTags);
212 itkSetMacro(ReadYBRtoRGB, bool);
213 itkGetConstMacro(ReadYBRtoRGB, bool);
214 itkBooleanMacro(ReadYBRtoRGB);
218 bool
219 GetValueFromTag(const std::string & tag, std::string & value);
220
227 static bool
228 GetLabelFromTag(const std::string & tag, std::string & labelId);
229
230
232#if !defined(ITK_LEGACY_REMOVE)
233 // We need to expose the enum values at the class level
234 // for backwards compatibility
235 static constexpr CompressionEnum JPEG = CompressionEnum::JPEG;
236 static constexpr CompressionEnum JPEG2000 = CompressionEnum::JPEG2000;
237 static constexpr CompressionEnum JPEGLS = CompressionEnum::JPEGLS;
238 static constexpr CompressionEnum RLE = CompressionEnum::RLE;
239#endif
240
251 itkSetEnumMacro(CompressionType, CompressionEnum);
260 itkGetEnumMacro(CompressionType, CompressionEnum);
261
262 void
263 InternalSetCompressor(const std::string & _compressor) override;
264
265protected:
267 ~GDCMImageIO() override;
268 void
269 PrintSelf(std::ostream & os, Indent indent) const override;
270
271 void
273
275
277
278 std::string m_UIDPrefix{};
279
280 std::string m_StudyInstanceUID{};
281
282 std::string m_SeriesInstanceUID{};
283
285
287
289
291
292private:
294
296
298
300};
301
302} // end namespace itk
303
304#endif // itkGDCMImageIO_h
CompressionEnum m_CompressionType
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:53
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, AnatomicalOrientation::CoordinateEnum value)