GDCM  2.4.5
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
91  TS_END
92  } TSType;
93 
94  // Return the string as written in the official DICOM dict from
95  // a custom enum type
96  static const char* GetTSString(TSType ts);
97  static TSType GetTSType(const char *str);
98 
99  NegociatedType GetNegociatedType() const;
100 
104  SwapCode GetSwapCode() const;
105 
106  bool IsValid() const { return TSField != TS_END; }
107 
108  operator TSType () const { return TSField; }
109 
110  // FIXME: ImplicitVRLittleEndian used to be the default, but nowadays
111  // this is rather the ExplicitVRLittleEndian instead...should be change the default ?
112  TransferSyntax(TSType type = ImplicitVRLittleEndian):TSField(type) {}
113 
114  // return if dataset is encoded or not (Deflate Explicit VR)
115  bool IsEncoded() const;
116 
117  bool IsImplicit() const;
118  bool IsExplicit() const;
119 
120  bool IsEncapsulated() const;
121 
123  bool IsLossy() const;
125  bool IsLossless() const;
127  bool CanStoreLossy() const;
128 
129  const char *GetString() const { return TransferSyntax::GetTSString(TSField); }
130 
131  friend std::ostream &operator<<(std::ostream &os, const TransferSyntax &ts);
132 private:
133  // DO NOT EXPOSE the following. Internal details of TransferSyntax
134 bool IsImplicit(TSType ts) const;
135 bool IsExplicit(TSType ts) const;
136 bool IsLittleEndian(TSType ts) const;
137 bool IsBigEndian(TSType ts) const;
138 
139  TSType TSField;
140 };
141 //-----------------------------------------------------------------------------
142 inline std::ostream &operator<<(std::ostream &_os, const TransferSyntax &ts)
143 {
144  _os << TransferSyntax::GetTSString(ts);
145  return _os;
146 
147 }
148 
149 } // end namespace gdcm
150 
151 #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:106
#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:129
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:88
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:88
Definition: gdcmTransferSyntax.h:67
TransferSyntax(TSType type=ImplicitVRLittleEndian)
Definition: gdcmTransferSyntax.h:112
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: gdcmASN1.h:20
Definition: gdcmTransferSyntax.h:66
Definition: gdcmTransferSyntax.h:64
Definition: gdcmTransferSyntax.h:65
Definition: gdcmTransferSyntax.h:68

Generated on Fri Sep 25 2015 17:58:24 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo