vtk-dicom  0.8.14
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
vtkDICOMCompiler Class Reference

A writer for DICOM meta data. More...

#include <vtkDICOMCompiler.h>

Inheritance diagram for vtkDICOMCompiler:
Inheritance graph
[legend]
Collaboration diagram for vtkDICOMCompiler:
Collaboration graph
[legend]

Public Types

typedef vtkObject Superclass
 VTK dynamic type information macro.
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 
vtkDICOMCompilerNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
 Print a summary of the contents of this object.
 
virtual void SetFileName (const char *)
 Set the file name.
 
virtual char * GetFileName ()
 
virtual void SetSOPInstanceUID (const char *)
 Set the SOP Instance UID. More...
 
virtual char * GetSOPInstanceUID ()
 
virtual void SetSeriesInstanceUID (const char *)
 Set the Series Instance UID. More...
 
virtual char * GetSeriesInstanceUID ()
 
virtual void SetStudyInstanceUID (const char *)
 Set the Study Instance UID. More...
 
virtual char * GetStudyInstanceUID ()
 
virtual void SetImplementationClassUID (const char *)
 Set the Implementation Class UID. More...
 
virtual char * GetImplementationClassUID ()
 
virtual void SetImplementationVersionName (const char *)
 Set the Implementation Version Name. More...
 
virtual char * GetImplementationVersionName ()
 
virtual void SetSourceApplicationEntityTitle (const char *)
 Set the Source Application Entity Title. More...
 
virtual char * GetSourceApplicationEntityTitle ()
 
virtual void SetTransferSyntaxUID (const char *)
 Set the Transfer Syntax UID. More...
 
virtual char * GetTransferSyntaxUID ()
 
void SetMetaData (vtkDICOMMetaData *)
 Set the metadata object to write to the file.
 
vtkDICOMMetaDataGetMetaData ()
 
virtual void SetIndex (int)
 Set the instance index to use when accessing vtkDICOMMataData.
 
int GetIndex ()
 
void SetBufferSize (int size)
 Set the buffer size, the default is 8192 (8k). More...
 
int GetBufferSize ()
 
virtual void WriteHeader ()
 Write the metadata to the file.
 
virtual void WritePixelData (const unsigned char *cp, vtkIdType size)
 Write all of the pixel data in one go. More...
 
virtual void WriteFrame (const unsigned char *cp, vtkIdType size)
 Write one frame to the end of the file.
 
virtual void Close ()
 Close the file.
 
virtual void CloseAndRemove ()
 Close the file and delete it. More...
 
unsigned long GetErrorCode ()
 Get the IO error code.
 
void GenerateSeriesUIDs ()
 Generate a series UID and instance UIDs for the meta data. More...
 
virtual void SetKeepOriginalPixelDataVR (bool)
 Use the original PixelData VR when writing pixel data element. More...
 
virtual void KeepOriginalPixelDataVROn ()
 
virtual void KeepOriginalPixelDataVROff ()
 
virtual bool GetKeepOriginalPixelDataVR ()
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_OVERRIDE
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommand * GetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
int GetReferenceCount ()
 
void SetReferenceCount (int)
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkDICOMCompilerNew ()
 Create a new vtkDICOMCompiler instance.
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkDICOMCompilerSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
virtual bool FlushBuffer (unsigned char *&cp, unsigned char *&ep)
 Internal method for flushing the IO buffer. More...
 
virtual void CompileError (const char *message)
 Report an error while compiling the file.
 
virtual void DiskFullError ()
 React to "disk full" by deleting file and reporting error.
 
void SetErrorCode (unsigned long e)
 Set the error code.
 
virtual bool WriteFile (vtkDICOMMetaData *data, int idx)
 Generate the file from the provided metadata object.
 
bool WriteMetaHeader (unsigned char *&cp, unsigned char *&ep, vtkDICOMMetaData *data, int idx)
 Write just the meta header (group 0x0002).
 
bool WriteMetaData (unsigned char *&cp, unsigned char *&ep, vtkDICOMMetaData *data, int idx)
 Write the meta data following the meta header.
 
bool WriteFragments ()
 Write the fragments of the compressed data.
 
void FreeFragments ()
 Free any fragments that are stored in memory.
 
unsigned int ComputePixelDataSize ()
 Compute the size of the pixel data (0xffffffff if compressed).
 
- Protected Member Functions inherited from vtkObject
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

char * FileName
 
char * SOPInstanceUID
 
char * SeriesInstanceUID
 
char * StudyInstanceUID
 
char * ImplementationClassUID
 
char * ImplementationVersionName
 
char * SourceApplicationEntityTitle
 
char * TransferSyntaxUID
 
vtkDICOMMetaDataMetaData
 
vtkStringArray * SeriesUIDs
 
