DcmPath Class Reference

Class representing a path of DICOM objects. More...

List of all members.

Public Member Functions

 DcmPath ()
 Constructor, creates an empty search result.
 DcmPath (const OFList< DcmPathNode * > &currentPath)
 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.
DcmPathNodeback ()
 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.
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.
DcmPathoperator= (const DcmPath &arg)
 Private undefined assignment operator.

Private Attributes

OFList< DcmPathNode * > m_path
 Internal list representing the nodes in the path.


Detailed Description

Class representing a path of DICOM objects.

A path is a "way" through a DICOM dataset, ie. it starts e. g. with an item, follwed 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 wellformed, but if it is created manually (e. g. using append()) there is no corresponding checking.

Definition at line 94 of file dcpath.h.


Constructor & Destructor Documentation

DcmPath::DcmPath ( const OFList< DcmPathNode * > &  currentPath  ) 

Constructor, creates a search result from a list of search nodes.

Parameters:
currentPath [in] The list of search nodes representing a "path" through a DICOM dataset

DcmPath::~DcmPath (  ) 

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.


Member Function Documentation

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.

Parameters:
node [in] The node to append.

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.

Returns:
none

DcmPath::OFListIterator ( DcmPathNode  ) 

Returns iterator pointing to first path component.

Returns:
Iterator to first path node.

DcmPathNode* DcmPath::back (  ) 

Returns last path component.

Returns:
The last path component, NULL if none exists.

DcmPath::OFListIterator ( DcmPathNode  ) 

Returns iterator pointing to last path component.

Returns:
Iterator to last path node.

Uint32 DcmPath::size (  )  const

Returns number of path components.

Returns:
The number of path components

OFBool DcmPath::empty (  )  const

Returns whether path is empty, ie does not contain any path nodes.

Returns:
OFTrue, if path is empty, OFFalse otherwise

OFString DcmPath::toString (  )  const

Returns a string representation of the path, e.

g. "SourceImageSequence[0].ReferencedSOPInstanceUID"

Returns:
String representing path

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.

Parameters:
groupNo [in] The group number to look for
Returns:
OFTrue if group number is found in path, OFFalse otherwise

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 "[*]".

Parameters:
path The path to parse into different nodes
result [out] List containing the resulting strings
Returns:
none

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]...".

Parameters:
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).
Returns:
EC_Normal, if concrete item number or wildcard was parsed

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.

Parameters:
path - [in/out] The path string, starting with the attribute to parse
tag - [out] The tag parsed
Returns:
EC_Normal if successful, error code otherwise


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


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1