DCMTK
Version 3.6.1 20120515
OFFIS DICOM Toolkit
|
Class representing a path of DICOM objects. More...
Public Member Functions | |
DcmPath () | |
Constructor, creates an empty search result. | |
DcmPath (const OFList< DcmPathNode * > ¤tPath) | |
Constructor, creates a search result from a list of search nodes. | |
void | append (DcmPathNode *node) |
Appends a search node at the end of the search result path. | |
void | deleteBackNode () |
Removes last path node from path. | |
OFListIterator (DcmPathNode *) begin() | |
Returns iterator pointing to first path component. | |
DcmPathNode * | back () |
Returns last path component. | |
OFListIterator (DcmPathNode *) end() | |
Returns iterator pointing to last path component. | |
Uint32 | size () const |
Returns number of path components. | |
OFBool | empty () const |
Returns whether path is empty, ie does not contain any path nodes. | |
OFString | toString () const |
Returns a string representation of the path, e.g. "SourceImageSequence[0].ReferencedSOPInstanceUID". | |
OFBool | containsGroup (const Uint16 groupNo) const |
Returns whether the path contains tags of a given group. | |
~DcmPath () | |
Desctructor, cleans up memory of path nodes. | |
Static Public Member Functions | |
static OFCondition | separatePathNodes (const OFString &path, OFList< OFString > &result) |
Returns a string representation of each path node separately. | |
static OFCondition | parseItemNoFromPath (OFString &path, Uint32 &itemNo, OFBool &wasWildcard) |
Helper function for findOrCreatePath(). | |
static OFCondition | parseTagFromPath (OFString &path, DcmTag &tag) |
Function that parses a tag from the beginning of a path string. | |
Private Member Functions | |
DcmPath (const DcmPath &rhs) | |
Private undefined copy constructor. | |
DcmPath & | operator= (const DcmPath &arg) |
Private undefined assignment operator. | |
Private Attributes | |
OFList< DcmPathNode * > | m_path |
Internal list representing the nodes in the path. |
Class representing a path of DICOM objects.
A path is a "way" through a DICOM dataset, i.e. it starts e.g. with an item, followed by a sequence originally contained in this item. The sequence then could be followed by another item which is part of the sequence and so on. Thus the path should be well-formed, but if it is created manually (e.g. using append()) there is no corresponding checking.
DcmPath::DcmPath | ( | const OFList< DcmPathNode * > & | currentPath | ) |
Constructor, creates a search result from a list of search nodes.
currentPath | [in] The list of search nodes representing a "path" through a DICOM dataset |
Desctructor, cleans up memory of path nodes.
Does not delete the DcmObjects the nodes point to (this is also not done by the desctructor of the path nodes, so the caller is responsible for freeing any related DICOM objects.
void DcmPath::append | ( | DcmPathNode * | node | ) |
Appends a search node at the end of the search result path.
It is not checked whether the resulting path is still valid.
node | [in] The node to append. |
DcmPathNode* DcmPath::back | ( | ) |
Returns last path component.
OFBool DcmPath::containsGroup | ( | const Uint16 | groupNo | ) | const |
Returns whether the path contains tags of a given group.
Might be useful for looking after (unwanted) meta header tags etc.
groupNo | [in] The group number to look for |
void DcmPath::deleteBackNode | ( | ) |
Removes last path node from path.
Also frees memory of path node but does _not_ free memory of the underlying DICOM item or element.
OFBool DcmPath::empty | ( | ) | const |
Returns whether path is empty, ie does not contain any path nodes.
Returns iterator pointing to first path component.
Returns iterator pointing to last path component.
static OFCondition DcmPath::parseItemNoFromPath | ( | OFString & | path, |
Uint32 & | itemNo, | ||
OFBool & | wasWildcard | ||
) | [static] |
Helper function for findOrCreatePath().
Parses an item number from the beginning of the path string. The item number must be positive, starting with 0. The path must start like "[itemnumber]...".
path | [in/out] The path starting with the item number in square brackets, e.g. "[3]". The parsed item number and a potentially following "." are removed from the path |
itemNo | [out] The parsed item number. If a wildcard was parsed, this output parameter is not set at all. |
wasWildcard | [out] Is set to OFTrue, if wildcard was parsed (instead of concrete item number). |
static OFCondition DcmPath::parseTagFromPath | ( | OFString & | path, |
DcmTag & | tag | ||
) | [static] |
Function that parses a tag from the beginning of a path string.
The tag has to be either in numeric format, e.g. "(0010,0010)" or a dictionary name, e.g. "PatientName". If successful, the parsed tag is removed from the path string.
path | [in/out] The path string, starting with the attribute to parse |
tag | [out] The tag parsed |
static OFCondition DcmPath::separatePathNodes | ( | const OFString & | path, |
OFList< OFString > & | result | ||
) | [static] |
Returns a string representation of each path node separately.
Tags are represented as numbers surrounded by braces "(gggg,eeee)", not dictionary names. Items are represented by a number or wildcard in square brackets, eg. "[12]" or "[*]".
path | The path to parse into different nodes |
result | [out] List containing the resulting strings |
Uint32 DcmPath::size | ( | ) | const |
Returns number of path components.
OFString DcmPath::toString | ( | ) | const |
Returns a string representation of the path, e.g. "SourceImageSequence[0].ReferencedSOPInstanceUID".