gdcmWriter.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMWRITER_H
#define GDCMWRITER_H
#include "gdcmFile.h"
namespace gdcm
{
class FileMetaInformation;
class GDCM_EXPORT Writer
{
public:
Writer();
virtual ~Writer();
virtual bool Write(); // Execute()
void SetFileName(const char *filename_native);
void SetStream(std::ostream &output_stream) {
Stream = &output_stream;
}
void SetFile(const File& f) { F = f; }
File &GetFile() { return *F; }
void SetCheckFileMetaInformation(bool b) { CheckFileMetaInformation = b; }
void CheckFileMetaInformationOff() { CheckFileMetaInformation = false; }
void CheckFileMetaInformationOn() { CheckFileMetaInformation = true; }
protected:
void SetWriteDataSetOnly(bool b) { WriteDataSetOnly = b; }
protected:
friend class StreamImageWriter;
//this function is added for the StreamImageWriter, which needs to write
//up to the pixel data and then stops right before writing the pixel data.
//after that, for the raw codec at least, zeros are written for the length of the data
std::ostream* GetStreamPtr() const { return Stream; }
protected:
std::ostream *Stream;
std::ofstream *Ofstream;
bool GetCheckFileMetaInformation() const { return CheckFileMetaInformation; }
private:
SmartPointer<File> F;
bool CheckFileMetaInformation;
bool WriteDataSetOnly;
};
} // end namespace gdcm
#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