GDCM: gdcmTransferSyntax.h Source File

GDCM 3.2.11

gdcmTransferSyntax.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMTRANSFERSYNTAX_H
15#define GDCMTRANSFERSYNTAX_H
16
17#include "gdcmSwapCode.h"
18
19namespace gdcm
20{
21
39 class GDCM_EXPORT TransferSyntax
40{
41public:
42 typedef enum {
43 Unknown = 0,
44 Explicit,
45 Implicit
46 } NegociatedType;
47
48#if 0
49 //NOT FLEXIBLE, since forces user to update lib every time new module
50 //comes out...
51 // TODO
52 typedef enum {
53 NoSpacing = 0,
54 PixelSpacing,
55 ImagerPixelSpacing,
56 PixelAspectRatio
57 } ImageSpacingType;
58 ImageSpacingType GetImageSpacing();
59#endif
60
61 typedef enum {
62 ImplicitVRLittleEndian = 0,
63 ImplicitVRBigEndianPrivateGE,
64 ExplicitVRLittleEndian,
65 DeflatedExplicitVRLittleEndian,
66 ExplicitVRBigEndian,
67 JPEGBaselineProcess1,
68 JPEGExtendedProcess2_4,
69 JPEGExtendedProcess3_5,
70 JPEGSpectralSelectionProcess6_8,
71 JPEGFullProgressionProcess10_12,
72 JPEGLosslessProcess14,
73 JPEGLosslessProcess14_1,
74 JPEGLSLossless,
75 JPEGLSNearLossless,
76 JPEG2000Lossless,
77 JPEG2000,
78 JPEG2000Part2Lossless,
79 JPEG2000Part2,
80 RLELossless,
81 MPEG2MainProfile,
82 ImplicitVRBigEndianACRNEMA,
83 WeirdPapryus,
84 CT_private_ELE,
85 JPIPReferenced,
86 MPEG2MainProfileHighLevel,
87 MPEG4AVCH264HighProfileLevel4_1,
88 MPEG4AVCH264BDcompatibleHighProfileLevel4_1,
89 HTJ2KLossless,
90 HTJ2KRPCLLossless,
91 HTJ2K,
92 DeflatedImageFrameCompression,
93 TS_END
94 } TSType;
95
96 // Return the string as written in the official DICOM dict from
97 // a custom enum type
98 static const char* GetTSString(TSType ts);
99 static TSType GetTSType(const char *str);
100
101 NegociatedType GetNegociatedType() const;
102
106 SwapCode GetSwapCode() const;
107
108 bool IsValid() const { return TSField != TS_END; }
109
110 operator TSType () const { return TSField; }
111
112 // FIXME: ImplicitVRLittleEndian used to be the default, but nowadays
113 // this is rather the ExplicitVRLittleEndian instead...should be change the default ?
114 TransferSyntax(TSType type = ImplicitVRLittleEndian):TSField(type) {}
115
116 // return if dataset is encoded or not (Deflate Explicit VR)
117 bool IsEncoded() const;
118
119 bool IsImplicit() const;
120 bool IsExplicit() const;
121
122 bool IsEncapsulated() const;
123
125 bool IsLossy() const;
127 bool IsLossless() const;
129 bool CanStoreLossy() const;
130
131 const char *GetString() const { return TransferSyntax::GetTSString(TSField); }
132
133 friend std::ostream &operator<<(std::ostream &os, const TransferSyntax &ts);
134private:
135 // DO NOT EXPOSE the following. Internal details of TransferSyntax
136bool IsImplicit(TSType ts) const;
137bool IsExplicit(TSType ts) const;
138bool IsLittleEndian(TSType ts) const;
139bool IsBigEndian(TSType ts) const;
140
141 TSType TSField;
142};
143//-----------------------------------------------------------------------------
144 inline std::ostream &operator<<(std::ostream &_os, const TransferSyntax &ts)
145{
146 _os << TransferSyntax::GetTSString(ts);
147 return _os;
148
149}
150
151} // end namespace gdcm
152
153#endif //GDCMTRANSFERSYNTAX_H
gdcm::SwapCode
SwapCode representation.
Definition gdcmSwapCode.h:27
gdcm::TransferSyntax
Class to manipulate Transfer Syntax.
Definition gdcmTransferSyntax.h:40
gdcm::TransferSyntax::CanStoreLossy
bool CanStoreLossy() const
gdcm::TransferSyntax::GetTSType
static TSType GetTSType(const char *str)
gdcm::TransferSyntax::IsImplicit
bool IsImplicit() const
gdcm::TransferSyntax::IsValid
bool IsValid() const
Definition gdcmTransferSyntax.h:108
gdcm::TransferSyntax::IsEncoded
bool IsEncoded() const
gdcm::TransferSyntax::IsEncapsulated
bool IsEncapsulated() const
gdcm::TransferSyntax::GetNegociatedType
NegociatedType GetNegociatedType() const
gdcm::TransferSyntax::operator<<
friend std::ostream & operator<<(std::ostream &os, const TransferSyntax &ts)
Definition gdcmTransferSyntax.h:144
gdcm::TransferSyntax::GetSwapCode
SwapCode GetSwapCode() const
gdcm::TransferSyntax::GetTSString
static const char * GetTSString(TSType ts)
gdcm::TransferSyntax::TSType
TSType
Definition gdcmTransferSyntax.h:61
gdcm::TransferSyntax::ImplicitVRBigEndianACRNEMA
@ ImplicitVRBigEndianACRNEMA
Definition gdcmTransferSyntax.h:82
gdcm::TransferSyntax::MPEG4AVCH264HighProfileLevel4_1
@ MPEG4AVCH264HighProfileLevel4_1
Definition gdcmTransferSyntax.h:87
gdcm::TransferSyntax::HTJ2KRPCLLossless
@ HTJ2KRPCLLossless
Definition gdcmTransferSyntax.h:90
gdcm::TransferSyntax::CT_private_ELE
@ CT_private_ELE
Definition gdcmTransferSyntax.h:84
gdcm::TransferSyntax::JPEG2000
@ JPEG2000
Definition gdcmTransferSyntax.h:77
gdcm::TransferSyntax::JPEGLSNearLossless
@ JPEGLSNearLossless
Definition gdcmTransferSyntax.h:75
gdcm::TransferSyntax::JPEGFullProgressionProcess10_12
@ JPEGFullProgressionProcess10_12
Definition gdcmTransferSyntax.h:71
gdcm::TransferSyntax::MPEG2MainProfile
@ MPEG2MainProfile
Definition gdcmTransferSyntax.h:81
gdcm::TransferSyntax::JPEG2000Part2
@ JPEG2000Part2
Definition gdcmTransferSyntax.h:79
gdcm::TransferSyntax::JPEG2000Lossless
@ JPEG2000Lossless
Definition gdcmTransferSyntax.h:76
gdcm::TransferSyntax::JPIPReferenced
@ JPIPReferenced
Definition gdcmTransferSyntax.h:85
gdcm::TransferSyntax::WeirdPapryus
@ WeirdPapryus
Definition gdcmTransferSyntax.h:83
gdcm::TransferSyntax::ExplicitVRBigEndian
@ ExplicitVRBigEndian
Definition gdcmTransferSyntax.h:66
gdcm::TransferSyntax::TS_END
@ TS_END
Definition gdcmTransferSyntax.h:93
gdcm::TransferSyntax::JPEGExtendedProcess3_5
@ JPEGExtendedProcess3_5
Definition gdcmTransferSyntax.h:69
gdcm::TransferSyntax::RLELossless
@ RLELossless
Definition gdcmTransferSyntax.h:80
gdcm::TransferSyntax::MPEG2MainProfileHighLevel
@ MPEG2MainProfileHighLevel
Definition gdcmTransferSyntax.h:86
gdcm::TransferSyntax::JPEGLosslessProcess14_1
@ JPEGLosslessProcess14_1
Definition gdcmTransferSyntax.h:73
gdcm::TransferSyntax::JPEGSpectralSelectionProcess6_8
@ JPEGSpectralSelectionProcess6_8
Definition gdcmTransferSyntax.h:70
gdcm::TransferSyntax::HTJ2KLossless
@ HTJ2KLossless
Definition gdcmTransferSyntax.h:89
gdcm::TransferSyntax::ExplicitVRLittleEndian
@ ExplicitVRLittleEndian
Definition gdcmTransferSyntax.h:64
gdcm::TransferSyntax::DeflatedExplicitVRLittleEndian
@ DeflatedExplicitVRLittleEndian
Definition gdcmTransferSyntax.h:65
gdcm::TransferSyntax::JPEG2000Part2Lossless
@ JPEG2000Part2Lossless
Definition gdcmTransferSyntax.h:78
gdcm::TransferSyntax::DeflatedImageFrameCompression
@ DeflatedImageFrameCompression
Definition gdcmTransferSyntax.h:92
gdcm::TransferSyntax::MPEG4AVCH264BDcompatibleHighProfileLevel4_1
@ MPEG4AVCH264BDcompatibleHighProfileLevel4_1
Definition gdcmTransferSyntax.h:88
gdcm::TransferSyntax::ImplicitVRBigEndianPrivateGE
@ ImplicitVRBigEndianPrivateGE
Definition gdcmTransferSyntax.h:63
gdcm::TransferSyntax::HTJ2K
@ HTJ2K
Definition gdcmTransferSyntax.h:91
gdcm::TransferSyntax::JPEGBaselineProcess1
@ JPEGBaselineProcess1
Definition gdcmTransferSyntax.h:67
gdcm::TransferSyntax::JPEGExtendedProcess2_4
@ JPEGExtendedProcess2_4
Definition gdcmTransferSyntax.h:68
gdcm::TransferSyntax::JPEGLSLossless
@ JPEGLSLossless
Definition gdcmTransferSyntax.h:74
gdcm::TransferSyntax::ImplicitVRLittleEndian
@ ImplicitVRLittleEndian
Definition gdcmTransferSyntax.h:62
gdcm::TransferSyntax::JPEGLosslessProcess14
@ JPEGLosslessProcess14
Definition gdcmTransferSyntax.h:72
gdcm::TransferSyntax::IsExplicit
bool IsExplicit() const
gdcm::TransferSyntax::IsLossy
bool IsLossy() const
gdcm::TransferSyntax::GetString
const char * GetString() const
Definition gdcmTransferSyntax.h:131
gdcm::TransferSyntax::NegociatedType
NegociatedType
Definition gdcmTransferSyntax.h:42
gdcm::TransferSyntax::Unknown
@ Unknown
Definition gdcmTransferSyntax.h:43
gdcm::TransferSyntax::Explicit
@ Explicit
Definition gdcmTransferSyntax.h:44
gdcm::TransferSyntax::Implicit
@ Implicit
Definition gdcmTransferSyntax.h:45
gdcm::TransferSyntax::IsLossless
bool IsLossless() const
gdcm::TransferSyntax::TransferSyntax
TransferSyntax(TSType type=ImplicitVRLittleEndian)
Definition gdcmTransferSyntax.h:114
gdcmSwapCode.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88