DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
DcmAttributeFilter Class Reference

Accept or reject DcmItem objects by comparing a specific attribute to a set of values. More...

Classes

struct  FilterInterface
 all actual filter implementations must inherit this interface. More...
 
class  IteratorBasedFilter
 A range-based filter implementation that compares an attribute's value with a range of values defined by two iterators. More...
 

Public Member Functions

template<typename Iterator >
 DcmAttributeFilter (const DcmTagKey &tag, const Iterator &begin, const Iterator &end)
 construct a DcmAttributeFilter object from two iterators defining the range of values. More...
 
template<typename Container >
 DcmAttributeFilter (const DcmTagKey &tag, const Container &container)
 construct a DcmAttributeFilter object from a container containing the range of values. More...
 
 DcmAttributeFilter ()
 construct a DcmAttributeFilter object that accepts any DcmItem.
 
 DcmAttributeFilter (const DcmTagKey &tag, const OFString &value)
 construct a DcmAttributeFilter object that compares the attribute with one specific value. More...
 
 DcmAttributeFilter (const DcmTagKey &tag, const char *const value)
 construct a DcmAttributeFilter object that compares the attribute with one specific value. More...
 
 ~DcmAttributeFilter ()
 free all resources used by this object.
 
OFBool apply (DcmItem &item) const
 apply the filter on a DcmItem. More...
 
OFBool operator() (DcmItem &item) const
 convenience function to enable using DcmAttributeFilter as a functor. More...
 
OFBool apply (DcmFileFormat &dcmfile) const
 apply the filter on a DICOM file (represented by a DcmFileFormat instance). More...
 
OFBool operator() (DcmFileFormat &dcmfile) const
 convenience function to enable using DcmAttributeFilter as a functor. More...
 

Static Private Member Functions

template<typename Iterator >
static IteratorBasedFilter
< Iterator > * 
createIteratorBasedFilter (const Iterator &begin, const Iterator &end)
 helper function to deduce the Iterator type from a container's begin() and end() method. More...
 

Private Attributes

const DcmTagKey m_Tag
 a DcmTagKey object determining which attribute of a DcmItem should be compared with the value.
 
FilterInterface *const m_pFilter
 a pointer to the actual filter.
 

Detailed Description

Accept or reject DcmItem objects by comparing a specific attribute to a set of values.

DcmAttributeFilter objects can be used to compare a specific attribute with one or more values - or to accept any DcmItem if no attribute is specified. DcmAttributeFilter objects can be used like any function taking a DcmItem& or a DcmFileFormat& object as parameter and returning a boolean value.

Constructor & Destructor Documentation

template<typename Iterator >
DcmAttributeFilter::DcmAttributeFilter ( const DcmTagKey tag,
const Iterator &  begin,
const Iterator &  end 
)
inline

construct a DcmAttributeFilter object from two iterators defining the range of values.

Note
each value should be comparable with an object of type OFString.
Template Parameters
Iteratora type matching the STL's ForwardIterator concept.
Parameters
taga DcmTagKey object determining which attribute of a DcmItem should be compared with the range of values.
beginan iterator referring to the first element in the range of values.
endan iterator referring to one past the end in the range of values.
template<typename Container >
DcmAttributeFilter::DcmAttributeFilter ( const DcmTagKey tag,
const Container &  container 
)
inline

construct a DcmAttributeFilter object from a container containing the range of values.

Note
each value should be comparable with an object of type OFString.
Template Parameters
Containera class matching the STL's Container concept.
Parameters
taga DcmTagKey object determining which attribute of a DcmItem should be compared with the range of values.
containera container containing the range of values.
DcmAttributeFilter::DcmAttributeFilter ( const DcmTagKey tag,
const OFString value 
)

construct a DcmAttributeFilter object that compares the attribute with one specific value.

Parameters
taga DcmTagKey object determining which attribute of a DcmItem should be compared with the value.
valuean OFString that is to be compared with the actual value stored in the DcmItem the filter is invoked on.
DcmAttributeFilter::DcmAttributeFilter ( const DcmTagKey tag,
const char *const  value 
)

construct a DcmAttributeFilter object that compares the attribute with one specific value.

Parameters
taga DcmTagKey object determining which attribute of a DcmItem should be compared with the value.
valuea character string that is to be compared with the actual value stored in the DcmItem the filter is invoked on.

Member Function Documentation

OFBool DcmAttributeFilter::apply ( DcmItem item) const

apply the filter on a DcmItem.

Parameters
itema DcmItem the filter should accept or reject.
Returns
OFTrue if the filter accepts the item, OFFalse otherwise.
OFBool DcmAttributeFilter::apply ( DcmFileFormat dcmfile) const

apply the filter on a DICOM file (represented by a DcmFileFormat instance).

Parameters
dcmfilea DcmFileFormat object the filter should accept or reject.
Returns
OFTrue if the filter accepts the DICOM file, OFFalse otherwise.
template<typename Iterator >
static IteratorBasedFilter<Iterator>* DcmAttributeFilter::createIteratorBasedFilter ( const Iterator &  begin,
const Iterator &  end 
)
inlinestaticprivate

helper function to deduce the Iterator type from a container's begin() and end() method.

Template Parameters
Iteratora type matching the STL's ForwardIterator concept.
Parameters
beginan iterator referring to the first element in the range of values.
endan iterator referring to one past the end in the range of values.
Returns
a pointer to a newly created IteratorBasedFilter object.
OFBool DcmAttributeFilter::operator() ( DcmItem item) const

convenience function to enable using DcmAttributeFilter as a functor.

Parameters
itema DcmItem the filter should accept or reject.
Returns
OFTrue if the filter accepts the item, OFFalse otherwise.
OFBool DcmAttributeFilter::operator() ( DcmFileFormat dcmfile) const

convenience function to enable using DcmAttributeFilter as a functor.

Parameters
dcmfilea DcmFileFormat object the filter should accept or reject.
Returns
OFTrue if the filter accepts the DICOM file, OFFalse otherwise.

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


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8