GDCM  2.2.6
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 
20 namespace gdcm
21 {
22 
23 class FileMetaInformation;
49 {
50 public:
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 
74 protected:
75  void SetWriteDataSetOnly(bool b) { WriteDataSetOnly = b; }
76 
77 protected:
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 
84 protected:
85  std::ostream *Stream;
86  std::ofstream *Ofstream;
87 
88 private:
90  bool CheckFileMetaInformation;
91  bool WriteDataSetOnly;
92 };
93 
94 } // end namespace gdcm
95 
96 #endif //GDCMWRITER_H
void SetFile(const File &f)
Set/Get the DICOM file (DataSet + Header)
Definition: gdcmWriter.h:66
void CheckFileMetaInformationOff()
Definition: gdcmWriter.h:71
File & GetFile()
Definition: gdcmWriter.h:67
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
void CheckFileMetaInformationOn()
Definition: gdcmWriter.h:72
void SetWriteDataSetOnly(bool b)
Definition: gdcmWriter.h:75
std::ostream * GetStreamPtr() const
Definition: gdcmWriter.h:82
Class for Smart Pointer.
Definition: gdcmObject.h:26
StreamImageReader.
Definition: gdcmStreamImageWriter.h:42
a DICOM File See PS 3.10 File: A File is an ordered string of zero or more bytes, where the first byt...
Definition: gdcmFile.h:33
Writer ala DOM (Document Object Model) This class is a non-validating writer, it will only performs w...
Definition: gdcmWriter.h:48
std::ostream * Stream
Definition: gdcmWriter.h:85
void SetStream(std::ostream &output_stream)
Set user ostream buffer.
Definition: gdcmWriter.h:61
std::ofstream * Ofstream
Definition: gdcmWriter.h:86
void SetCheckFileMetaInformation(bool b)
Undocumented function, do not use (= leave default)
Definition: gdcmWriter.h:70

Generated on Sat Dec 21 2013 05:56:18 for GDCM by doxygen 1.8.5
SourceForge.net Logo