vtk-dicom  0.8.14
vtkDICOMDictEntry.h
1 /*=========================================================================
2 
3  Program: DICOM for VTK
4 
5  Copyright (c) 2012-2022 David Gobbi
6  All rights reserved.
7  See Copyright.txt or http://dgobbi.github.io/bsd3.txt 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 vtkDICOMDictEntry_h
15 #define vtkDICOMDictEntry_h
16 
17 #include "vtkDICOMModule.h" // For export macro
18 #include "vtkDICOMVR.h"
19 #include "vtkDICOMVM.h"
20 #include "vtkDICOMTag.h"
21 
23 class VTKDICOM_EXPORT vtkDICOMDictEntry
24 {
25 public:
27  struct Entry
28  {
29  unsigned short Group;
30  unsigned short Element;
31  unsigned char Flags;
32  unsigned char VR;
33  unsigned short VM;
34  const char *Name;
35  };
36 
38  vtkDICOMDictEntry() : I(&InvalidEntry) {}
39 
41  bool IsValid() const {
42  return (this->I != &InvalidEntry); }
43 
45  vtkDICOMTag GetTag() const {
46  return vtkDICOMTag(this->I->Group, this->I->Element); }
47 
49  vtkDICOMVR GetVR() const {
50  return vtkDICOMVR(static_cast<vtkDICOMVR::EnumType>(this->I->VR)); }
51 
53  vtkDICOMVM GetVM() const {
54  return vtkDICOMVM(static_cast<vtkDICOMVM::EnumType>(this->I->VM)); }
55 
57  const char *GetName() const {
58  return this->I->Name; }
59 
61  bool IsRetired() const {
62  return (this->I->Flags == 1); }
63 
64 private:
65  vtkDICOMDictEntry(const Entry *o) : I(o) {}
66 
67  friend class vtkDICOMDictionary;
68 
69  const Entry *I;
70 
71  static const Entry InvalidEntry;
72 };
73 
74 VTKDICOM_EXPORT ostream& operator<<(ostream& o, const vtkDICOMDictEntry& a);
75 
76 #endif /* vtkDICOMDictEntry_h */
77 // VTK-HeaderTest-Exclude: vtkDICOMDictEntry.h
An entry in the DICOM dictionary.
Definition: vtkDICOMDictEntry.h:24
vtkDICOMTag GetTag() const
Get the DICOM tag for this dictionary entry.
Definition: vtkDICOMDictEntry.h:45
bool IsValid() const
Check whether the returned entry is valid.
Definition: vtkDICOMDictEntry.h:41
vtkDICOMVM GetVM() const
Get the VM for this dictionary entry.
Definition: vtkDICOMDictEntry.h:53
bool IsRetired() const
Check whether this entry has been retired from the DICOM standard.
Definition: vtkDICOMDictEntry.h:61
vtkDICOMDictEntry()
Construct an invalid DictEntry object.
Definition: vtkDICOMDictEntry.h:38
vtkDICOMVR GetVR() const
Get the VR for this dictionary entry.
Definition: vtkDICOMDictEntry.h:49
const char * GetName() const
Get a human-readable name for this dictionary entry.
Definition: vtkDICOMDictEntry.h:57
Provide access to the DICOM tag dictionary.
Definition: vtkDICOMDictionary.h:27
A (group,element) identifier tag for DICOM attributes.
Definition: vtkDICOMTag.h:23
VMs (Value Multiplicities)
Definition: vtkDICOMVM.h:22
VRs (Value Representations)
Definition: vtkDICOMVR.h:22
EnumType
The VR enum constants.
Definition: vtkDICOMVR.h:29
A struct to statically store DICOM dictionary entries.
Definition: vtkDICOMDictEntry.h:28