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 InternalHeader;
124class ITKIOGDCM_EXPORT GDCMImageIO : public ImageIOBase
125{
126public:
127 ITK_DISALLOW_COPY_AND_MOVE(GDCMImageIO);
128
133
135 itkNewMacro(Self);
136
138 itkOverrideGetNameOfClassMacro(GDCMImageIO);
139
140 /*-------- This part of the interface deals with reading data. ------ */
141
144 bool
145 CanReadFile(const char *) override;
146
148 void
150
152 void
153 Read(void * pointer) override;
154
159 itkGetEnumMacro(InternalComponentType, itk::CommonEnums::IOComponent);
160 itkSetEnumMacro(InternalComponentType, itk::CommonEnums::IOComponent);
162 /*-------- This part of the interfaces deals with writing data. ----- */
163
166 bool
167 CanWriteFile(const char *) override;
168
171 void
173
176 void
177 Write(const void * buffer) override;
178
181 itkGetConstMacro(RescaleSlope, double);
182 itkGetConstMacro(RescaleIntercept, double);
188 itkGetStringMacro(UIDPrefix);
189 itkSetStringMacro(UIDPrefix);
193 itkGetStringMacro(StudyInstanceUID);
194 itkGetStringMacro(SeriesInstanceUID);
195 itkGetStringMacro(FrameOfReferenceInstanceUID);
199 itkSetMacro(KeepOriginalUID, bool);
200 itkGetConstMacro(KeepOriginalUID, bool);
201 itkBooleanMacro(KeepOriginalUID);
206 itkSetMacro(LoadPrivateTags, bool);
207 itkGetConstMacro(LoadPrivateTags, bool);
208 itkBooleanMacro(LoadPrivateTags);
213 itkSetMacro(ReadYBRtoRGB, bool);
214 itkGetConstMacro(ReadYBRtoRGB, bool);
215 itkBooleanMacro(ReadYBRtoRGB);
219 bool
220 GetValueFromTag(const std::string & tag, std::string & value);
221
228 static bool
229 GetLabelFromTag(const std::string & tag, std::string & labelId);
230
231
233#if !defined(ITK_LEGACY_REMOVE)
234 // We need to expose the enum values at the class level
235 // for backwards compatibility
236 static constexpr CompressionEnum JPEG = CompressionEnum::JPEG;
237 static constexpr CompressionEnum JPEG2000 = CompressionEnum::JPEG2000;
238 static constexpr CompressionEnum JPEGLS = CompressionEnum::JPEGLS;
239 static constexpr CompressionEnum RLE = CompressionEnum::RLE;
240#endif
241
252 itkSetEnumMacro(CompressionType, CompressionEnum);
261 itkGetEnumMacro(CompressionType, CompressionEnum);
262
263 void
264 InternalSetCompressor(const std::string & _compressor) override;
265
266protected:
268 ~GDCMImageIO() override;
269 void
270 PrintSelf(std::ostream & os, Indent indent) const override;
271
272 void
274
276
278
279 std::string m_UIDPrefix{};
280
281 std::string m_StudyInstanceUID{};
282
283 std::string m_SeriesInstanceUID{};
284
286
288
290
292
293private:
295
297
299
301
302 InternalHeader * m_DICOMHeader{};
303};
304
305} // end namespace itk
306
307#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)