This file is indexed.

/usr/include/dcmtk/dcmfg/fgrealworldvaluemapping.h is in libdcmtk-dev 3.6.2-3build3.

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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
/*
 *
 *  Copyright (C) 2015-2017, Open Connections GmbH
 *  All rights reserved.  See COPYRIGHT file for details.
 *
 *  This software and supporting documentation are maintained by
 *
 *    OFFIS e.V.
 *    R&D Division Health
 *    Escherweg 2
 *    D-26121 Oldenburg, Germany
 *
 *
 *  Module:  dcmfg
 *
 *  Author:  Michael Onken
 *
 *  Purpose: Class for managing Real World Value Mapping Functional Group
 *
 */

#ifndef FGREALWORLDVALUEMAPPING_H
#define FGREALWORLDVALUEMAPPING_H

#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmfg/fgbase.h"
#include "dcmtk/dcmdata/dcitem.h"
#include "dcmtk/dcmiod/modbase.h"
#include "dcmtk/dcmiod/iodmacro.h"
#include "dcmtk/dcmiod/iodcontentitemmacro.h"

/** Class representing the Real World Value Mapping Functional Group that
 *  specifies the mapping of stored values to associated Real World values
 */
class DCMTK_DCMFG_EXPORT FGRealWorldValueMapping: public FGBase
{
public:

  // Forward declaration
  class RWVMItem;

  /** Constructor, creates empty functional group
   */
  FGRealWorldValueMapping();

  /** Destructor, frees memory
   */
  virtual ~FGRealWorldValueMapping();

  /** Returns a deep copy of this object
   *  @return  Deep copy of this object
   */
  virtual FGBase *clone() const;

  /** Returns that this functional group can be used as both, shared
   *  and per-frame
   *  @returns Always returns DcmFGTypes::EFGS_BOTH
   */
  virtual DcmFGTypes::E_FGSharedType getSharedType() const {return DcmFGTypes::EFGS_BOTH;}

  /** Clear all data
   */
  virtual void clearData();

  /** Check whether data of functional group is valid
   *  @return EC_Normal if data is valid, error otherwise
   */
  virtual OFCondition check() const;

  /** Read functional group from item, must contain the Real World Value Mapping
   *  Sequence
   *  @param  item The item to read from
   *  @return EC_Normal if reading was successful, error otherwise
   */
  virtual OFCondition read(DcmItem& item);

  /** Writes this functional group to item, i.e.\ will write the Real World Value
   *  Mapping Sequence
   *  @param  item The item to read from
   *  @return EC_Normal if reading was successful, error otherwise
   */
  virtual OFCondition write(DcmItem& item);

  // --- get() functionality ---

  /** Return references to the various items inside the Real World Value Mapping
   *  Sequence
   *  @return Reference to Real World Value Mapping Sequence items
   */
  virtual OFVector< RWVMItem* >& getRealWorldValueMapping();

  /** Comparison operator that compares the normalized value of this object
   *  with a given object of the same type, i.e.\ the elements within both
   *  functional groups (this and rhs parameter) are compared by value!
   *  Both objects (this and rhs) need to have the same type (i.e.\ both
   *  FGUnknown) to be comparable. This function is used in order
   *  to decide whether a functional group already exists, or is new. This
   *  is used in particular to find out whether a given functional group
   *  can be shared (i.e.\ the same information already exists as shared
   *  functional group) or is different from the same shared group. In that
   *  case the shared functional group must be distributed into per-frame
   *  functional groups, instead. The exact implementation for implementing
   *  the comparison is not relevant. However, it must be a comparison
   *  by value.
   *  @param  rhs the right hand side of the comparison
   *  @return 0 if the object values are equal.
   *          -1 if either the value of the first component that does not match
   *          is lower in the this object, or all compared components match
   *          but this component is shorter. Also returned if this type and
   *          rhs type (DcmFGTypes::E_FGType) do not match.
   *          1 if either the value of the first component that does not match
   *          is greater in this object, or all compared components match
   *          but this component is longer.
   */
  virtual int compare(const FGBase& rhs) const;

private:

  /* Content of Real World Value Mapping Macro */

  /// Items (1-n) of Real World Value Mapping Sequence
  OFVector<RWVMItem*> m_Items;
};

/** Class representing the Real World Value Mapping Item Macro:
 * Attribute name: (VR, VM, Requirement Type)
 * Real World Value First Value Mapped: (US or SS, 1, 1)
 * Real World Value Last Value Mapped: (US or SS, 1, 1)
 * Real World Value Intercept: (FD, 1, 1C)
 * Real World Value Slope: (FD, 1, 1C)
 * Real World Value LUT Data (FD, 1-n, 1C)
 * LUT Explanation (LO, 1, 1)
 * LUT Label (SH, 1, 1)
 * Measurement Units Code Sequence (SQ, 1, 1)
 * Quantity Definition Sequence (SQ, 1, 3)
 */
