GDCM 3.0.24
gdcmStreamImageWriter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef GDCMSTREAMIMAGEWRITER_H
20#define GDCMSTREAMIMAGEWRITER_H
21
22#include "gdcmWriter.h"
23#include <iostream>
24#include "gdcmDataSet.h"
25
26namespace gdcm
27{
28
29class MediaStorage;
30class RAWCodec;
43{
44
45public:
48
49
53 void SetFileName(const char* inFileName);
54 void SetStream(std::ostream& inStream);
55
64 void DefinePixelExtent(uint16_t inXMin, uint16_t inXMax,
65 uint16_t inYMin, uint16_t inYMax, uint16_t inZMin = 0, uint16_t inZMax = 1);
66
67
74
82 bool Write(void* inWriteBuffer, const std::size_t& inBufferLength);
83
87 virtual bool WriteImageInformation();
88
92 bool CanWriteFile() const;
93
94
97 void SetFile(const File& inFile);
98
99protected:
100
101 //contains the PrepareWrite function, which will get the given dataset ready
102 //for writing to disk by manufacturing the header information.
103 //note that if there is a pixel element in the given dataset, that will be removed
104 //during the copy, so that the imagewriter can write everything else out
106
107 //is the offset necessary if we always append?
108 //std::streamoff mFileOffset; //the fileoffset for getting header information
109 SmartPointer<File> mspFile; //all the non-pixel information
110
111 //for thread safety, these should not be stored here, but should be used
112 //for every read subregion operation.
113 uint16_t mXMin, mYMin, mXMax, mYMax, mZMin, mZMax;
114
119 //virtual bool ReadImageSubregionRAW(std::ostream& os);
120 virtual bool WriteImageSubregionRAW(char* inWriteBuffer, const std::size_t& inBufferLength);
121
131 int WriteRawHeader(RAWCodec* inCodec, std::ostream* inStream);
132
139
140};
141
142
143} // end namespace gdcm
144
145#endif //GDCMSTREAMIMAGEWRITER_H
a DICOM File
Definition gdcmFile.h:34
RAWCodec class.
Definition gdcmRAWCodec.h:27
Class for Smart Pointer.
Definition gdcmSmartPointer.h:40
StreamImageReader.
Definition gdcmStreamImageWriter.h:43
int mElementOffsets1
Definition gdcmStreamImageWriter.h:138
uint16_t mXMax
Definition gdcmStreamImageWriter.h:113
void SetFile(const File &inFile)
bool CanWriteFile() const
void DefinePixelExtent(uint16_t inXMin, uint16_t inXMax, uint16_t inYMin, uint16_t inYMax, uint16_t inZMin=0, uint16_t inZMax=1)
int WriteRawHeader(RAWCodec *inCodec, std::ostream *inStream)
SmartPointer< File > mspFile
Definition gdcmStreamImageWriter.h:109
uint32_t DefineProperBufferLength()
Writer mWriter
Definition gdcmStreamImageWriter.h:105
int mElementOffsets
Definition gdcmStreamImageWriter.h:137
void SetStream(std::ostream &inStream)
bool Write(void *inWriteBuffer, const std::size_t &inBufferLength)
virtual bool WriteImageSubregionRAW(char *inWriteBuffer, const std::size_t &inBufferLength)
virtual bool WriteImageInformation()
void SetFileName(const char *inFileName)
Writer ala DOM (Document Object Model)
Definition gdcmWriter.h:49
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21