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

A container class for DICOM metadata. More...

#include <vtkDICOMMetaData.h>

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

Public Types

typedef vtkDataObject Superclass
 VTK dynamic type information macro.
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 
vtkDICOMMetaDataNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) VTK_DICOM_OVERRIDE
 Print a summary of the contents of this object.
 
int GetNumberOfInstances ()
 Get the number of instances (i.e. files). More...
 
void SetNumberOfInstances (int n)
 
void Clear ()
 Remove all data elements.
 
void Initialize () VTK_DICOM_OVERRIDE
 Remove all data elements and initialize all members.
 
int GetNumberOfDataElements ()
 Get the number of data elements that are present.
 
vtkDICOMDataElementIterator Begin ()
 Get an iterator for the list of data elements.
 
vtkDICOMDataElementIterator End ()
 Get an end iterator for the list of data elements.
 
vtkDICOMDataElementIterator Find (vtkDICOMTag tag)
 Get the iterator for a specific data element. More...
 
bool Has (vtkDICOMTag tag)
 Check whether an attribute is present in the metadata.
 
bool HasAttribute (vtkDICOMTag tag)
 
void Erase (vtkDICOMTag tag)
 Erase an attribute.
 
void RemoveAttribute (vtkDICOMTag tag)
 
const vtkDICOMValueGet (vtkDICOMTag tag)
 Get an attribute value. More...
 
const vtkDICOMValueGet (const vtkDICOMTagPath &p)
 
const vtkDICOMValueGetAttributeValue (vtkDICOMTag tag)
 
const vtkDICOMValueGetAttributeValue (const vtkDICOMTagPath &p)
 
const vtkDICOMValueGet (int idx, vtkDICOMTag tag)
 Get an attribute value for the specified file index. More...
 
const vtkDICOMValueGet (int idx, const vtkDICOMTagPath &p)
 
const vtkDICOMValueGetAttributeValue (int idx, vtkDICOMTag tag)
 
const vtkDICOMValueGetAttributeValue (int idx, const vtkDICOMTagPath &p)
 
const vtkDICOMValueGet (int idx, int frame, vtkDICOMTag tag)
 Get an attribute value for the specified file and frame index. More...
 
const vtkDICOMValueGet (int idx, int frame, const vtkDICOMTagPath &p)
 
const vtkDICOMValueGetAttributeValue (int idx, int frame, vtkDICOMTag tag)
 
const vtkDICOMValueGetAttributeValue (int idx, int frame, const vtkDICOMTagPath &p)
 
int GetFileIndex (int sliceIdx, int compIdx, int numComps)
 Get the file index for the given image slice and component. More...
 
int GetFileIndex (int sliceIdx)
 
int GetFrameIndex (int sliceIdx, int compIdx, int numComps)
 Get the frame index for the given image slice and component. More...
 
int GetFrameIndex (int sliceIdx)
 
void Set (int idx, vtkDICOMTag tag, const vtkDICOMValue &v)
 Set an attribute value for the image at file index "idx". More...
 
void Set (int idx, vtkDICOMTag tag, double v)
 
void Set (int idx, vtkDICOMTag tag, const std::string &v)
 
void SetAttributeValue (int idx, vtkDICOMTag tag, const vtkDICOMValue &v)
 
void SetAttributeValue (int idx, vtkDICOMTag tag, double v)
 
void SetAttributeValue (int idx, vtkDICOMTag tag, const std::string &v)
 
void Set (vtkDICOMTag tag, const vtkDICOMValue &v)
 Set the same attribute value for all images.
 
void Set (vtkDICOMTag tag, double v)
 
void Set (vtkDICOMTag tag, const std::string &v)
 
void SetAttributeValue (vtkDICOMTag tag, const vtkDICOMValue &v)
 
void SetAttributeValue (vtkDICOMTag tag, double v)
 
void SetAttributeValue (vtkDICOMTag tag, const std::string &v)
 
void Set (int idx, const vtkDICOMTagPath &tag, const vtkDICOMValue &v)
 Set the attribute at the specified path. More...
 
void Set (int idx, const vtkDICOMTagPath &tag, double v)
 
void Set (int idx, const vtkDICOMTagPath &tag, const std::string &v)
 
void SetAttributeValue (int idx, const vtkDICOMTagPath &tag, const vtkDICOMValue &v)
 
void SetAttributeValue (int idx, const vtkDICOMTagPath &tag, double v)
 
void SetAttributeValue (int idx, const vtkDICOMTagPath &tag, const std::string &v)
 
void Set (const vtkDICOMTagPath &tag, const vtkDICOMValue &v)
 Set the attribute value along this path for all images.
 
void Set (const vtkDICOMTagPath &tag, double v)
 
void Set (const vtkDICOMTagPath &tag, const std::string &v)
 
void SetAttributeValue (const vtkDICOMTagPath &tag, const vtkDICOMValue &v)
 
void SetAttributeValue (const vtkDICOMTagPath &tag, double v)
 
void SetAttributeValue (const vtkDICOMTagPath &tag, const std::string &v)
 
vtkDICOMTag ResolvePrivateTag (vtkDICOMTag ptag, const std::string &creator)
 Resolve a private tag, or return (ffff,ffff) if not resolved. More...
 
vtkDICOMTag ResolvePrivateTag (int idx, vtkDICOMTag ptag, const std::string &creator)
 
vtkDICOMTag ResolvePrivateTagForWriting (vtkDICOMTag ptag, const std::string &creator)
 Resolve a private tag, and add the creator to the data set. More...
 
vtkDICOMTag ResolvePrivateTagForWriting (int idx, vtkDICOMTag ptag, const std::string &creator)
 
vtkDICOMDictEntry FindDictEntry (vtkDICOMTag tag)
 Look up a tag in the DICOM dictionary. More...
 
vtkDICOMVR FindDictVR (int idx, vtkDICOMTag tag)
 Use the dictionary to get the VR, return UN if not found.
 
vtkDICOMValue MakeValueWithSpecificCharacterSet (vtkDICOMVR vr, const std::string &v)
 Create a value from text in a specific character set.
 
void SetFileIndexArray (vtkIntArray *fileArray)
 Set the array to convert slice, component indices to file index.
 
vtkIntArray * GetFileIndexArray ()
 
void SetFrameIndexArray (vtkIntArray *frameArray)
 Set the array to convert slice, component indices to frame index.
 
vtkIntArray * GetFrameIndexArray ()
 
void CopyAttributes (vtkDICOMMetaData *source)
 Copy all the attributes from another MetaData object. More...
 
void ShallowCopy (vtkDataObject *source) VTK_DICOM_OVERRIDE
 DataObject interface function.
 
void DeepCopy (vtkDataObject *source) VTK_DICOM_OVERRIDE
 

Static Public Member Functions

static vtkDICOMMetaDataNew ()
 Create a new vtkDICOMMetaData instance.
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkDICOMMetaDataSafeDownCast (vtkObjectBase *o)
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
vtkDICOMDataElementFindDataElement (vtkDICOMTag tag)
 Find a tag, value pair.
 
vtkDICOMDataElementFindDataElementOrInsert (vtkDICOMTag tag)
 Find a tag, value pair or insert a pair if not found.
 
int FindItemsOrInsert (int idx, bool useidx, const vtkDICOMTagPath &tagpath, vtkDICOMItem *items[])
 Find or create the sequence at the head of the tagpath.
 
vtkDICOMItemFindItemOrInsert (int idx, const vtkDICOMTagPath &tagpath)
 Find a child item for a tag path, or insert if not there.
 
const vtkDICOMValueFindAttributeValue (int idx, vtkDICOMTag tag)
 Find the attribute value for the specified image index.
 
const vtkDICOMValueFindAttributeValue (int idx, const vtkDICOMTagPath &tagpath)
 Find the attribute value for the specified image index.
 

Detailed Description

A container class for DICOM metadata.

The vtkDICOMMetaData object stores DICOM metadata in a hash table for efficient access. One vtkDICOMMetaData object can store the metadata for a series of DICOM images.

Member Function Documentation

◆ CopyAttributes()

void vtkDICOMMetaData::CopyAttributes ( vtkDICOMMetaData source)

Copy all the attributes from another MetaData object.

Copy attributes from the source meta data object into this one. If the source has the same NumberOfInstances as this, then the attributes are copied on an instance-by-instance basis. Otherwise, attributes are only copied from the source if they have the same value for all instances.

◆ Find()

vtkDICOMDataElementIterator vtkDICOMMetaData::Find ( vtkDICOMTag  tag)
inline

Get the iterator for a specific data element.

If the element was not found, then End() will be returned.

◆ FindDictEntry()

vtkDICOMDictEntry vtkDICOMMetaData::FindDictEntry ( vtkDICOMTag  tag)

Look up a tag in the DICOM dictionary.

Unlike the method in vtkDICOMDictionary, this method can identify the implementor of a private tag and look it up in the implementor's dictionary.