class DCMTK_DCMFG_EXPORT FGRealWorldValueMapping::RWVMItem : public IODComponent
{
public:

  /** Constructor
   *  @param  item The item to be used for data storage. If NULL, the
   *          class creates an empty data container.
   *  @param  rules The rule set for this class. If NULL, the class creates
   *          one from scratch and adds its values.
   *  @param  parent The parent of the IOD component (NULL if none or unknown)
   */
  RWVMItem(OFshared_ptr<DcmItem> item,
           OFshared_ptr<IODRules> rules,
           IODComponent* parent = NULL);

  /** Constructor
   *  @param  parent The parent of the IOD component (NULL if none or unknown)
   */
  RWVMItem(IODComponent* parent = NULL);

  /** Copy Constructor
   *  @param  rhs The item to copy from
   */
  RWVMItem(const RWVMItem& rhs);

  /** Clone this class (perform deep copy)
   *  @return Clone of this class or NULL (e.g.\ if memory exhausted)
   */
  RWVMItem* clone();

  /** Virtual destructor, frees memory
   */
  virtual ~RWVMItem();

  /** Resets rules to their original values
   */
  virtual void resetRules();

  /** Get name of component
   *  @return Name of the module
   */
  virtual OFString getName() const;

  /** Comparison operator that compares the normalized value of this object
   *  with a given object of the same type, i.e.\ the elements within both
   *  functional groups (this and rhs parameter) are compared by value!
   *  Both objects (this and rhs) need to have the same type (i.e.\ both
   *  FGUnknown) to be comparable. This function is used in order
   *  to decide whether a functional group already exists, or is new. This
   *  is used in particular to find out whether a given functional group
   *  can be shared (i.e.\ the same information already exists as shared
   *  functional group) or is different from the same shared group. In that
   *  case the shared functional group must be distributed into per-frame
   *  functional groups, instead. The exact implementation for implementing
   *  the comparison is not relevant. However, it must be a comparison
   *  by value.
   *  @param  rhs the right hand side of the comparison
   *  @return 0 if the object values are equal.
   *          -1 if either the value of the first component that does not match
   *          is lower in the this object, or all compared components match
   *          but this component is shorter. Also returned if this type and
   *          rhs type (DcmFGTypes::E_FGType) do not match.
   *          1 if either the value of the first component that does not match
   *          is greater in this object, or all compared components match
   *          but this component is longer.
   */
  virtual int compare(const IODComponent& rhs) const;

  /** Read attributes from given item into this class
   *  @param source  The source to read from
   *  @param clearOldData If OFTrue, old data is cleared before reading.
   *         Otherwise old data is overwritten (or amended)
   *  @result EC_Normal if reading was successful, error otherwise
   */
  virtual OFCondition read(DcmItem& source,
                           const OFBool clearOldData = OFTrue);

  /** Write attributes from this class into given item
   *  @param  destination The item to write to
   *  @result EC_Normal if writing was successful, error otherwise
   */
  virtual OFCondition write(DcmItem& destination);

  // --- get() functionality ---

  /** Get Real World Value First Value Mapped
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1)
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getRealWorldValueFirstValueMapped(Sint32& value,
                                                        const unsigned long pos = 0) const;

  /** Get Real World Value First Value Mapped
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1)
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getRealWorldValueLastValueMapped(Sint32 &value,
                                                       const unsigned long pos = 0) const;

  /** Get Double Float Real World Value First Value Mapped
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1)
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getDoubleFloatRealWorldValueFirstValueMapped(Float64& value,
                                                                   const unsigned long pos = 0) const;

  /** Get Double Float Real World Value Last Value Mapped
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1)
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getDoubleFloatRealWorldValueLastValueMapped(Float64& value,
                                                                   const unsigned long pos = 0) const;

  /** Get Real World Value LUT Data
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1)
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getRealWorldValueLUTData(Float64 &value,
                                               const unsigned long pos = 0) const;

  /** Get Real World Value LUT Data
   *  @param  values Reference to variable in which the values should be stored
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getRealWorldValueLUTData(OFVector<Float64>& values) const;

  /** Get LUT Explanation
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1)
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getLUTExplanation(OFString &value,
                                        const signed long pos = 0) const;

  /** Get LUT Label
   *  @param  value Reference to variable in which the value should be stored
   *  @param  pos Index of the value to get (0..vm-1)
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition getLUTLabel(OFString &value,
                                  const signed long pos = 0) const;

  /** Get Measurement Units Code Sequence (content)
   *  @return Reference to Measurement Units Code
   */
  virtual CodeSequenceMacro& getMeasurementUnitsCode();

