vtk-dicom  0.8.14
Classes | Public Member Functions | List of all members
vtkDICOMItem Class Reference

An item in a DICOM sequence (type SQ). More...

#include <vtkDICOMItem.h>

Public Member Functions

 vtkDICOMItem ()
 Default constructor creates an empty item.
 
 vtkDICOMItem (vtkDICOMMetaData *meta)
 Constructor that takes certain properties from the data set. More...
 
 vtkDICOMItem (vtkDICOMCharacterSet cs, vtkDICOMVR vrForXS, int delimited=0, unsigned int byteOffset=0)
 Constructor with flag for delimitation and offset. More...
 
 vtkDICOMItem (const vtkDICOMItem &o)
 Copy constructor does reference counting.
 
 ~vtkDICOMItem ()
 Destructor does reference counting.
 
void Clear ()
 Clear the data.
 
bool IsEmpty () const
 Check if empty.
 
bool IsDelimited () const
 Check if this was read as a delimited item.
 
void Set (vtkDICOMTag tag, const vtkDICOMValue &v)
 Add a data element to this item. More...
 
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 (const vtkDICOMTagPath &tag, const vtkDICOMValue &v)
 Add a data element at the specified path. More...
 
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)
 
const vtkDICOMValueGet (vtkDICOMTag tag) const
 Get a data element from this item.
 
const vtkDICOMValueGet (const vtkDICOMTagPath &tag) const
 
const vtkDICOMValueGetAttributeValue (vtkDICOMTag tag) const
 
const vtkDICOMValueGetAttributeValue (const vtkDICOMTagPath &tag) const
 
unsigned int GetByteOffset () const
 Get the offset of this item from the beginning of the file. More...
 
int GetNumberOfDataElements () const
 Get the number of data elements.
 
vtkDICOMDataElementIterator Begin () const
 Get an iterator for the list of data elements.
 
vtkDICOMDataElementIterator End () const
 Get an end iterator for the list of data elements.
 
vtkDICOMTag ResolvePrivateTag (vtkDICOMTag ptag, const std::string &creator) const
 Resolve a private tag, or return (ffff,ffff) if not resolved. More...
 
vtkDICOMTag ResolvePrivateTagForWriting (vtkDICOMTag ptag, const std::string &creator)
 Resolve a private tag, and add the creator to the data set. More...
 
vtkDICOMDictEntry FindDictEntry (vtkDICOMTag tag) const
 Look up a tag in the DICOM dictionary. More...
 
vtkDICOMVR FindDictVR (vtkDICOMTag tag) const
 Use the dictionary to get the VR, returns UN on failure.
 
bool operator== (const vtkDICOMItem &o) const
 
bool operator!= (const vtkDICOMItem &o) const
 
vtkDICOMItemoperator= (const vtkDICOMItem &o)
 Assignment operator does reference counting.
 

Detailed Description

An item in a DICOM sequence (type SQ).

A DICOM sequence is a list of items, where each item is essentially a data set of its own. An item consists of zero or more data elements, each with a tag and value.

Constructor & Destructor Documentation

◆ vtkDICOMItem() [1/2]

vtkDICOMItem::vtkDICOMItem ( vtkDICOMMetaData meta)
explicit

Constructor that takes certain properties from the data set.

Specifically, this checks the values of SpecificCharacterSet (so that the item knows what character set to use), of PixelRepresentation (so that the item knows whether to resolve a VR of XS to US or SS, and of BitsAllocated (so that the item knows whether to resolve a VR of OX to OB or OW). This is the preferred constructor for vtkDICOMItem.

◆ vtkDICOMItem() [2/2]

vtkDICOMItem::vtkDICOMItem ( vtkDICOMCharacterSet  cs,
vtkDICOMVR  vrForXS,
int  delimited = 0,
unsigned int  byteOffset = 0 
)
explicit

Constructor with flag for delimitation and offset.

This constructor is used by the parser to record where the item was in the file, whether the item was delimited, and what the character set and default VR for XS are.

Member Function Documentation

◆ FindDictEntry()

vtkDICOMDictEntry vtkDICOMItem::FindDictEntry ( vtkDICOMTag  tag) const

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.

◆ GetByteOffset()

unsigned int vtkDICOMItem::GetByteOffset ( ) const
inline

Get the offset of this item from the beginning of the file.

Some DICOM files, such as DICOMDIR files, index into sequences via byte offsets into the file. Because of this, it is necessary to know the byte offset of each item in the sequence.

◆ ResolvePrivateTag()

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

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 vtkDICOMItem::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 vtkDICOMItem::Set ( const vtkDICOMTagPath tag,
const vtkDICOMValue v 
)

Add a data element 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 vtkDICOMItem::Set ( vtkDICOMTag  tag,
const vtkDICOMValue v 
)

Add a data element to this item.

If you specify a string, it must either be an ASCII string, or it must be encoded in the SpecificCharacterSet for this item.


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