◆ Get() [1/3]

const vtkDICOMValue& vtkDICOMMetaData::Get ( int  idx,
int  frame,
vtkDICOMTag  tag 
)

Get an attribute value for the specified file and frame index.

In order to get the file and frame index for a particular slice of a volume, use the GetFileIndex() and GetFrameIndex() methods. For enhanced multi-frame DICOM files, much of the meta data is stored per-frame. This method will search for the attribute in the PerFrameFunctionGroupSequence first, then in the SharedFunctionalGroupsSequence, and finally in the root. It can be used on either multi-frame or single-frame files. The frame index is counted from zero to NumberOfFrames-1.

◆ Get() [2/3]

const vtkDICOMValue& vtkDICOMMetaData::Get ( int  idx,
vtkDICOMTag  tag 
)

Get an attribute value for the specified file index.

If this meta data object is used to hold the meta data for multiple image instances, then use this method to get an attribute value for a specific instance. If the attribute is not present, the value will be invalid, i.e. v.IsValid() will be false.

◆ Get() [3/3]

const vtkDICOMValue& vtkDICOMMetaData::Get ( vtkDICOMTag  tag)

Get an attribute value.

The tag will usually be specified in one of these two ways: Get(vtkDICOMTag(0x0008,0x1030)) or, using the dictionary enum type, Get(DC::StudyDescription). If the attribute is not present, then the returned value will be invalid, i.e. v.IsValid() will be false.

◆ GetFileIndex()

int vtkDICOMMetaData::GetFileIndex ( int  sliceIdx,
int  compIdx,
int  numComps 
)

Get the file index for the given image slice and component.

This takes into account the way the files were sorted to create the volume (as given by the FileIndexArray). For multi-component images, supply both the component of interest, and the total number of components. The return value will be -1 if an index is out of range.

◆ GetFrameIndex()

int vtkDICOMMetaData::GetFrameIndex ( int  sliceIdx,
int  compIdx,
int  numComps 
)

Get the frame index for the given image slice and component.

This takes into account the way the frames were sorted to create the volume (as given by the FileIndexArray). For multi-component images, supply both the component of interest, and the total number of components. The return value will be -1 if an index is out of range.

◆ GetNumberOfInstances()

int vtkDICOMMetaData::GetNumberOfInstances ( )
inline

Get the number of instances (i.e. files).

We want to track the metadata from all of the files that make up the image volume that we have loaded into VTK. This method gives the number of files used to construct this meta data. All the files should be from the same series.

◆ ResolvePrivateTag()

vtkDICOMTag vtkDICOMMetaData::ResolvePrivateTag ( vtkDICOMTag  ptag,
const std::string &  creator 
)

Resolve a private tag, or return (ffff,ffff) if not resolved.

Private data elements are mobile, which means that different data sets might store them at different locations. Given a private data element which has a tag of (gggg,xxee) according to its dictionary, the first two element digits "xx" can change from one data set to the next, and the data set must have a "Creator Element" at (gggg,00xx) to allow the digits of "xx" to be resolved. Please read DICOM Part 5 Section 7.8 for additional information.

◆ ResolvePrivateTagForWriting()

vtkDICOMTag vtkDICOMMetaData::ResolvePrivateTagForWriting ( vtkDICOMTag  ptag,
const std::string &  creator 
)

Resolve a private tag, and add the creator to the data set.

This method works like ResolvePrivateTag, except that if the creator is not found in the data set, it will be added. It should be used to resolve private tags that you plan to write to the data set. The returned tag will be (ffff,ffff) if there are no empty slots available for the creator. Every private group has 240 available slots.

◆ Set() [1/2]

void vtkDICOMMetaData::Set ( int  idx,
const vtkDICOMTagPath tag,
const vtkDICOMValue v 
)

Set the attribute at the specified path.

The data element is inserted at the tail of the given path. If the path lies within a sequence that does not yet exist, then the sequence will be created. If an item index in the path points to an item that does not exist, then that item will be created.

◆ Set() [2/2]

void vtkDICOMMetaData::Set ( int  idx,
vtkDICOMTag  tag,
const vtkDICOMValue v 
)

Set an attribute value for the image at file index "idx".

Except for the method that takes a vtkDICOMValue, these methods will use the dictionary to find the VR for the attribute, and will attempt to convert the input data to the correct VR. Strings and doubles will be converted to integer values where necessary, and numeric values will be converted to strings where necessary. Note that if you specify a string value, it must either be an ASCII string, or it must be encoded in the SpecificCharacterSet for this data set.


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