GDCM 3.0.24
gdcmWriter.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
15#ifndef GDCMWRITER_H
16#define GDCMWRITER_H
17
18#include "gdcmFile.h"
19
20namespace gdcm
21{
22
23class FileMetaInformation;
49{
50public:
52 virtual ~Writer();
53
55 virtual bool Write(); // Execute()
56
58 void SetFileName(const char *filename_native);
59
61 void SetStream(std::ostream &output_stream) {
62 Stream = &output_stream;
63 }
64
66 void SetFile(const File& f) { F = f; }
67 File &GetFile() { return *F; }
68
70 void SetCheckFileMetaInformation(bool b) { CheckFileMetaInformation = b; }
71 void CheckFileMetaInformationOff() { CheckFileMetaInformation = false; }
72 void CheckFileMetaInformationOn() { CheckFileMetaInformation = true; }
73
74protected:
75 void SetWriteDataSetOnly(bool b) { WriteDataSetOnly = b; }
76
77protected:
78 friend class StreamImageWriter;
79 //this function is added for the StreamImageWriter, which needs to write
80 //up to the pixel data and then stops right before writing the pixel data.
81 //after that, for the raw codec at least, zeros are written for the length of the data
82 std::ostream* GetStreamPtr() const { return Stream; }
83
84protected:
85 std::ostream *Stream;
86 std::ofstream *Ofstream;
87 bool GetCheckFileMetaInformation() const { return CheckFileMetaInformation; }
88
89private:
91 bool CheckFileMetaInformation;
92 bool WriteDataSetOnly;
93};
94
95} // end namespace gdcm
96
97#endif //GDCMWRITER_H
a DICOM File
Definition gdcmFile.h:34
Class for Smart Pointer.
Definition gdcmSmartPointer.h:40
StreamImageReader.
Definition gdcmStreamImageWriter.h:43
Writer ala DOM (Document Object Model)
Definition gdcmWriter.h:49
std::ostream * GetStreamPtr() const
Definition gdcmWriter.h:82
File & GetFile()
Definition gdcmWriter.h:67
std::ofstream * Ofstream
Definition gdcmWriter.h:86
bool GetCheckFileMetaInformation() const
Definition gdcmWriter.h:87
void CheckFileMetaInformationOff()
Definition gdcmWriter.h:71
virtual ~Writer()
void SetCheckFileMetaInformation(bool b)
Undocumented function, do not use (= leave default)
Definition gdcmWriter.h:70
void SetWriteDataSetOnly(bool b)
Definition gdcmWriter.h:75
virtual bool Write()
Main function to tell the writer to write.
void SetStream(std::ostream &output_stream)
Set user ostream buffer.
Definition gdcmWriter.h:61
std::ostream * Stream
Definition gdcmWriter.h:85
void SetFile(const File &f)
Set/Get the DICOM file (DataSet + Header)
Definition gdcmWriter.h:66
void SetFileName(const char *filename_native)
Set the filename of DICOM file to write:
void CheckFileMetaInformationOn()
Definition gdcmWriter.h:72
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21