GDCM 3.0.24
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
21namespace gdcm
22{
23class DataSet;
24namespace network
25{
26
33{
34public:
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
82private:
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)
Definition gdcmDataSet.h:56
PresentationDataValue.
Definition gdcmPresentationDataValue.h:33
const std::string & GetBlob() const
void Print(std::ostream &os) const
std::istream & ReadInto(std::istream &is, std::ostream &os)
uint8_t GetPresentationContextID() const
Definition gdcmPresentationDataValue.h:50
uint8_t GetMessageHeader() const
Definition gdcmPresentationDataValue.h:55
void SetBlob(const std::string &partialblob)
static DataSet ConcatenatePDVBlobs(const std::vector< PresentationDataValue > &inPDVs)
const std::ostream & Write(std::ostream &os) const
void SetMessageHeader(uint8_t messageheader)
Definition gdcmPresentationDataValue.h:61
void SetPresentationContextID(uint8_t id)
Definition gdcmPresentationDataValue.h:51
static DataSet ConcatenatePDVBlobsAsExplicit(const std::vector< PresentationDataValue > &inPDVs)
std::istream & Read(std::istream &is)
void SetDataSet(const DataSet &ds)
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21