GDCM: gdcm::StringFilter Class Reference

GDCM 3.2.11

Public Member Functions | Protected Member Functions | List of all members
gdcm::StringFilter Class Reference

StringFilter. More...

`#include <gdcmStringFilter.h>`

## 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)
| Convert to string the char array defined by the pair (value,len).
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 DataElement &de) const
std::string | ToString (const PrivateTag &t) const
std::string | ToString (const Tag &t) const
| Directly from a Tag:
std::pair< std::string, std::string > | ToStringPair (const DataElement &de) const
std::pair< std::string, std::string > | ToStringPair (const Tag &t) const
| Directly from a Tag:
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
  DumpVisusChange.cxx, ReadAndPrintAttributes.cxx, and SimplePrintPatientName.cs.

## Constructor & Destructor Documentation

## ◆ StringFilter()

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

## ◆ ~StringFilter()

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

## Member Function Documentation

## ◆ ExecuteQuery() [1/2]

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

## ◆ ExecuteQuery() [2/2]

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 syntactically correct

## ◆ FromString()

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

Convert to string the char array defined by the pair (value,len).

## ◆ GetFile() [1/2]

File & gdcm::StringFilter::GetFile | ( |  | ) |
| inline

## ◆ GetFile() [2/2]

const File & gdcm::StringFilter::GetFile | ( |  | ) | const
| inline

## ◆ SetDicts()

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

Allow user to pass in there own dicts.

## ◆ SetFile()

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

Set/Get File.

Examples
  DumpVisusChange.cxx, ReadAndPrintAttributes.cxx, and SimplePrintPatientName.cs.

## ◆ ToString() [1/3]

std::string gdcm::StringFilter::ToString | ( | const DataElement & | de | ) | const

Convert to string the ByteValue contained in a DataElement. The DataElement must be coming from the actual DataSet associated with File (see SetFile).

Examples
  DumpVisusChange.cxx, ReadAndPrintAttributes.cxx, and SimplePrintPatientName.cs.

## ◆ ToString() [2/3]

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

## ◆ ToString() [3/3]

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

Directly from a Tag:

## ◆ ToStringPair() [1/3]

std::pair< std::string, std::string > gdcm::StringFilter::ToStringPair | ( | const DataElement & | de | ) | 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.

## ◆ ToStringPair() [2/3]

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

Directly from a Tag:

## ◆ ToStringPair() [3/3]

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

## ◆ UseDictAlways()

void gdcm::StringFilter::UseDictAlways | ( | bool |  | ) |
| inline

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

- gdcmStringFilter.h