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

A meta data reader for DICOM data. More...

#include <vtkDICOMParser.h>

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

Public Types

typedef vtkObject Superclass
 VTK dynamic type information macro.
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 
vtkDICOMParserNewInstance () 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 ()
 
void SetMetaData (vtkDICOMMetaData *)
 Set the metadata object for storing the data elements.
 
vtkDICOMMetaDataGetMetaData ()
 
virtual void SetIndex (int)
 Set the instance index to use when storing metadata.
 
int GetIndex ()
 
void SetDefaultCharacterSet (vtkDICOMCharacterSet cs)
 Set the character set to use if SpecificCharacterSet is missing. More...
 
vtkDICOMCharacterSet GetDefaultCharacterSet ()
 
void SetOverrideCharacterSet (bool b)
 Override the value stored in SpecificCharacterSet. More...
 
void OverrideCharacterSetOn ()
 
void OverrideCharacterSetOff ()
 
bool GetOverrideCharacterSet ()
 
void SetQuery (vtkDICOMMetaData *query)
 Set a query. Only matching data will be retrieved. More...
 
vtkDICOMMetaDataGetQuery ()
 
void SetQueryItem (const vtkDICOMItem &query)
 Set a query, using an item instead of vtkDICOMMetaData. More...
 
void SetGroups (vtkUnsignedShortArray *groups)
 Set specific metadata groups to read (obsolete). More...
 
vtkUnsignedShortArray * GetGroups ()
 
bool GetQueryMatched ()
 This is true only if the file matched the query.
 
bool GetPixelDataFound ()
 This is true only if PixelData was found in the file.
 
unsigned int GetPixelDataVL ()
 Get the VL for the PixelData, will be 0xffffffff if compressed.
 
vtkTypeInt64 GetFileOffset ()
 Get the byte offset to the end of the metadata. More...
 
vtkTypeInt64 GetFileSize ()
 Get the total file length (only valid after Update).
 
void SetBufferSize (int size)
 Set the buffer size, the default is 8192 (8k). More...
 
int GetBufferSize ()
 
virtual void Update ()
 Read the metadata from the file.
 
unsigned long GetErrorCode ()
 Get the error code.
 
