14 #ifndef vtkDICOMItem_h
15 #define vtkDICOMItem_h
17 #include "vtkDICOMModule.h"
18 #include "vtkDICOMDataElement.h"
19 #include "vtkDICOMDictEntry.h"
20 #include "vtkDICOMReferenceCount.h"
43 int NumberOfDataElements;
45 unsigned int ByteOffset;
50 List() : Head(), Tail(), ReferenceCount(1),
51 NumberOfDataElements(0), DataElements(
nullptr),
52 ByteOffset(0), Delimited(
false),
53 CharacterSet(vtkDICOMCharacterSet::ISO_IR_6),
81 int delimited=0,
unsigned int byteOffset=0);
85 if (this->L) { ++(this->L->ReferenceCount); } }
94 if (this->L && --(this->L->ReferenceCount) == 0) { this->FreeList(); }
95 else { this->L =
nullptr; } }
98 bool IsEmpty()
const {
return (this->L ==
nullptr); }
102 return (this->L ==
nullptr || this->L->Delimited != 0); }
116 void SetAttributeValue(
vtkDICOMTag tag,
double v) {
118 void SetAttributeValue(
vtkDICOMTag tag,
const std::string& v) {
137 void SetAttributeValue(
const vtkDICOMTagPath& tag,
const std::string& v) {
146 return this->Get(tag); }
148 return this->Get(tag); }
159 return (this->L ==
nullptr ? 0 : this->L->ByteOffset); }
163 int GetNumberOfDataElements()
const {
165 return (this->L ? this->L->NumberOfDataElements : 0); }
169 return (this->L ? this->L->Head.Next :
nullptr); }
173 return (this->L ? &this->L->Tail :
nullptr); }
188 vtkDICOMTag ptag,
const std::string& creator)
const;
218 return !(*
this == o); }
224 if (this->L != o.L) {
225 if (o.L) { ++(o.L->ReferenceCount); }
226 if (this->L && --(this->L->ReferenceCount) == 0) { this->FreeList(); }
234 static void CopyList(
const List *o, List *t);
235 static void CopyDataElements(
Character sets.
Definition: vtkDICOMCharacterSet.h:55
A const iterator for a vtkDataElement list.
Definition: vtkDICOMDataElement.h:88
A data element in a DICOM data set.
Definition: vtkDICOMDataElement.h:30
An entry in the DICOM dictionary.
Definition: vtkDICOMDictEntry.h:24
An item in a DICOM sequence (type SQ).
Definition: vtkDICOMItem.h:34
vtkDICOMItem(const vtkDICOMItem &o)
Copy constructor does reference counting.
Definition: vtkDICOMItem.h:84
vtkDICOMVR FindDictVR(vtkDICOMTag tag) const
Use the dictionary to get the VR, returns UN on failure.
vtkDICOMDictEntry FindDictEntry(vtkDICOMTag tag) const
Look up a tag in the DICOM dictionary.
vtkDICOMDataElementIterator End() const
Get an end iterator for the list of data elements.
Definition: vtkDICOMItem.h:172
vtkDICOMTag ResolvePrivateTagForWriting(vtkDICOMTag ptag, const std::string &creator)
Resolve a private tag, and add the creator to the data set.
bool IsEmpty() const
Check if empty.
Definition: vtkDICOMItem.h:98
vtkDICOMDataElementIterator Begin() const
Get an iterator for the list of data elements.
Definition: vtkDICOMItem.h:168
vtkDICOMItem(vtkDICOMCharacterSet cs, vtkDICOMVR vrForXS, int delimited=0, unsigned int byteOffset=0)
Constructor with flag for delimitation and offset.
vtkDICOMItem(vtkDICOMMetaData *meta)
Constructor that takes certain properties from the data set.
bool IsDelimited() const
Check if this was read as a delimited item.
Definition: vtkDICOMItem.h:101
vtkDICOMTag ResolvePrivateTag(vtkDICOMTag ptag, const std::string &creator) const
Resolve a private tag, or return (ffff,ffff) if not resolved.
unsigned int GetByteOffset() const
Get the offset of this item from the beginning of the file.
Definition: vtkDICOMItem.h:158
void Set(vtkDICOMTag tag, const vtkDICOMValue &v)
Add a data element to this item.
void Set(const vtkDICOMTagPath &tag, const vtkDICOMValue &v)
Add a data element at the specified path.
~vtkDICOMItem()
Destructor does reference counting.
Definition: vtkDICOMItem.h:88
An object for holding an atomic reference count.
Definition: vtkDICOMReferenceCount.h:27
A tag path for digging values out of sequence items.
Definition: vtkDICOMTagPath.h:27
A (group,element) identifier tag for DICOM attributes.
Definition: vtkDICOMTag.h:23
VRs (Value Representations)
Definition: vtkDICOMVR.h:22
@ US
Unsigned Short.
Definition: vtkDICOMVR.h:60
A class to store attribute values for DICOM metadata.
Definition: vtkDICOMValue.h:51