GDCM 3.0.24
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
40{
41public:
42 typedef enum {
43 Unknown = 0,
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
91
92 // Return the string as written in the official DICOM dict from
93 // a custom enum type
94 static const char* GetTSString(TSType ts);
95 static TSType GetTSType(const char *str);
96
98
103
104 bool IsValid() const { return TSField != TS_END; }
105
106 operator TSType () const { return TSField; }
107
108 // FIXME: ImplicitVRLittleEndian used to be the default, but nowadays
109 // this is rather the ExplicitVRLittleEndian instead...should be change the default ?
110 TransferSyntax(TSType type = ImplicitVRLittleEndian):TSField(type) {}
111
112 // return if dataset is encoded or not (Deflate Explicit VR)
113 bool IsEncoded() const;
114
115 bool IsImplicit() const;
116 bool IsExplicit() const;
117
118 bool IsEncapsulated() const;
119
121 bool IsLossy() const;
123 bool IsLossless() const;
125 bool CanStoreLossy() const;
126
127 const char *GetString() const { return TransferSyntax::GetTSString(TSField); }
128
129 friend std::ostream &operator<<(std::ostream &os, const TransferSyntax &ts);
130private:
131 // DO NOT EXPOSE the following. Internal details of TransferSyntax
132bool IsImplicit(TSType ts) const;
133bool IsExplicit(TSType ts) const;
134bool IsLittleEndian(TSType ts) const;
135bool IsBigEndian(TSType ts) const;
136
137 TSType TSField;
138};
139//-----------------------------------------------------------------------------
140inline std::ostream &operator<<(std::ostream &_os, const TransferSyntax &ts)
141{
143 return _os;
144
145}
146
147} // end namespace gdcm
148
149#endif //GDCMTRANSFERSYNTAX_H
SwapCode representation.
Definition gdcmSwapCode.h:27
Class to manipulate Transfer Syntax.
Definition gdcmTransferSyntax.h:40
bool CanStoreLossy() const
static TSType GetTSType(const char *str)
bool IsImplicit() const
bool IsValid() const
Definition gdcmTransferSyntax.h:104
bool IsEncoded() const
bool IsEncapsulated() const
NegociatedType GetNegociatedType() const
SwapCode GetSwapCode() const
static const char * GetTSString(TSType ts)
TSType
Definition gdcmTransferSyntax.h:61
@ ImplicitVRBigEndianACRNEMA
Definition gdcmTransferSyntax.h:82
@ MPEG4AVCH264HighProfileLevel4_1
Definition gdcmTransferSyntax.h:87
@ CT_private_ELE
Definition gdcmTransferSyntax.h:84
@ JPEG2000
Definition gdcmTransferSyntax.h:77
@ JPEGLSNearLossless
Definition gdcmTransferSyntax.h:75
@ JPEGFullProgressionProcess10_12
Definition gdcmTransferSyntax.h:71
@ MPEG2MainProfile
Definition gdcmTransferSyntax.h:81
@ JPEG2000Part2
Definition gdcmTransferSyntax.h:79
@ JPEG2000Lossless
Definition gdcmTransferSyntax.h:76
@ JPIPReferenced
Definition gdcmTransferSyntax.h:85
@ WeirdPapryus
Definition gdcmTransferSyntax.h:83
@ ExplicitVRBigEndian
Definition gdcmTransferSyntax.h:66
@ JPEGExtendedProcess3_5
Definition gdcmTransferSyntax.h:69
@ RLELossless
Definition gdcmTransferSyntax.h:80
@ MPEG2MainProfileHighLevel
Definition gdcmTransferSyntax.h:86
@ JPEGLosslessProcess14_1
Definition gdcmTransferSyntax.h:73
@ JPEGSpectralSelectionProcess6_8
Definition gdcmTransferSyntax.h:70
@ ExplicitVRLittleEndian
Definition gdcmTransferSyntax.h:64
@ DeflatedExplicitVRLittleEndian
Definition gdcmTransferSyntax.h:65
@ JPEG2000Part2Lossless
Definition gdcmTransferSyntax.h:78
@ MPEG4AVCH264BDcompatibleHighProfileLevel4_1
Definition gdcmTransferSyntax.h:88
@ ImplicitVRBigEndianPrivateGE
Definition gdcmTransferSyntax.h:63
@ JPEGBaselineProcess1
Definition gdcmTransferSyntax.h:67
@ JPEGExtendedProcess2_4
Definition gdcmTransferSyntax.h:68
@ JPEGLSLossless
Definition gdcmTransferSyntax.h:74
@ JPEGLosslessProcess14
Definition gdcmTransferSyntax.h:72
bool IsExplicit() const
bool IsLossy() const
const char * GetString() const
Definition gdcmTransferSyntax.h:127
NegociatedType
Definition gdcmTransferSyntax.h:42
@ Explicit
Definition gdcmTransferSyntax.h:44
bool IsLossless() const
TransferSyntax(TSType type=ImplicitVRLittleEndian)
Definition gdcmTransferSyntax.h:110
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88