- 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 vtkDICOMParserNew ()
 Create a new vtkDICOMParser instance.
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkDICOMParserSafeDownCast (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 FillBuffer (const unsigned char *&cp, const unsigned char *&ep)
 Internal method for filling the buffer. More...
 
virtual bool SeekBuffer (const unsigned char *&cp, const unsigned char *&ep, vtkTypeInt64 offset)
 Internal method to advance the buffer to a new file position. More...
 
virtual bool SkipValue (const unsigned char *&cp, const unsigned char *&ep, unsigned int vl)
 Internal method for skipping over a value. More...
 
virtual vtkTypeInt64 GetBytesRemaining (const unsigned char *cp, const unsigned char *ep)
 Get the bytes remaining in the file.
 
virtual void ParseError (const unsigned char *cp, const unsigned char *ep, const char *message)
 Report an error while parsing the file.
 
void SetErrorCode (unsigned long e)
 Set the error code.
 
virtual bool ReadFile (vtkDICOMMetaData *data, int idx)
 Read the file into the provided metadata object.
 
bool ReadMetaHeader (const unsigned char *&cp, const unsigned char *&ep, vtkDICOMMetaData *data, int idx)
 Read just the meta header (group 0x0002).
 
bool ReadMetaData (const unsigned char *&cp, const unsigned char *&ep, vtkDICOMMetaData *data, int idx)
 Read the meta data following the meta header.
 
vtkTypeInt64 GetBytesProcessed (const unsigned char *cp, const unsigned char *ep)
 Compute the file offset to the current position.
 
- 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
 
std::string TransferSyntax
 
vtkDICOMMetaDataMetaData
 
vtkDICOMMetaDataQuery
 
vtkDICOMItemQueryItem
 
vtkUnsignedShortArray * Groups
 
vtkDICOMFileInputFile
 
vtkTypeInt64 BytesRead
 
vtkTypeInt64 FileOffset
 
vtkTypeInt64 FileSize
 
unsigned char * Buffer
 
int BufferSize
 
int ChunkSize
 
int Index
 
unsigned int PixelDataVL
 
bool PixelDataFound
 
bool QueryMatched
 
vtkDICOMCharacterSet DefaultCharacterSet
 
bool OverrideCharacterSet
 
unsigned long ErrorCode
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Friends

class vtkDICOMParserInternalFriendship
 

Detailed Description

A meta data reader for DICOM data.

This class provides routines for parsing a DICOM file and creating a vtkDICOMMetaData object. It stops parsing the file as soon as it finds the PixelData, and the byte offset of the PixelData within the file can be retrieved with GetFileOffset().

Member Function Documentation

◆ FillBuffer()

virtual bool vtkDICOMParser::FillBuffer ( const unsigned char *&  cp,
const unsigned char *&  ep 
)
protectedvirtual

Internal method for filling the buffer.

This is an internal method that refills the buffer by reading data from the file. The pointers cp and ep mark the region of the buffer that has not been parsed yet. The call to FillBuffer will move this region to the beginning of the buffer, and will then fill the remainder of the buffer with new data from the file. The values of cp and ep will be set to the beginning and end of the buffer.

◆ GetFileOffset()

vtkTypeInt64 vtkDICOMParser::GetFileOffset ( )
inline

Get the byte offset to the end of the metadata.

After the metadata has been read, the file offset will be set to the position of the pixel data.

◆ IsA()

virtual vtkTypeBool vtkDICOMParser::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.

◆ SeekBuffer()

virtual bool vtkDICOMParser::SeekBuffer ( const unsigned char *&  cp,
const unsigned char *&  ep,
vtkTypeInt64  offset 
)
protectedvirtual

Internal method to advance the buffer to a new file position.

This will move to a new position within the file.

◆ SetBufferSize()

void vtkDICOMParser::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.

◆ SetDefaultCharacterSet()

void vtkDICOMParser::SetDefaultCharacterSet ( vtkDICOMCharacterSet  cs)

Set the character set to use if SpecificCharacterSet is missing.

Some DICOM files do not list a SpecificCharacterSet attribute, but nevertheless use a non-ASCII character encoding. This method can be used to specify the character set in absence of SpecificCharacterSet. If SpecificCharacterSet is present, the default will not override it unless OverrideCharacterSet is true.

◆ SetGroups()

void vtkDICOMParser::SetGroups ( vtkUnsignedShortArray *  groups)

Set specific metadata groups to read (obsolete).

This method is obsolete, the SetQuery() method should be used instead.

◆ SetOverrideCharacterSet()

void vtkDICOMParser::SetOverrideCharacterSet ( bool  b)

Override the value stored in SpecificCharacterSet.

This method can be used if the SpecificCharacterSet attribute of a file is incorrect. It overrides the SpecificCharacterSet with the DefaultCharacterSet.

◆ SetQuery()

void vtkDICOMParser::SetQuery ( vtkDICOMMetaData query)

Set a query. Only matching data will be retrieved.

This can be used to scan a file for data that matches a given query. For more information on how matching is done, see the vtkDICOMValue::Matches() method.

◆ SetQueryItem()

void vtkDICOMParser::SetQueryItem ( const vtkDICOMItem query)

Set a query, using an item instead of vtkDICOMMetaData.

This can be used to scan a file for data that matches a given query. For more information on how matching is done, see the vtkDICOMValue::Matches() method. To clear the query, pass an empty item.

◆ SkipValue()

virtual bool vtkDICOMParser::SkipValue ( const unsigned char *&  cp,
const unsigned char *&  ep,
unsigned int  vl 
)
protectedvirtual

Internal method for skipping over a value.

This is for skipping over bulk data (such as PixelData). If vl is 0xffffffff, then the value will be assumed to be delimited (e.g. encapsulated pixel data).


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