/usr/include/vtkDICOMDataElement.h is in libvtk-dicom-dev 0.7.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | /*=========================================================================
Program: DICOM for VTK
Copyright (c) 2012-2015 David Gobbi
All rights reserved.
See Copyright.txt or http://dgobbi.github.io/bsd3.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef vtkDICOMDataElement_h
#define vtkDICOMDataElement_h
#include "vtkDICOMModule.h" // For export macro
#include "vtkDICOMTag.h"
#include "vtkDICOMValue.h"
//! A data element in a DICOM data set.
/*!
* The DataElement contains an encoded attribute value, along
* with the tag that identifies the attribute. The data elements
* in a vtkDICOMMetaData object can be per-instance, with a different
* value for each data set instance used to build the the meta data
* for the image series.
*/
class VTKDICOM_EXPORT vtkDICOMDataElement
{
public:
//@{
vtkDICOMDataElement() : Tag(), Value(), Next(0), Prev(0) {}
vtkDICOMDataElement(const vtkDICOMTag& t, const vtkDICOMValue &v) :
Tag(t), Value(v), Next(0), Prev(0) {}
//@}
//@{
//! Get the tag for this data element.
vtkDICOMTag GetTag() const { return this->Tag; }
//! Get the VR for this data element.
vtkDICOMVR GetVR() const { return this->Value.GetVR(); }
//@}
//@{
//! Check whether this data element carries per-instance values.
bool IsPerInstance() const { return (this->Value.GetMultiplexData() != 0); }
//! Get the number of value instances in this data element.
int GetNumberOfInstances() const { return this->Value.GetNumberOfValues(); }
//! Get the value of the data element, if not multi-valued.
const vtkDICOMValue& GetValue() const { return this->Value; }
//! Get value instance i, if the data element is multi-valued.
const vtkDICOMValue& GetValue(int i) const {
const vtkDICOMValue *vptr = this->Value.GetMultiplexData();
return (vptr == 0 ? this->Value : vptr[i]); }
//@}
//@{
bool operator==(const vtkDICOMDataElement& o) const {
return (this->Tag == o.Tag && this->Value == o.Value); }
bool operator!=(const vtkDICOMDataElement& o) const {
return (this->Tag != o.Tag || this->Value != o.Value); }
//@}
private:
vtkDICOMTag Tag;
vtkDICOMValue Value;
// for storing elements in a linked list
vtkDICOMDataElement *Next;
vtkDICOMDataElement *Prev;
// the classes that need to manipulate lists of elements
friend class vtkDICOMDataElementIterator;
friend class vtkDICOMMetaData;
friend class vtkDICOMItem;
};
//! A const iterator for a vtkDataElement list.
class VTKDICOM_EXPORT vtkDICOMDataElementIterator
{
public:
//@{
vtkDICOMDataElementIterator() : Pointer(0) {}
//@}
//@{
vtkDICOMDataElementIterator& operator++() {
if (this->Pointer) { this->Pointer = this->Pointer->Next; }
return *this; }
vtkDICOMDataElementIterator operator++(int) {
const vtkDICOMDataElement *ptr = this->Pointer;
if (ptr) { this->Pointer = this->Pointer->Next; }
return vtkDICOMDataElementIterator(ptr); }
vtkDICOMDataElementIterator& operator--() {
if (this->Pointer) { this->Pointer = this->Pointer->Prev; }
return *this; }
vtkDICOMDataElementIterator operator--(int) {
const vtkDICOMDataElement *ptr = this->Pointer;
if (ptr) { this->Pointer = this->Pointer->Prev; }
return vtkDICOMDataElementIterator(ptr); }
//@}
//@{
const vtkDICOMDataElement *operator->() const { return this->Pointer; }
const vtkDICOMDataElement& operator*() const { return *this->Pointer; }
//@}
//@{
bool operator==(const vtkDICOMDataElementIterator& it) const {
return (this->Pointer == it.Pointer); }
bool operator!=(const vtkDICOMDataElementIterator& it) const {
return (this->Pointer != it.Pointer); }
//@}
private:
vtkDICOMDataElementIterator(const vtkDICOMDataElement *ptr) {
this->Pointer = ptr; }
const vtkDICOMDataElement *Pointer;
friend class vtkDICOMMetaData;
friend class vtkDICOMItem;
};
VTKDICOM_EXPORT ostream& operator<<(ostream& os, const vtkDICOMDataElement& v);
#endif /* vtkDICOMDataElement_h */
// VTK-HeaderTest-Exclude: vtkDICOMDataElement.h
|