GDCM  2.2.6
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 
19 namespace gdcm
20 {
21 
40 {
41 public:
42  typedef enum {
43  Unknown = 0,
45  Implicit
46  } NegociatedType;
47 
48 #if 0
49  //NOT FLEXIBLE, since force user to update lib everytime 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,
83 #ifdef GDCM_SUPPORT_BROKEN_IMPLEMENTATION
84  WeirdPapryus,
85 #endif
88  TS_END
89  } TSType;
90 
91  // Return the string as written in the official DICOM dict from
92  // a custom enum type
93  static const char* GetTSString(TSType ts);
94  static TSType GetTSType(const char *str);
95 
96  NegociatedType GetNegociatedType() const;
97 
101  SwapCode GetSwapCode() const;
102 
103  bool IsValid() const { return TSField != TS_END; }
104 
105  operator TSType () const { return TSField; }
106 
107  // FIXME: ImplicitVRLittleEndian used to be the default, but nowadays
108  // this is rather the ExplicitVRLittleEndian instead...should be change the default ?
109  TransferSyntax(TSType type = ImplicitVRLittleEndian):TSField(type) {}
110 
111  // return if dataset is encoded or not (Deflate Explicit VR)
112  bool IsEncoded() const;
113 
114  bool IsImplicit() const;
115  bool IsExplicit() const;
116 
117  bool IsEncapsulated() const;
118 
120  bool IsLossy() const;
122  bool IsLossless() const;
124  bool CanStoreLossy() const;
125 
126  const char *GetString() const { return TransferSyntax::GetTSString(TSField); }
127 
128  friend std::ostream &operator<<(std::ostream &os, const TransferSyntax &ts);
129 private:
130  // DO NOT EXPOSE the following. Internal details of TransferSyntax
131 bool IsImplicit(TSType ts) const;
132 bool IsExplicit(TSType ts) const;
133 bool IsLittleEndian(TSType ts) const;
134 bool IsBigEndian(TSType ts) const;
135 
136  TSType TSField;
137 };
138 //-----------------------------------------------------------------------------
139 inline std::ostream &operator<<(std::ostream &_os, const TransferSyntax &ts)
140 {
141  _os << TransferSyntax::GetTSString(ts);
142  return _os;
143 
144 }
145 
146 } // end namespace gdcm
147 
148 #endif //GDCMTRANSFERSYNTAX_H
Definition: gdcmTransferSyntax.h:72
Definition: gdcmTransferSyntax.h:87
Definition: gdcmTransferSyntax.h:78
Definition: gdcmTransferSyntax.h:75
bool IsValid() const
Definition: gdcmTransferSyntax.h:103
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
TSType
Definition: gdcmTransferSyntax.h:61
Definition: gdcmTransferSyntax.h:69
Definition: gdcmTransferSyntax.h:63
const char * GetString() const
Definition: gdcmTransferSyntax.h:126
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:92
Definition: gdcmTransferSyntax.h:80
Definition: gdcmTransferSyntax.h:44
Definition: gdcmTransferSyntax.h:86
Definition: gdcmTransferSyntax.h:73
Definition: gdcmTransferSyntax.h:82
Definition: gdcmTransferSyntax.h:81
Class to manipulate Transfer Syntax.
Definition: gdcmTransferSyntax.h:39
Definition: gdcmTransferSyntax.h:74
Definition: gdcmTransferSyntax.h:67
TransferSyntax(TSType type=ImplicitVRLittleEndian)
Definition: gdcmTransferSyntax.h:109
Definition: gdcmTransferSyntax.h:76
SwapCode representation.
Definition: gdcmSwapCode.h:27
Definition: gdcmTransferSyntax.h:77
static const char * GetTSString(TSType ts)
Definition: gdcmTransferSyntax.h:79
Definition: gdcmTransferSyntax.h:66
Definition: gdcmTransferSyntax.h:64
Definition: gdcmTransferSyntax.h:65
Definition: gdcmTransferSyntax.h:68

Generated on Sat Dec 21 2013 05:56:18 for GDCM by doxygen 1.8.5
SourceForge.net Logo