GDCM: gdcmWriter.h Source File

GDCM 3.2.5

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;
48 class GDCM_EXPORT Writer
49{
50public:
51 Writer();
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:
90 SmartPointer<File> F;
91 bool CheckFileMetaInformation;
92 bool WriteDataSetOnly;
93};
94
95} // end namespace gdcm
96
97#endif //GDCMWRITER_H
gdcm::FileMetaInformation
Class to represent a File Meta Information.
Definition gdcmFileMetaInformation.h:41
gdcm::File
a DICOM File
Definition gdcmFile.h:34
gdcm::SmartPointer
Class for Smart Pointer.
Definition gdcmSmartPointer.h:40
gdcm::Writer::GetStreamPtr
std::ostream * GetStreamPtr() const
Definition gdcmWriter.h:82
gdcm::Writer::GetFile
File & GetFile()
Definition gdcmWriter.h:67
gdcm::Writer::Ofstream
std::ofstream * Ofstream
Definition gdcmWriter.h:86
gdcm::Writer::GetCheckFileMetaInformation
bool GetCheckFileMetaInformation() const
Definition gdcmWriter.h:87
gdcm::Writer::CheckFileMetaInformationOff
void CheckFileMetaInformationOff()
Definition gdcmWriter.h:71
gdcm::Writer::~Writer
virtual ~Writer()
gdcm::Writer::SetCheckFileMetaInformation
void SetCheckFileMetaInformation(bool b)
Undocumented function, do not use (= leave default).
Definition gdcmWriter.h:70
gdcm::Writer::SetWriteDataSetOnly
void SetWriteDataSetOnly(bool b)
Definition gdcmWriter.h:75
gdcm::Writer::Write
virtual bool Write()
Main function to tell the writer to write.
gdcm::Writer::SetStream
void SetStream(std::ostream &output_stream)
Set user ostream buffer.
Definition gdcmWriter.h:61
gdcm::Writer::StreamImageWriter
friend class StreamImageWriter
Definition gdcmWriter.h:78
gdcm::Writer::Stream
std::ostream * Stream
Definition gdcmWriter.h:85
gdcm::Writer::Writer
Writer()
gdcm::Writer::SetFile
void SetFile(const File &f)
Set/Get the DICOM file (DataSet + Header).
Definition gdcmWriter.h:66
gdcm::Writer::SetFileName
void SetFileName(const char *filename_native)
Set the filename of DICOM file to write:
gdcm::Writer::CheckFileMetaInformationOn
void CheckFileMetaInformationOn()
Definition gdcmWriter.h:72
gdcmFile.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21