gdcmTransferSyntax.h
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
00038 class GDCM_EXPORT TransferSyntax
00039 {
00040 public:
00041 typedef enum {
00042 Unknown = 0,
00043 Explicit,
00044 Implicit
00045 } NegociatedType;
00046
00047 #if 0
00048
00049
00050
00051 typedef enum {
00052 NoSpacing = 0,
00053 PixelSpacing,
00054 ImagerPixelSpacing,
00055 PixelAspectRatio
00056 } ImageSpacingType;
00057 ImageSpacingType GetImageSpacing();
00058 #endif
00059
00060 typedef enum {
00061 ImplicitVRLittleEndian = 0,
00062 ImplicitVRBigEndianPrivateGE,
00063 ExplicitVRLittleEndian,
00064 DeflatedExplicitVRLittleEndian,
00065 ExplicitVRBigEndian,
00066 JPEGBaselineProcess1,
00067 JPEGExtendedProcess2_4,
00068 JPEGExtendedProcess3_5,
00069 JPEGSpectralSelectionProcess6_8,
00070 JPEGFullProgressionProcess10_12,
00071 JPEGLosslessProcess14,
00072 JPEGLosslessProcess14_1,
00073 JPEGLSLossless,
00074 JPEGLSNearLossless,
00075 JPEG2000Lossless,
00076 JPEG2000,
00077 RLELossless,
00078 MPEG2MainProfile,
00079 ImplicitVRBigEndianACRNEMA,
00080 #ifdef GDCM_SUPPORT_BROKEN_IMPLEMENTATION
00081 WeirdPapryus,
00082 #endif
00083 TS_END
00084 } TSType;
00085
00086
00087
00088 static const char* GetTSString(TSType ts);
00089 static TSType GetTSType(const char *str);
00090
00091 NegociatedType GetNegociatedType() const;
00092
00093
00094
00095
00096 SwapCode GetSwapCode() const;
00097
00098
00099
00100
00101 bool IsValid() const { return TSField != TS_END; }
00102
00103 operator TSType () const { return TSField; }
00104
00105
00106
00107 TransferSyntax(TSType type = ImplicitVRLittleEndian):TSField(type) {}
00108
00109
00110 bool IsEncoded() const;
00111
00112 bool IsImplicit() const;
00113 bool IsExplicit() const;
00114
00115 bool IsEncapsulated() const;
00116
00120 bool IsLossy() const;
00121 bool IsLossless() const;
00122
00123 const char *GetString() const { return TransferSyntax::GetTSString(TSField); }
00124
00125 friend std::ostream &operator<<(std::ostream &os, const TransferSyntax &ts);
00126 private:
00127
00128 bool IsImplicit(TSType ts) const;
00129 bool IsExplicit(TSType ts) const;
00130 bool IsLittleEndian(TSType ts) const;
00131 bool IsBigEndian(TSType ts) const;
00132
00133 TSType TSField;
00134 };
00135
00136 inline std::ostream &operator<<(std::ostream &_os, const TransferSyntax &ts)
00137 {
00138 _os << TransferSyntax::GetTSString(ts);
00139 return _os;
00140
00141 }
00142
00143 }
00144
00145 #endif //__gdcmTransferSyntax_h
00146