GDCM 3.2.1

gdcmFile.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 GDCMFILE_H
15#define GDCMFILE_H
16
17#include "gdcmObject.h"
18#include "gdcmDataSet.h"
19#include "gdcmFileMetaInformation.h"
20
21 namespace gdcm_ns
22{
23
33 class GDCM_EXPORT File : public Object
34{
35 public:
36 File();
37 ~File() override;
38
39 friend std::ostream &operator<<(std::ostream &os, const File &val);
40
42 std::istream &Read(std::istream &is);
43
45 std::ostream const &Write(std::ostream &os) const;
46
48 const FileMetaInformation &GetHeader() const { return Header; }
49
51 FileMetaInformation &GetHeader() { return Header; }
52
54 void SetHeader( const FileMetaInformation &fmi ) { Header = fmi; }
55
57 const DataSet &GetDataSet() const { return DS; }
58
60 DataSet &GetDataSet() { return DS; }
61
63 void SetDataSet( const DataSet &ds) { DS = ds; }
64
65 private:
66 FileMetaInformation Header;
67 DataSet DS;
68};
69//-----------------------------------------------------------------------------
70 inline std::ostream& operator<<(std::ostream &os, const File &val)
71{
72 os << val.GetHeader() << std::endl;
73 //os << val.GetDataSet() << std::endl; // FIXME
74 gdcm_assert(0);
75 return os;
76}
77
78} // end namespace gdcm_ns
79
80#endif //GDCMFILE_H
gdcm::DataSet
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
gdcm::FileMetaInformation
Class to represent a File Meta Information.
Definition gdcmFileMetaInformation.h:41
gdcm::File::~File
~File() override
gdcm::File::SetHeader
void SetHeader(const FileMetaInformation &fmi)
Set File Meta Information.
Definition gdcmFile.h:54
gdcm::File::Write
std::ostream const & Write(std::ostream &os) const
Write.
gdcm::File::SetDataSet
void SetDataSet(const DataSet &ds)
Set Data Set.
Definition gdcmFile.h:63
gdcm::File::GetDataSet
const DataSet & GetDataSet() const
Get Data Set.
Definition gdcmFile.h:57
gdcm::File::GetHeader
FileMetaInformation & GetHeader()
Get File Meta Information.
Definition gdcmFile.h:51
gdcm::File::Read
std::istream & Read(std::istream &is)
Read.
gdcm::File::GetHeader
const FileMetaInformation & GetHeader() const
Get File Meta Information.
Definition gdcmFile.h:48
gdcm::File::GetDataSet
DataSet & GetDataSet()
Get Data Set.
Definition gdcmFile.h:60
gdcm::File::operator<<
friend std::ostream & operator<<(std::ostream &os, const File &val)
Definition gdcmFile.h:70
gdcm::File::File
File()
gdcm::Object::Object
Object()
Definition gdcmObject.h:42
gdcmDataSet.h
gdcm_assert
#define gdcm_assert(cond)
Definition gdcmException.h:104
gdcmFileMetaInformation.h
gdcmObject.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34