  /** Get a reference to the entire ConceptNameCodeSequence, including items
   *  exceeding the value multiplicity restriction of "1"
   *  @return a reference to the entire ConceptNameCodeSequence
   */
  virtual OFVector<ContentItemMacro*>& getEntireQuantityDefinitionSequence();

  // --- set() functionality ---

  /** Set Real World Value First Value Mapped
   *  @param  value Value to be set. If Pixel Representation is 0 (unsigned
   *          pixel data) value  must be 0 < value < 2^16. Otherwise use
   *          setRealWorldValueFirstValueMappedSigned().
   *  @param  checkValue Check 'value' for conformance with VR (US and VM (1)
   *          if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRealWorldValueFirstValueMappedUnsigned(const Uint16 value,
                                                                const OFBool checkValue = OFTrue);

  /** Set Real World Value First Value Mapped
   *  @param  value Value to be set. If Pixel Representation is -1 (signed
   *          pixel data) value  must be -2^15  < value < 2^15-1. Otherwise use
   *          setRealWorldValueFirstValueMappedUnsigned().
   *  @param  checkValue Check 'value'. Not evaluated (here for consistency
   *          with other setter functions).
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRealWorldValueFirstValueMappedSigned(const Sint16 &value,
                                                              const OFBool checkValue = OFTrue);

  /** Set Real World Value Last Value Mapped
   *  @param  value Value to be set. If Pixel Representation is 0 (unsigned
   *          pixel data) value  must be 0 < value < 2^16. Otherwise use
   *          setRealWorldValueLastValueMappedSigned().
   *  @param  checkValue Check 'value' for conformance with VR (US and VM (1)
   *          if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRealWorldValueLastValueMappedUnsigned(const Uint16 value,
                                                               const OFBool checkValue = OFTrue);

  /** Set Real World Value Last Value Mapped
   *  @param  value Value to be set. If Pixel Representation is -1 (signed
   *          pixel data) value  must be -2^15  < value < 2^15-1. Otherwise use
   *          setRealWorldValueLastValueMappedUnsigned().
   *  @param  checkValue Check 'value'. Not evaluated (here for consistency
   *          with other setter functions).
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRealWorldValueLastValueMappedSigned(const Sint16 &value,
                                                             const OFBool checkValue = OFTrue);

  /** Set Double Float Real World Value First Value Mapped
   *  @param  value Value to be set
   *  @param  checkValue Check 'value'. Does nothing, only for consistency with
   *          other set() functions.
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setDoubleFloatRealWorldValueFirstValueMapped(const Float64 value,
                                                                  const OFBool checkValue = OFTrue);

  /** Set Double Float Real World Value Last Value Mapped
   *  @param  value Value to be set
   *  @param  checkValue Check 'value'. Does nothing, only for consistency with
   *          other set() functions.
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setDoubleFloatRealWorldValueLastValueMapped(const Float64 value,
                                                                  const OFBool checkValue = OFTrue);

  /** Set Real World Value Intercept
   *  @param  value Value to be set
   *  @param  checkValue Check 'value'. Not evaluated (here for consistency
   *          with other setter functions).
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRealWorldValueIntercept(const Float64 value,
                                                 const OFBool checkValue = OFTrue);

  /** Set Real World Value Slope
   *  @param  value Value to be set
   *  @param  checkValue Check 'value'. Not evaluated (here for consistency
   *          with other setter functions).
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRealWorldValueSlope(const Float64 value,
                                             const OFBool checkValue = OFTrue);

  /** Set Real World Value LUT Data
   *  @param  value Values to be set
   *  @param  checkValue Check 'value' for conformance with VR (FD) and VM (1-n) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setRealWorldValueLUTData(const OFVector<Float64>& value,
                                               const OFBool checkValue = OFTrue);

  /** Set LUT Explanation
   *  @param  value Value to be set
   *  @param  checkValue Check 'value' for conformance with VR (LO) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setLUTExplanation(const OFString &value,
                                        const OFBool checkValue = OFTrue);

  /** Set LUT Label
   *  @param  value Value to be set
   *  @param  checkValue Check 'value' for conformance with VR (SH) and VM (1) if enabled
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition setLUTLabel(const OFString &value,
                                  const OFBool checkValue = OFTrue);

protected:

  static OFCondition getUSorSS(DcmItem& item,
                               const DcmTagKey& key,
                               const unsigned long pos,
                               Sint32& value);

private:

  /// The name of this module ("RealWorldValueMappingItemMacro")
  static const OFString m_ModuleName;

  /// Measurement Units Code Sequence
  CodeSequenceMacro m_MeasurementUnitsCode;

  /// Quantity Definition Sequence
  OFVector<ContentItemMacro*> m_QuantityDefinitionSequence;
};

#endif // FGREALWORLDVALUEMAPPING_H