gdcmStringFilter.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMSTRINGFILTER_H
#define GDCMSTRINGFILTER_H
#include "gdcmDataElement.h"
#include "gdcmDicts.h"
#include "gdcmFile.h"
namespace gdcm
{
class GDCM_EXPORT StringFilter
{
public:
StringFilter();
~StringFilter();
void UseDictAlways(bool) {}
void SetDicts(const Dicts &dicts);
std::string ToString(const DataElement& de) const;
std::string ToString(const Tag& t) const;
std::string ToString(const PrivateTag& t) const;
std::pair<std::string, std::string> ToStringPair(const DataElement& de) const;
std::pair<std::string, std::string> ToStringPair(const Tag& t) const;
std::string FromString(const Tag&t, const char * value, size_t len);
void SetFile(const File& f) { F = f; }
File &GetFile() { return *F; }
const File &GetFile() const { return *F; }
bool ExecuteQuery(std::string const &query, std::string & value) const;
protected:
std::pair<std::string, std::string> ToStringPair(const Tag& t, DataSet const &ds) const;
bool ExecuteQuery(std::string const &query, DataSet const &ds, std::string & value) const;
private:
std::pair<std::string, std::string> ToStringPairInternal(const DataElement& de, DataSet const &ds) const;
SmartPointer<File> F;
};
} // end namespace gdcm
#endif //GDCMSTRINGFILTER_H
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::DataSet
Class to represent a Data Set (which contains Data Elements).
Definition gdcmDataSet.h:56
gdcm::Dicts
Class to manipulate the sum of knowledge (all the dict user load).
Definition gdcmDicts.h:29
gdcm::File
a DICOM File
Definition gdcmFile.h:34
gdcm::PrivateTag
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner).
Definition gdcmPrivateTag.h:39
gdcm::SmartPointer
Class for Smart Pointer.
Definition gdcmSmartPointer.h:40
gdcm::StringFilter::FromString
std::string FromString(const Tag &t, const char *value, size_t len)
Convert to string the char array defined by the pair (value,len).
gdcm::StringFilter::ToStringPair
std::pair< std::string, std::string > ToStringPair(const Tag &t, DataSet const &ds) const
gdcm::StringFilter::ToString
std::string ToString(const Tag &t) const
Directly from a Tag:
gdcm::StringFilter::StringFilter
StringFilter()
gdcm::StringFilter::ToStringPair
std::pair< std::string, std::string > ToStringPair(const Tag &t) const
Directly from a Tag:
gdcm::StringFilter::ToString
std::string ToString(const DataElement &de) const
gdcm::StringFilter::ExecuteQuery
bool ExecuteQuery(std::string const &query, std::string &value) const
gdcm::StringFilter::SetDicts
void SetDicts(const Dicts &dicts)
Allow user to pass in there own dicts.
gdcm::StringFilter::ToStringPair
std::pair< std::string, std::string > ToStringPair(const DataElement &de) const
gdcm::StringFilter::GetFile
const File & GetFile() const
Definition gdcmStringFilter.h:65
gdcm::StringFilter::ToString
std::string ToString(const PrivateTag &t) const
gdcm::StringFilter::SetFile
void SetFile(const File &f)
Set/Get File.
Definition gdcmStringFilter.h:63
gdcm::StringFilter::ExecuteQuery
bool ExecuteQuery(std::string const &query, DataSet const &ds, std::string &value) const
gdcm::StringFilter::GetFile
File & GetFile()
Definition gdcmStringFilter.h:64
gdcm::StringFilter::UseDictAlways
void UseDictAlways(bool)
Definition gdcmStringFilter.h:36
gdcm::StringFilter::~StringFilter
~StringFilter()
gdcm::Tag
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
gdcmDataElement.h
gdcmDicts.h
gdcmFile.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21