Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMTRANSFERSYNTAX_H
00016 #define GDCMTRANSFERSYNTAX_H
00017
00018 #include "gdcmSwapCode.h"
00019
00020 namespace gdcm
00021 {
00022
00040 class GDCM_EXPORT TransferSyntax
00041 {
00042 public:
00043 typedef enum {
00044 Unknown = 0,
00045 Explicit,
00046 Implicit
00047 } NegociatedType;
00048
00049 #if 0
00050
00051
00052
00053 typedef enum {
00054 NoSpacing = 0,
00055 PixelSpacing,
00056 ImagerPixelSpacing,
00057 PixelAspectRatio
00058 } ImageSpacingType;
00059 ImageSpacingType GetImageSpacing();
00060 #endif
00061
00062 typedef enum {
00063 ImplicitVRLittleEndian = 0,
00064 ImplicitVRBigEndianPrivateGE,
00065 ExplicitVRLittleEndian,
00066 DeflatedExplicitVRLittleEndian,
00067 ExplicitVRBigEndian,
00068 JPEGBaselineProcess1,
00069 JPEGExtendedProcess2_4,
00070 JPEGExtendedProcess3_5,
00071 JPEGSpectralSelectionProcess6_8,
00072 JPEGFullProgressionProcess10_12,
00073 JPEGLosslessProcess14,
00074 JPEGLosslessProcess14_1,
00075 JPEGLSLossless,
00076 JPEGLSNearLossless,
00077 JPEG2000Lossless,
00078 JPEG2000,
00079 RLELossless,
00080 MPEG2MainProfile,
00081 ImplicitVRBigEndianACRNEMA,
00082 #ifdef GDCM_SUPPORT_BROKEN_IMPLEMENTATION
00083 WeirdPapryus,
00084 #endif
00085 TS_END
00086 } TSType;
00087
00088
00089
00090 static const char* GetTSString(TSType ts);
00091 static TSType GetTSType(const char *str);
00092
00093 NegociatedType GetNegociatedType() const;
00094
00098 SwapCode GetSwapCode() const;
00099
00100 bool IsValid() const { return TSField != TS_END; }
00101
00102 operator TSType () const { return TSField; }
00103
00104
00105
00106 TransferSyntax(TSType type = ImplicitVRLittleEndian):TSField(type) {}
00107
00108
00109 bool IsEncoded() const;
00110
00111 bool IsImplicit() const;
00112 bool IsExplicit() const;
00113
00114 bool IsEncapsulated() const;
00115
00119 bool IsLossy() const;
00120 bool IsLossless() const;
00121
00122 const char *GetString() const { return TransferSyntax::GetTSString(TSField); }
00123
00124 friend std::ostream &operator<<(std::ostream &os, const TransferSyntax &ts);
00125 private:
00126
00127 bool IsImplicit(TSType ts) const;
00128 bool IsExplicit(TSType ts) const;
00129 bool IsLittleEndian(TSType ts) const;
00130 bool IsBigEndian(TSType ts) const;
00131
00132 TSType TSField;
00133 };
00134
00135 inline std::ostream &operator<<(std::ostream &_os, const TransferSyntax &ts)
00136 {
00137 _os << TransferSyntax::GetTSString(ts);
00138 return _os;
00139
00140 }
00141
00142 }
00143
00144 #endif //GDCMTRANSFERSYNTAX_H
00145