vtkDICOMFileOutputFile
 
unsigned char * Buffer
 
unsigned char ** FrameData
 
unsigned int * FrameLength
 
unsigned int FrameCounter
 
int BufferSize
 
int ChunkSize
 
int Index
 
bool BigEndian
 
bool Compressed
 
bool KeepOriginalPixelDataVR
 
unsigned long ErrorCode
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Static Protected Attributes

static char StudyUID [64]
 

Friends

class vtkDICOMCompilerInternalFriendship
 

Detailed Description

A writer for DICOM meta data.

This class provides routines for compiling a vtkDICOMMetaData object into a DICOM file.

Member Function Documentation

◆ CloseAndRemove()

virtual void vtkDICOMCompiler::CloseAndRemove ( )
virtual

Close the file and delete it.

This method should be called if, for any reason, the writing of the file could not be completed.

◆ FlushBuffer()

virtual bool vtkDICOMCompiler::FlushBuffer ( unsigned char *&  cp,
unsigned char *&  ep 
)
protectedvirtual

Internal method for flushing the IO buffer.

This is an internal method that flushes the buffer to the file. If called with cp = 0, it will initialize cp to the beginning of the write buffer, and ep to the end of the buffer, without writing anything to the file. The caller should then write to the buffer, incrementing the pointer cp while doing so. When cp approaches the end of the buffer (which is stored in ep), FlushBuffer should be called to flush the buffer contents to the file. Every call will reset cp to the beginning of the buffer and ep to the end of the buffer.

◆ GenerateSeriesUIDs()

void vtkDICOMCompiler::GenerateSeriesUIDs ( )

Generate a series UID and instance UIDs for the meta data.

This will be called automatically whenever you provide a new meta data object for the compiler. Note that new UIDs will not be generated if you have already provided them with SetSOPInstanceUID() and SetSeriesInstanceUID().

◆ IsA()

virtual vtkTypeBool vtkDICOMCompiler::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

◆ SetBufferSize()

void vtkDICOMCompiler::SetBufferSize ( int  size)

Set the buffer size, the default is 8192 (8k).

A larger buffer size results in fewer IO calls. The minimum buffer size is 256 bytes.

◆ SetImplementationClassUID()

virtual void vtkDICOMCompiler::SetImplementationClassUID ( const char *  )
virtual

Set the Implementation Class UID.

If you do not supply a UID, a default one will be used.

◆ SetImplementationVersionName()

virtual void vtkDICOMCompiler::SetImplementationVersionName ( const char *  )
virtual

Set the Implementation Version Name.

If you do not supply a name, a default one will be used.

◆ SetKeepOriginalPixelDataVR()

virtual void vtkDICOMCompiler::SetKeepOriginalPixelDataVR ( bool  )
virtual

Use the original PixelData VR when writing pixel data element.

This is really only useful when cloning data sets. It ensures that the written data uses the same VR as the original data.

◆ SetSeriesInstanceUID()

virtual void vtkDICOMCompiler::SetSeriesInstanceUID ( const char *  )
virtual

Set the Series Instance UID.

If you do not supply a UID, a random UID will be generated. Each DICOM series must have a globally unique UID.

◆ SetSOPInstanceUID()

virtual void vtkDICOMCompiler::SetSOPInstanceUID ( const char *  )
virtual

Set the SOP Instance UID.

If you do not supply a UID, a random UID will be generated. Each DICOM file must have a globally unique UID.

◆ SetSourceApplicationEntityTitle()

virtual void vtkDICOMCompiler::SetSourceApplicationEntityTitle ( const char *  )
virtual

Set the Source Application Entity Title.

Provide a short name (16 chars max) for the network node that is running the implementation. The name should have no spaces or punctuation and should consist only of letters and digits.

◆ SetStudyInstanceUID()

virtual void vtkDICOMCompiler::SetStudyInstanceUID ( const char *  )
virtual

Set the Study Instance UID.

If you do not supply a UID, a random UID will be generated. Each DICOM study must have a globally unique UID.

◆ SetTransferSyntaxUID()

virtual void vtkDICOMCompiler::SetTransferSyntaxUID ( const char *  )
virtual

Set the Transfer Syntax UID.

The transfer syntax should be left at its default value of 1.2.840.10008.1.2.1 (uncompressed little-endian with explicit VR) unless you are cloning the PixelData byte for byte from another image, in which case you should use the transfer syntax from that image.

◆ WritePixelData()

virtual void vtkDICOMCompiler::WritePixelData ( const unsigned char *  cp,
vtkIdType  size 
)
virtual

Write all of the pixel data in one go.

This method assumes that the supplied buffer is already in the correct format (endianness, compression, fragments, etc) and writes it out to the file as the PixelData value.


The documentation for this class was generated from the following file: