Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::DICOMTagPath Class Reference

Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag, which only specifies one specific tag, the tag path can identify nested attributes (like items in a DICOM sequence). In addition you may also specify wildcards for the selection index or complete elements of the path. More...

#include <mitkDICOMTagPath.h>

Collaboration diagram for mitk::DICOMTagPath:

Classes

struct  NodeInfo
 

Public Types

typedef int ItemSelectionIndex
 
typedef std::vector< NodeInfoNodeInfoVectorType
 
typedef NodeInfoVectorType::size_type PathIndexType
 

Public Member Functions

bool IsEmpty () const
 
bool IsExplicit () const
 
bool HasItemSelectionWildcardsOnly () const
 
PathIndexType Size () const
 
PathIndexType AddNode (const NodeInfo &newNode)
 
const NodeInfoGetNode (const PathIndexType &index) const
 
NodeInfoGetNode (const PathIndexType &index)
 
NodeInfoGetFirstNode ()
 
const NodeInfoGetFirstNode () const
 
NodeInfoGetLastNode ()
 
const NodeInfoGetLastNode () const
 
const NodeInfoVectorTypeGetNodes () const
 
std::string ToStr () const
 
DICOMTagPathFromStr (const std::string &pathStr)
 
bool operator== (const DICOMTagPath &path) const
 
bool operator< (const DICOMTagPath &right) const
 
bool Equals (const DICOMTagPath &path) const
 
DICOMTagPathoperator= (const DICOMTagPath &path)
 
DICOMTagPathAddAnyElement ()
 
DICOMTagPathAddElement (unsigned int group, unsigned int element)
 
DICOMTagPathAddAnySelection (unsigned int group, unsigned int element)
 
DICOMTagPathAddSelection (unsigned int group, unsigned int element, ItemSelectionIndex index)
 
 DICOMTagPath ()
 
 DICOMTagPath (const DICOMTagPath &path)
 
 DICOMTagPath (const DICOMTag &tag)
 
 DICOMTagPath (unsigned int group, unsigned int element)
 
 ~DICOMTagPath ()
 
virtual void Reset ()
 

Static Protected Member Functions

static bool DICOMTagPathesMatch (const DICOMTagPath &left, const DICOMTagPath &right)
 

Protected Attributes

NodeInfoVectorType m_NodeInfos
 

Detailed Description

Class is used to identify (nested) attributes in a DICOM dataset. In contrast to the class DICOMTag, which only specifies one specific tag, the tag path can identify nested attributes (like items in a DICOM sequence). In addition you may also specify wildcards for the selection index or complete elements of the path.

Remarks
If you want to keep the DICOMTagPath compatible to the dcmtk search path format, you may not use element wild cards (this IsExplicit() or HasItemSelectionWildcardsOnly() must return true).

Definition at line 38 of file mitkDICOMTagPath.h.

Member Typedef Documentation

Definition at line 41 of file mitkDICOMTagPath.h.

Definition at line 65 of file mitkDICOMTagPath.h.

typedef NodeInfoVectorType::size_type mitk::DICOMTagPath::PathIndexType

Definition at line 66 of file mitkDICOMTagPath.h.

Constructor & Destructor Documentation

mitk::DICOMTagPath::DICOMTagPath ( )

Definition at line 365 of file mitkDICOMTagPath.cpp.

References Reset().

Referenced by mitk::PropertyNameToDICOMTagPath().

mitk::DICOMTagPath::DICOMTagPath ( const DICOMTagPath path)

Definition at line 371 of file mitkDICOMTagPath.cpp.

mitk::DICOMTagPath::DICOMTagPath ( const DICOMTag tag)

Definition at line 377 of file mitkDICOMTagPath.cpp.

References mitk::DICOMTagPath::NodeInfo::Element, and m_NodeInfos.

mitk::DICOMTagPath::DICOMTagPath ( unsigned int  group,
unsigned int  element 
)
explicit

Definition at line 382 of file mitkDICOMTagPath.cpp.

References m_NodeInfos.

mitk::DICOMTagPath::~DICOMTagPath ( )

Definition at line 388 of file mitkDICOMTagPath.cpp.

Member Function Documentation

DICOMTagPath & mitk::DICOMTagPath::AddAnyElement ( )
DICOMTagPath & mitk::DICOMTagPath::AddAnySelection ( unsigned int  group,
unsigned int  element 
)
DICOMTagPath & mitk::DICOMTagPath::AddElement ( unsigned int  group,
unsigned int  element 
)
DICOMTagPath::PathIndexType mitk::DICOMTagPath::AddNode ( const NodeInfo newNode)

Adds a new node to the end of the path.

Parameters
[in]newNodeReference to the node that should be added.
Returns
Returns the index of the newly added node.

Definition at line 135 of file mitkDICOMTagPath.cpp.

References m_NodeInfos.

Referenced by DcmPathToTagPath().

DICOMTagPath & mitk::DICOMTagPath::AddSelection ( unsigned int  group,
unsigned int  element,
ItemSelectionIndex  index 
)
bool mitk::DICOMTagPath::DICOMTagPathesMatch ( const DICOMTagPath left,
const DICOMTagPath right 
)
staticprotected

Definition at line 399 of file mitkDICOMTagPath.cpp.

References GetNodes().

Referenced by Equals().

bool mitk::DICOMTagPath::Equals ( const DICOMTagPath path) const

Checks if to DICOMTagPathes are specify the same node. Hence all wildcards will be processed.
E.G.: "item1/child1/grandChild2" == ".//item1//grandChild2" is true.

Remarks
If you want to check if to pathes are "truely" equal and not only equal in terms of pointing to the same node, use the member function Equals()

Definition at line 275 of file mitkDICOMTagPath.cpp.

References DICOMTagPathesMatch().

Referenced by mitk::GetPropertyByDICOMTagPath(), and mitk::DICOMGenericImageFrameInfo::GetTagValueAsString().

NodeInfo& mitk::DICOMTagPath::GetFirstNode ( )

Function returns the node info of the first path node within the DICOMTagPath.

Precondition
DICOMTagPath must not be empty.
Returns
Info of the first path node. If the path is empty, an InvalidPathNode exception will be thrown.

Referenced by mitk::DICOMGDCMTagScanner::AddTagPath(), mitk::DICOMGDCMTagCache::GetTagValue(), and mitk::DICOMGDCMImageFrameInfo::GetTagValueAsString().

const DICOMTagPath::NodeInfo & mitk::DICOMTagPath::GetFirstNode ( ) const

Function returns the node info of the first path node within the DICOMTagPath.

Precondition
DICOMTagPath must not be empty.
Returns
Info of the first path node. If the path is empty, an InvalidPathNode exception will be thrown.

Definition at line 167 of file mitkDICOMTagPath.cpp.

References GetNode().

DICOMTagPath::NodeInfo & mitk::DICOMTagPath::GetLastNode ( )

Function returns the node info of the last path node within the DICOMTagPath.

Precondition
DICOMTagPath must not be empty.
Returns
Info of the first path node. If the path is empty, an InvalidPathNode exception will be thrown.

Definition at line 181 of file mitkDICOMTagPath.cpp.

References GetNode(), and Size().

Referenced by mitk::DICOMTagsOfInterestService::AddTagOfInterest(), and DcmPathToTagPath().

const DICOMTagPath::NodeInfo & mitk::DICOMTagPath::GetLastNode ( ) const

Function returns the node info of the last path node within the DICOMTagPath.

Precondition
DICOMTagPath must not be empty.
Returns
Info of the first path node. If the path is empty, an InvalidPathNode exception will be thrown.

Definition at line 174 of file mitkDICOMTagPath.cpp.

References GetNode(), and Size().

const DICOMTagPath::NodeInfo & mitk::DICOMTagPath::GetNode ( const PathIndexType index) const

Function returns the node info of a path node specified by the index within the DICOMTagPath.

Precondition
Passed index must not be out of bound.
Parameters
[in]indexIndex of the node whose info should be retrieved.
Returns
Info of the specified path node. If the index is out of bound an InvalidPathNode exception will be thrown.

Definition at line 143 of file mitkDICOMTagPath.cpp.

References m_NodeInfos, mitkThrow, Size(), and ToStr().

Referenced by GetFirstNode(), and GetLastNode().

DICOMTagPath::NodeInfo & mitk::DICOMTagPath::GetNode ( const PathIndexType index)

Function returns the node info of a path node specified by the index within the DICOMTagPath.

Precondition
Passed index must not be out of bound.
Parameters
[in]indexIndex of the node whose info should be retrieved.
Returns
Info of the specified path node. If the index is out of bound an InvalidPathNode exception will be thrown.

Definition at line 155 of file mitkDICOMTagPath.cpp.

References m_NodeInfos, mitkThrow, Size(), and ToStr().

bool mitk::DICOMTagPath::HasItemSelectionWildcardsOnly ( ) const

Returns if the path has any nodes with item selection wild cards ([*]).

Definition at line 116 of file mitkDICOMTagPath.cpp.

References mitk::DICOMTagPath::NodeInfo::AnyElement, mitk::DICOMTagPath::NodeInfo::AnySelection, and m_NodeInfos.

Referenced by mitk::DICOMTagPathToDCMTKSearchPath().

bool mitk::DICOMTagPath::IsEmpty ( ) const

Returns if the DICOMTagPath is empty.

Definition at line 97 of file mitkDICOMTagPath.cpp.

References m_NodeInfos.

Referenced by mitk::GetPropertyByDICOMTagPath().

bool mitk::DICOMTagPath::operator< ( const DICOMTagPath right) const

Operation equals like comparing the ToStr() results with operator <.

Definition at line 249 of file mitkDICOMTagPath.cpp.

References m_NodeInfos.

DICOMTagPath & mitk::DICOMTagPath::operator= ( const DICOMTagPath path)

Definition at line 282 of file mitkDICOMTagPath.cpp.

References m_NodeInfos.

bool mitk::DICOMTagPath::operator== ( const DICOMTagPath path) const

Compares two DICOMTagPaths for real equality. So its a string compare of their string conversion

Definition at line 242 of file mitkDICOMTagPath.cpp.

References m_NodeInfos.

void mitk::DICOMTagPath::Reset ( )
virtual

Definition at line 392 of file mitkDICOMTagPath.cpp.

References m_NodeInfos.

Referenced by DICOMTagPath().

Member Data Documentation


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