vega
file_meta.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <fstream>
4 #include <memory>
5 #include <map>
6 
7 #include "vega/vega.h"
8 #include "vega/dicom/reader.h"
10 #include "vega/dicom/sop_class.h"
11 #include "vega/dicom/data_set.h"
13 
14 namespace vega {
15  namespace dicom {
16  class Writer;
17 
27  class FileMeta {
28  private:
29  static const Tag FileMetaInformationGroupLength;
30  static const Tag TransferSyntaxUID;
31 
32  std::shared_ptr<DataSet> m_data_set;
33 
34  TransferSyntax m_transfer_syntax;
35  SOPClass m_sop_class;
36  UID m_media_storage_instance_uid;
37 
38  public:
40 
44  FileMeta();
50  FileMeta(const SOPClass& sop_class);
57  FileMeta(const SOPClass& sop_class, const UID& media_storage_instance_uid);
62  FileMeta(Reader& reader);
63 
65  const TransferSyntax& transfer_syntax() const;
67  void set_transfer_syntax(const TransferSyntax& other);
68 
74  bool transfer_syntax_vr_explicit() const;
75 
78  std::shared_ptr<const DataSet> data_set() const;
79 
81  const SOPClass& sop_class() const;
83  const UID& media_storage_instance_uid() const;
84 
86  bool present() const;
87 
92  size_t write(std::shared_ptr<Writer> writer);
93 
94  private:
95  void read(Reader& reader);
96  void fill_defaults(const SOPClass& sop_class, const UID& media_storage_instance_uid);
97  };
98  }
99 }
size_t write(std::shared_ptr< Writer > writer)
const SOPClass & sop_class() const
Endian
Definition: vega.h:24
Exception()
Definition: vega.h:13
std::shared_ptr< const DataSet > data_set() const
Definition: uid.h:6
A class which encapsulates the DICOM transfer syntaxes.
Definition: transfer_syntax.h:20
void set_transfer_syntax(const TransferSyntax &other)
The base class for exceptions that are raised by the vega library.
Definition: vega.h:11
A class which wraps the media storage SOP class.
Definition: sop_class.h:20
const TransferSyntax & transfer_syntax() const
Definition: file_meta.h:39
bool present() const
A class which encapsulates the file meta portion of a DICOM file.
Definition: file_meta.h:27
Definition: age.h:6
bool transfer_syntax_vr_explicit() const
Class for working with DICOM data element tags.
Definition: tag.h:15
const UID & media_storage_instance_uid() const
Endian transfer_syntax_endian() const