DCMTK: DcmAttributeFilter Class Reference

DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
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.
template<typename Container>
| DcmAttributeFilter (const DcmTagKey &tag, const Container &container)
| construct a DcmAttributeFilter object from a container containing the range of values.
| 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.
| DcmAttributeFilter (const DcmTagKey &tag, const char *const value)
| construct a DcmAttributeFilter object that compares the attribute with one specific value.
| ~DcmAttributeFilter ()
| free all resources used by this object.
OFBool | apply (DcmItem &item) const
| apply the filter on a DcmItem.
OFBool | operator() (DcmItem &item) const
| convenience function to enable using DcmAttributeFilter as a functor.
OFBool | apply (DcmFileFormat &dcmfile) const
| apply the filter on a DICOM file (represented by a DcmFileFormat instance).
OFBool | operator() (DcmFileFormat &dcmfile) const
| convenience function to enable using DcmAttributeFilter as a functor.

## 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.

## 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

## ◆ DcmAttributeFilter() [1/4]

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

  Iterator | a type matching the STL's ForwardIterator concept.

Parameters

  tag | a DcmTagKey object determining which attribute of a DcmItem should be compared with the range of values.
  begin | an iterator referring to the first element in the range of values.
  end | an iterator referring to one past the end in the range of values.

References createIteratorBasedFilter(), m_pFilter, and m_Tag.

Referenced by operator()().

## ◆ DcmAttributeFilter() [2/4]

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

  Container | a class matching the STL's Container concept.

Parameters

  tag | a DcmTagKey object determining which attribute of a DcmItem should be compared with the range of values.
  container | a container containing the range of values.

References createIteratorBasedFilter(), m_pFilter, and m_Tag.

## ◆ DcmAttributeFilter() [3/4]

DcmAttributeFilter::DcmAttributeFilter | ( | const DcmTagKey & | tag,
|  | const OFString & | value )

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

Parameters

  tag | a DcmTagKey object determining which attribute of a DcmItem should be compared with the value.
  value | an OFString that is to be compared with the actual value stored in the DcmItem the filter is invoked on.

## ◆ DcmAttributeFilter() [4/4]

DcmAttributeFilter::DcmAttributeFilter | ( | const DcmTagKey & | tag,
|  | const char *const | value )

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

Parameters

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

## Member Function Documentation

## ◆ apply() [1/2]

OFBool DcmAttributeFilter::apply | ( | DcmFileFormat & | dcmfile | ) | const

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

Parameters

  dcmfile | a DcmFileFormat object the filter should accept or reject.

Returns
  OFTrue if the filter accepts the DICOM file, OFFalse otherwise.

## ◆ apply() [2/2]

OFBool DcmAttributeFilter::apply | ( | DcmItem & | item | ) | const

apply the filter on a DcmItem.

Parameters

  item | a DcmItem the filter should accept or reject.

Returns
  OFTrue if the filter accepts the item, OFFalse otherwise.

## ◆ createIteratorBasedFilter()

template<typename Iterator>

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

  Iterator | a type matching the STL's ForwardIterator concept.

Parameters

  begin | an iterator referring to the first element in the range of values.
  end | an iterator referring to one past the end in the range of values.

Returns
  a pointer to a newly created IteratorBasedFilter object.

Referenced by DcmAttributeFilter(), and DcmAttributeFilter().

## ◆ operator()() [1/2]

OFBool DcmAttributeFilter::operator() | ( | DcmFileFormat & | dcmfile | ) | const

convenience function to enable using DcmAttributeFilter as a functor.

Parameters

  dcmfile | a DcmFileFormat object the filter should accept or reject.

Returns
  OFTrue if the filter accepts the DICOM file, OFFalse otherwise.

References DcmAttributeFilter().

## ◆ operator()() [2/2]

OFBool DcmAttributeFilter::operator() | ( | DcmItem & | item | ) | const

convenience function to enable using DcmAttributeFilter as a functor.

Parameters

  item | a DcmItem the filter should accept or reject.

Returns
  OFTrue if the filter accepts the item, OFFalse otherwise.

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

- dcmdata/include/dcmtk/dcmdata/dcfilter.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.16.1