GDCM 3.2.1

gdcmStringFilter.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMSTRINGFILTER_H
15#define GDCMSTRINGFILTER_H
16
17#include "gdcmDataElement.h"
18#include "gdcmDicts.h"
19#include "gdcmFile.h"
20
21 namespace gdcm
22{
23
29 class GDCM_EXPORT StringFilter
30{
31 public:
32 StringFilter();
33 ~StringFilter();
34
36 void UseDictAlways(bool) {}
37
39 void SetDicts(const Dicts &dicts);
40
44 std::string ToString(const DataElement& de) const;
45
47 std::string ToString(const Tag& t) const;
48
49 std::string ToString(const PrivateTag& t) const;
50
55 std::pair<std::string, std::string> ToStringPair(const DataElement& de) const;
57 std::pair<std::string, std::string> ToStringPair(const Tag& t) const;
58
60 std::string FromString(const Tag&t, const char * value, size_t len);
61
63 void SetFile(const File& f) { F = f; }
64 File &GetFile() { return *F; }
65 const File &GetFile() const { return *F; }
66
70 bool ExecuteQuery(std::string const &query, std::string & value) const;
71
72 protected:
73 std::pair<std::string, std::string> ToStringPair(const Tag& t, DataSet const &ds) const;
74 bool ExecuteQuery(std::string const &query, DataSet const &ds, std::string & value) const;
75
76 private:
77 std::pair<std::string, std::string> ToStringPairInternal(const DataElement& de, DataSet const &ds) const;
78 SmartPointer<File> F;
79};
80
81} // end namespace gdcm
82
83#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