vtk-dicom  0.8.17
vtkDICOMMetaDataAdapter.h
1 /*=========================================================================
2 
3  Program: DICOM for VTK
4 
5  Copyright (c) 2012-2024 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 vtkDICOMMetaDataAdapter_h
15 #define vtkDICOMMetaDataAdapter_h
16 
17 #include "vtkDICOMModule.h" // For export macro
18 #include "vtkDICOMTag.h"
19 
20 class vtkDICOMMetaData;
21 class vtkDICOMValue;
22 
24 
32 class VTKDICOM_EXPORT vtkDICOMMetaDataAdapter
33 {
34 public:
36 
44 
46 
51 
54 
58 
60 
66  int GetNumberOfInstances() const { return this->NumberOfInstances; }
68 
70 
76  bool Has(vtkDICOMTag tag) const;
77  bool HasAttribute(vtkDICOMTag tag) const {
78  return this->Has(tag); }
79 
81 
85  const vtkDICOMValue &Get(vtkDICOMTag tag) const;
86  const vtkDICOMValue &GetAttributeValue(vtkDICOMTag tag) const {
87  return this->Get(tag); }
88 
90 
95  const vtkDICOMValue &Get(int idx, vtkDICOMTag tag) const;
96  const vtkDICOMValue &GetAttributeValue(int idx, vtkDICOMTag tag) const {
97  return this->Get(idx, tag); }
98 
100 
105  vtkDICOMTag ResolvePrivateTag(vtkDICOMTag ptag, const std::string& creator);
106  vtkDICOMTag ResolvePrivateTag(
107  int idx, vtkDICOMTag ptag, const std::string& creator);
109 
111  const vtkDICOMMetaDataAdapter* operator->() const { return this; }
113  vtkDICOMMetaDataAdapter* operator->() { return this; }
115 
118 
119 protected:
122 
123 private:
124 
125  vtkDICOMMetaData *Meta;
126  const vtkDICOMValue *PerFrame;
127  const vtkDICOMValue *Shared;
128  vtkDICOMValue *NullValue;
129  int NumberOfInstances;
130  int MetaInstance;
131 };
132 
133 #endif /* vtkDICOMMetaDataAdapter_h */
134 // VTK-HeaderTest-Exclude: vtkDICOMMetaDataAdapter.h
An adapter to make multi-frame data look like multi-file data.
Definition: vtkDICOMMetaDataAdapter.h:33
vtkDICOMMetaDataAdapter(const vtkDICOMMetaDataAdapter &)
Copy constructor.
const vtkDICOMValue & Get(int idx, vtkDICOMTag tag) const
Get an attribute value for the specified file index.
void ConstructionHelper(vtkDICOMMetaData *meta, int i)
Helper function for the constructors. Set all members.
~vtkDICOMMetaDataAdapter()
Destructor release the reference to the meta data.
const vtkDICOMValue & Get(vtkDICOMTag tag) const
Get an attribute value.
vtkDICOMMetaDataAdapter & operator=(const vtkDICOMMetaDataAdapter &)
Copy constructor.
vtkDICOMTag ResolvePrivateTag(vtkDICOMTag ptag, const std::string &creator)
Resolve a private tag.
vtkDICOMMetaDataAdapter(vtkDICOMMetaData *meta)
Construct an adapter for the given meta data object.
bool Has(vtkDICOMTag tag) const
Check whether an attribute is present in the metadata.
vtkDICOMMetaDataAdapter(vtkDICOMMetaData *meta, int i)
Construct an adapter for one DICOM object instance.
int GetNumberOfInstances() const
Get the number of instances (i.e. files).
Definition: vtkDICOMMetaDataAdapter.h:66
A container class for DICOM metadata.
Definition: vtkDICOMMetaData.h:44
A (group,element) identifier tag for DICOM attributes.
Definition: vtkDICOMTag.h:23
A class to store attribute values for DICOM metadata.
Definition: vtkDICOMValue.h:51