# gdcm::StringFilter Class Reference

StringFilter StringFilter is the class that make gdcm2.x looks more like gdcm1 and transform the binary blob contained in a DataElement into a string, typically this is a nice feature to have for wrapped language. More...

`#include <gdcmStringFilter.h>`

Collaboration diagram for gdcm::StringFilter:
[legend]

List of all members.

## Public Member Functions

| StringFilter ()
| ~StringFilter ()
bool | ExecuteQuery (std::string const &query, std::string &value) const
std::string | FromString (const Tag &t, const char *value, size_t len)
std::string | FromString (const Tag &t, const char *value, VL const &vl)
| DEPRECATED: NEVER USE IT.
File & | GetFile ()
const File & | GetFile () const
void | SetDicts (const Dicts &dicts)
| Allow user to pass in there own dicts.
void | SetFile (const File &f)
| Set/Get File.
std::string | ToString (const Tag &t) const
| Convert to string the ByteValue contained in a DataElement.
std::pair< std::string, std::string > | ToStringPair (const Tag &t) const
void | UseDictAlways (bool)

## Protected Member Functions

bool | ExecuteQuery (std::string const &query, DataSet const &ds, std::string &value) const
std::pair< std::string, std::string > | ToStringPair (const Tag &t, DataSet const &ds) const

## Detailed Description

StringFilter StringFilter is the class that make gdcm2.x looks more like gdcm1 and transform the binary blob contained in a DataElement into a string, typically this is a nice feature to have for wrapped language.

Examples:

  ReadAndPrintAttributes.cxx.

## Constructor & Destructor Documentation

gdcm::StringFilter::StringFilter | ( |  | ) |

gdcm::StringFilter::~StringFilter | ( |  | ) |

## Member Function Documentation

bool gdcm::StringFilter::ExecuteQuery | ( | std::string const & | query,
|  | std::string & | value
| ) |  | const

Execute the XPATH query to find a value (as string) return false when attribute is not found (or an error in the XPATH query) You need to make sure that your XPATH query is syntatically correct

bool gdcm::StringFilter::ExecuteQuery | ( | std::string const & | query,
|  | DataSet const & | ds,
|  | std::string & | value
| ) |  | const`[protected]`

std::string gdcm::StringFilter::FromString | ( | const Tag & | t,
|  | const char * | value,
|  | VL const & | vl
| ) |  |

DEPRECATED: NEVER USE IT.

std::string gdcm::StringFilter::FromString | ( | const Tag & | t,
|  | const char * | value,
|  | size_t | len
| ) |  |

const File& gdcm::StringFilter::GetFile | ( |  | ) | const`[inline]`

File& gdcm::StringFilter::GetFile | ( |  | ) | `[inline]`

void gdcm::StringFilter::SetDicts | ( | const Dicts & | dicts | ) |

Allow user to pass in there own dicts.

void gdcm::StringFilter::SetFile | ( | const File & | f | ) | `[inline]`

Set/Get File.

Examples:
  ReadAndPrintAttributes.cxx.

std::string gdcm::StringFilter::ToString | ( | const Tag & | t | ) | const

Convert to string the ByteValue contained in a DataElement.

Examples:
  ReadAndPrintAttributes.cxx.

std::pair<std::string, std::string> gdcm::StringFilter::ToStringPair | ( | const Tag & | t | ) | const

Convert to string the ByteValue contained in a DataElement the returned elements are: pair.first : the name as found in the dictionary of DataElement pari.second : the value encoded into a string (US,UL...) are properly converted

Examples:
  ReadAndPrintAttributes.cxx.

std::pair<std::string, std::string> gdcm::StringFilter::ToStringPair | ( | const Tag & | t,
|  | DataSet const & | ds
| ) |  | const`[protected]`

void gdcm::StringFilter::UseDictAlways | ( | bool |  | ) | `[inline]`

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

- gdcmStringFilter.h