GDCM  2.4.5
gdcmPresentationDataValue.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 GDCMPRESENTATIONDATAVALUE_H
15 #define GDCMPRESENTATIONDATAVALUE_H
16 
17 #include "gdcmTypes.h"
18 
19 #include <vector>
20 
21 namespace gdcm
22 {
23 class DataSet;
24 namespace network
25 {
26 
33 {
34 public:
36  std::istream &Read(std::istream &is);
37  std::istream &ReadInto(std::istream &is, std::ostream &os);
38 
39  const std::ostream &Write(std::ostream &os) const;
40 
42  size_t Size() const;
43 
46  void SetDataSet(const DataSet & ds);
47  void SetBlob(const std::string & partialblob);
48  const std::string &GetBlob() const;
49 
50  uint8_t GetPresentationContextID() const { return PresentationContextID; }
51  void SetPresentationContextID(uint8_t id) {
52  assert( id );
53  PresentationContextID = id;
54  }
55  uint8_t GetMessageHeader() const {
56  assert( MessageHeader <= 0x3 );
57  return MessageHeader;
58  }
59  // E.2 MESSAGE CONTROL HEADER ENCODING
60  // Only the first two bits are considered
61  void SetMessageHeader(uint8_t messageheader) {
62  MessageHeader = messageheader;
63  assert( MessageHeader <= 0x3 );
64  }
65  //flip the least significant bit of the message header to 1
66  //if this is a command, else set it to 0.
67  void SetCommand(bool inCommand);
68  void SetLastFragment(bool inLast);//set to true if this is the last PDV of a set
69 
70  bool GetIsCommand() const;
71  bool GetIsLastFragment() const;
72 
73  void Print(std::ostream &os) const;
74 
75  //NOTE that the PDVs have to be given in the order in which they were received!
76  //also note that a dataset may be across multiple PDVs
78  static DataSet ConcatenatePDVBlobs(const std::vector<PresentationDataValue>& inPDVs);
79 
80  static DataSet ConcatenatePDVBlobsAsExplicit(const std::vector<PresentationDataValue>& inPDVs);
81 
82 private:
83  uint32_t ItemLength;
84  uint8_t PresentationContextID;
85  uint8_t MessageHeader;
86  std::string Blob;
87 };
88 } // end namespace network
89 
90 } // end namespace gdcm
91 
92 #endif //GDCMPRESENTATIONDATAVALUE_H
Class to represent a Data Set (which contains Data Elements) A Data Set represents an instance of a r...
Definition: gdcmDataSet.h:55
void SetPresentationContextID(uint8_t id)
Definition: gdcmPresentationDataValue.h:51
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
void SetMessageHeader(uint8_t messageheader)
Definition: gdcmPresentationDataValue.h:61
uint8_t GetPresentationContextID() const
Definition: gdcmPresentationDataValue.h:50
PresentationDataValue Table 9-23 PRESENTATION-DATA-VALUE ITEM FIELDS.
Definition: gdcmPresentationDataValue.h:32
Definition: gdcmASN1.h:20
uint8_t GetMessageHeader() const
Definition: gdcmPresentationDataValue.h:55

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