GDCM  2.2.6
gdcmCSAHeaderDictEntry.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 GDCMCSAHEADERDICTENTRY_H
15 #define GDCMCSAHEADERDICTENTRY_H
16 
17 #include "gdcmVR.h"
18 #include "gdcmVM.h"
19 
20 #include <string>
21 #include <iostream>
22 #include <iomanip>
23 
24 #include <cstring>
25 
26 namespace gdcm
27 {
39 {
40 public:
41  CSAHeaderDictEntry(const char *name = "", VR const &vr = VR::INVALID, VM const &vm = VM::VM0, const char *desc = ""):Name(name),ValueRepresentation(vr),ValueMultiplicity(vm),Description(desc) {
42  }
43 
44  friend std::ostream& operator<<(std::ostream& _os, const CSAHeaderDictEntry &_val);
45 
47  const VR &GetVR() const { return ValueRepresentation; }
48  void SetVR(const VR & vr) { ValueRepresentation = vr; }
49 
51  const VM &GetVM() const { return ValueMultiplicity; }
52  void SetVM(VM const & vm) { ValueMultiplicity = vm; }
53 
55  const char *GetName() const { return Name.c_str(); }
56  void SetName(const char* name) { Name = name; }
57 
59  const char *GetDescription() const { return Description.c_str(); }
60  void SetDescription(const char* desc) { Description = desc; }
61 
62  bool operator<(const CSAHeaderDictEntry &entry) const
63  {
64  return strcmp(GetName(),entry.GetName()) < 0;
65  }
66 
67 private:
68  std::string Name;
69  VR ValueRepresentation;
70  VM ValueMultiplicity;
71  std::string Description;
72  std::string Type; // TODO
73 };
74 
75 
76 //-----------------------------------------------------------------------------
77 inline std::ostream& operator<<(std::ostream& os, const CSAHeaderDictEntry &val)
78 {
79  if( val.Name.empty() )
80  {
81  os << "[No name]";
82  }
83  else
84  {
85  os << val.Name;
86  }
87  os << "\t" << val.ValueRepresentation << "\t" << val.ValueMultiplicity;
88  if( !val.Description.empty() )
89  {
90  os << "\t" << val.Description;
91  }
92  return os;
93 }
94 
95 } // end namespace gdcm
96 
97 #endif //GDCMCSAHEADERDICTENTRY_H
void SetVR(const VR &vr)
Definition: gdcmCSAHeaderDictEntry.h:48
Definition: gdcmVR.h:59
const VM & GetVM() const
Set/Get VM.
Definition: gdcmCSAHeaderDictEntry.h:51
Type.
Definition: gdcmType.h:41
void SetVM(VM const &vm)
Definition: gdcmCSAHeaderDictEntry.h:52
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
CSAHeaderDictEntry(const char *name="", VR const &vr=VR::INVALID, VM const &vm=VM::VM0, const char *desc="")
Definition: gdcmCSAHeaderDictEntry.h:41
void SetName(const char *name)
Definition: gdcmCSAHeaderDictEntry.h:56
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:92
const char * GetDescription() const
Set/Get Description.
Definition: gdcmCSAHeaderDictEntry.h:59
const char * GetName() const
Set/Get Name.
Definition: gdcmCSAHeaderDictEntry.h:55
Value Multiplicity Looking at the DICOMV3 dict only there is very few cases: 1 2 3 4 5 6 8 16 24 1-2 ...
Definition: gdcmVM.h:67
const VR & GetVR() const
Set/Get VR.
Definition: gdcmCSAHeaderDictEntry.h:47
Class to represent an Entry in the Dict Does not really exist within the DICOM definition, just a way to minimize storage and have a mapping from gdcm::Tag to the needed information.
Definition: gdcmCSAHeaderDictEntry.h:38
void SetDescription(const char *desc)
Definition: gdcmCSAHeaderDictEntry.h:60
Definition: gdcmVM.h:71
bool operator<(const CSAHeaderDictEntry &entry) const
Definition: gdcmCSAHeaderDictEntry.h:62
VR class This is adapted from DICOM standard The biggest difference is the INVALID VR and the composi...
Definition: gdcmVR.h:54

Generated on Sat Dec 21 2013 05:56:16 for GDCM by doxygen 1.8.5
SourceForge.net Logo