14 #ifndef vtkDICOMCompiler_h
15 #define vtkDICOMCompiler_h
17 #include "vtkObject.h"
18 #include "vtkDICOMModule.h"
19 #include "vtkDICOMConfig.h"
22 #if defined(VTK_ABI_NAMESPACE_BEGIN)
23 VTK_ABI_NAMESPACE_BEGIN
28 #if defined(VTK_ABI_NAMESPACE_BEGIN)
34 class vtkDICOMCompilerInternalFriendship;
51 void PrintSelf(ostream& os, vtkIndent indent) VTK_DICOM_OVERRIDE;
54 vtkSetStringMacro(FileName);
56 vtkGetStringMacro(FileName);
65 vtkSetStringMacro(SOPInstanceUID);
66 vtkGetStringMacro(SOPInstanceUID);
75 vtkSetStringMacro(SeriesInstanceUID);
76 vtkGetStringMacro(SeriesInstanceUID);
85 vtkSetStringMacro(StudyInstanceUID);
86 vtkGetStringMacro(StudyInstanceUID);
94 vtkSetStringMacro(ImplementationClassUID);
95 vtkGetStringMacro(ImplementationClassUID);
103 vtkSetStringMacro(ImplementationVersionName);
104 vtkGetStringMacro(ImplementationVersionName);
114 vtkSetStringMacro(SourceApplicationEntityTitle);
115 vtkGetStringMacro(SourceApplicationEntityTitle);
127 vtkSetStringMacro(TransferSyntaxUID);
128 vtkGetStringMacro(TransferSyntaxUID);
138 vtkSetMacro(Index,
int);
140 int GetIndex() {
return this->Index; }
150 int GetBufferSize() {
return this->BufferSize; }
154 virtual void WriteHeader();
166 virtual void WriteFrame(
const unsigned char *cp, vtkIdType size);
199 vtkSetMacro(KeepOriginalPixelDataVR,
bool);
200 vtkBooleanMacro(KeepOriginalPixelDataVR,
bool);
201 vtkGetMacro(KeepOriginalPixelDataVR,
bool);
220 virtual
bool FlushBuffer(
unsigned char* &cp,
unsigned char* &ep);
223 virtual
void CompileError(const
char *message);
226 virtual
void DiskFullError();
229 void SetErrorCode(
unsigned long e) { this->ErrorCode = e; }
236 unsigned char* &cp,
unsigned char* &ep,
241 unsigned char* &cp,
unsigned char* &ep,
254 char *SOPInstanceUID;
255 char *SeriesInstanceUID;
256 char *StudyInstanceUID;
257 char *ImplementationClassUID;
258 char *ImplementationVersionName;
259 char *SourceApplicationEntityTitle;
260 char *TransferSyntaxUID;
262 vtkStringArray *SeriesUIDs;
264 unsigned char *Buffer;
265 unsigned char **FrameData;
266 unsigned int *FrameLength;
267 unsigned int FrameCounter;
273 bool KeepOriginalPixelDataVR;
274 unsigned long ErrorCode;
276 static char StudyUID[64];
279 friend class vtkDICOMCompilerInternalFriendship;
282 #ifdef VTK_DICOM_DELETE
A writer for DICOM meta data.
Definition: vtkDICOMCompiler.h:42
virtual void Close()
Close the file.
virtual void WriteFrame(const unsigned char *cp, vtkIdType size)
Write one frame to the end of the file.
unsigned long GetErrorCode()
Get the IO error code.
Definition: vtkDICOMCompiler.h:179
void SetBufferSize(int size)
Set the buffer size, the default is 8192 (8k).
virtual bool WriteFile(vtkDICOMMetaData *data, int idx)
Generate the file from the provided metadata object.
static vtkDICOMCompiler * New()
Create a new vtkDICOMCompiler instance.
virtual void WritePixelData(const unsigned char *cp, vtkIdType size)
Write all of the pixel data in one go.
unsigned int ComputePixelDataSize()
Compute the size of the pixel data (0xffffffff if compressed).
bool WriteMetaHeader(unsigned char *&cp, unsigned char *&ep, vtkDICOMMetaData *data, int idx)
Write just the meta header (group 0x0002).
void GenerateSeriesUIDs()
Generate a series UID and instance UIDs for the meta data.
virtual void CloseAndRemove()
Close the file and delete it.
void PrintSelf(ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
Print a summary of the contents of this object.
void FreeFragments()
Free any fragments that are stored in memory.
bool WriteFragments()
Write the fragments of the compressed data.
bool WriteMetaData(unsigned char *&cp, unsigned char *&ep, vtkDICOMMetaData *data, int idx)
Write the meta data following the meta header.
A class that provides basic input/output operations.
Definition: vtkDICOMFile.h:34
abstract base class for most VTK objects
Definition: vtkObject.h:54