This file is indexed.

/usr/include/dcmtk/dcmpmap/dpmparametricmapiod.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
/*
 *
 *  Copyright (C) 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: dcmpmap
 *
 *  Author: Michael Onken
 *
 *  Purpose: Class representing the Parametric Map IOD
 *
 */

#ifndef DPMPARAMETRICMAPIOD_H
#define DPMPARAMETRICMAPIOD_H

#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmiod/modimagepixelbase.h"
#include "dcmtk/dcmpmap/dpmparametricmapbase.h"
#include "dcmtk/dcmpmap/dpmtypes.h"


/** Class for managing the Parametric Map IOD attributes.
 */
class DCMTK_DCMPMAP_EXPORT DPMParametricMapIOD : public DPMParametricMapBase
{
public:

  /** Inner class that offers typed interface to bulk data.
   */
  template<typename PixelType>
  class DCMTK_DCMPMAP_EXPORT Frames
  {
    public:

      /// Binary pixel type
      typedef PixelType pixel_type;

      /** Method that adds a frame to the Parametric Map using the underlying
       *  binary data type.
       *  @param  data The frame data
       *  @param  numPixels The number of pixels (rows * columns) of the frame
       *  @param  perFrameInformation The per-frame functional groups applying for
       *  @return EC_Normal if adding was successful, error otherwise
       */
      OFCondition addFrame(PixelType* data,
                           const size_t numPixels,
                           const OFVector<FGBase*>& perFrameInformation);

      /** Type-specific getFrame() method that returns Float32, Uint16, or whatever
       *  is used in this Parametric Map.
       *  @param  frameNumber The frame number to get, starting from 0
       *  @return Pointer to typed pixel data
       */
      PixelType* getFrame(const size_t frameNumber);

    private:

      // Make sure the Parametric Map object (and no one else) can use the constructor below.
      friend class DPMParametricMapIOD;

      /** Create Frames object in DPMParametricMapIOD (see friend declaration above)
       *  @param  map The map object that will contain the frames
       */
      Frames(DPMParametricMapIOD& map);

      /// Reference to Parametric Map object in order to access its pixel data
      DPMParametricMapIOD& m_Map;
  };

  /** Frames can contain Uint16, Sint16, Float32 or Float64 data, or nothing
   *  at all (in that case OFCondition denotes a corresponding error)
   */
  typedef OFvariant
  <
    OFCondition,
    Frames<Uint16>,
    Frames<Sint16>,
    Frames<Float32>,
    Frames<Float64>
  > FramesType;

  /** Virtual Destructor, frees memory.
   */
  virtual ~DPMParametricMapIOD();

  /** Create new Parametric Map object. Takes the minimum of required parameters.
   *  Afterwards, additional setters() can be used to set optional data. Frames
   *  and their related per-frame functional groups should be added using addFrame().
   *  Shared functional groups should be added using addForAllFrames().
   *  @param  modality The modality of this Parametric Map (series level attribute).
   *          A list of Defined Terms can be found in the standard. Very often
   *          "MR" is the right choice. Only if a mix of different modalities has been
   *          use for creation "OT" should be used.
   *  @param  seriesNumber A number identifying this series. If importPatientStudyFor()
   *          is called later in order to put this Parametric Map into an existing Series,
   *          the Series  Number will be taken over from the existing series instead.
   *  @param  instanceNumber A number identifying this image
   *  @param  rows The number of rows of all frames of the Parametric Map
   *  @param  columns The number of columns of all frames of the Parametric Map
   *  @param  equipmentInfo Information about the equipment creating thing Parametric Map
   *  @param  contentIdentification General information about this content
   *  @param  imageFlavor 3rd value of attribute Image Type. See standard for list of
   *          applicable Defined Terms.
   *  @param  derivedPixelContrast 4th value of attribute Image Type. See standard for list of
   *          applicable Defined Terms.
   *  @param  contentQualification Either one of CQ_PRODUCT, CQ_RESEARCH, CQ_SERVICE
   *  @return Variant, either OFCondition with error code in case of error, Parametric
   *          Map object in case of success
   */
  template<typename ImagePixel>
  static OFvariant<OFCondition,DPMParametricMapIOD> create(const OFString& modality,
                                                           const OFString& seriesNumber,
                                                           const OFString& instanceNumber,
                                                           const Uint16 rows,
                                                           const Uint16 columns,
                                                           const IODEnhGeneralEquipmentModule::EquipmentInfo& equipmentInfo,
                                                           const ContentIdentificationMacro& contentIdentification,
                                                           const OFString& imageFlavor,
                                                           const OFString& derivedPixelContrast,
                                                           const DPMTypes::ContentQualification& contentQualification);

  /** Indicates whether or not the image contains sufficiently recognizable visual
   *  features to allow the image or a reconstruction from a set of images to
   *  identify the patient.
   *  @param  yesOrNo  Must be related "YES" or "NO" types
   *  @return EC_Normal if setting was successful, error otherwise
   */

  virtual OFCondition setRecognizableVisualFeatures(const DPMTypes::RecognizableVisibleFeatures yesOrNo);

  /** Add a functional group for all frames
   *  @param  group The group to be added as shared functional group
   *  @return EC_Normal if adding was successful, error otherwise
   */
  virtual OFCondition addForAllFrames(const FGBase& group);

  // -------------------- loading and saving ---------------------

  /** Load Parametric Map object from file
   *  @param  filename The file to read from
   *  @return Variant, either the resulting Parametric Map object in case of success,
   *          an OFCondition error code otherwise
   */
  static OFvariant<OFCondition,DPMParametricMapIOD*> loadFile(const OFString& filename);

  /** Load Parametric Map object from dataset object.
   *  @param  dataset The dataset to read from
   *  @return Variant, either the resulting Parametric Map object in case of success,
   *          an OFCondition error code otherwise
   */
  static OFvariant<OFCondition,DPMParametricMapIOD*> loadDataset(DcmDataset& dataset);

  /** Read Parametric Map attributes (all those handled by this class)
   *  from given item. Reads attributes from base class DcmIODCommon before.
   *  The current content is deleted even if the reading process fails.
   *  If the log stream is set and valid the reason for any error might be
   *  obtained from the error/warning output.
   *  @param  dataset  Reference to DICOM dataset from which the document
   *          should be read
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition read(DcmItem &dataset);

  /** Write current Parametric Map's attributes to DICOM dataset.
   *  @param  dataset Reference to DICOM dataset to which the current document
   *          should be written. The dataset is not cleared before writing
   *          to it!
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition write(DcmItem &dataset);

  // -------------------- access ---------------------

  /** Get Recognizable Visual Features
   *  @return Returns related YES or NO data type
   */
  virtual DPMTypes::RecognizableVisibleFeatures getRecognizableVisualFeatures();

  /** Get Content Qualification
   *  @return Returns either one of CQ_PRODUCT, CQ_RESEARCH, CQ_SERVICE or CQ_UNKNOWN
   */
  virtual DPMTypes::ContentQualification getContentQualification();

  /** Get number of rows
   *  @param  rows The number of rows (output)
   *  @return EC_Normal if getting was successful, error otherwise
   */
  virtual OFCondition getRows(Uint16& rows);

  /** Get number of cols
   *  @param  cols The number of columns (output)
   *  @return EC_Normal if getting was successful, error otherwise
   */
  virtual OFCondition getColumns(Uint16& cols);

  /** Perform some basic checking. This method is also invoked when
   *  writing the object to a DICOM dataset or file.
   *  @return OFTrue, if no errors were found, OFFalse otherwise.
   */
  virtual OFBool check();

  /** Get number of frames, based on the number of items in the shared
   *  functional functional groups sequence (i.e.\ the attribute Number of
   *  Frames) is not trusted after reading
   *  @return The number of frames handled by this object
   */
  size_t getNumberOfFrames() const;

  /** Get access to frame data
   *  @return Class managing the frame data
   */
  FramesType getFrames();

protected:

  /** Write current generic Parametric Map's attributes to DICOM dataset, i.e.
   *  those that are not directly pixel-related
   *  @param  dataset Reference to DICOM dataset to which the current document
   *          should be written. The dataset is not cleared before writing
   *          to it.
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition writeGeneric(DcmItem &dataset);

  /** Read Parametric Map's generic (not directly pixel-data related) attributes from
   *  DICOM dataset.
   *  @param  dataset Reference to DICOM dataset to read from.
   *  @return EC_Normal if successful, an error code otherwise
   */
  virtual OFCondition readGeneric(DcmItem &dataset);

  /** Decompress the given dataset if required. Only RLE compression is accepted
   *  and decompressed by this tool. A warning is printed if the dataset has been compressed
   *  before with another compression scheme and is handed into this method in uncompressed
   *  format. Handing in any other compression but RLE will lead to an error.
   *  @param  dset The dataset to be decompressed
   *  @return EC_Normal if decompression worked (or dataset is already in uncompressed format)
   *          IOD_EC_CannotDecompress otherwise
   */
  static OFCondition decompress(DcmDataset& dset);

  /** Constructor
   */
  DPMParametricMapIOD();

  /** Constructor, anonymous parameter is the image pixel module to be used
   */
  template<typename ImagePixel>
  DPMParametricMapIOD(OFin_place_type_t(ImagePixel));

private:

  // Forward declarations
  template<typename PixelType> class GetPixelDataVisitor;
  struct SetImagePixelModuleVisitor;
  struct WriteVisitor;
  struct GetFramesVisitor;
  struct ReadVisitor;
  struct ReadFramesVisitor;

  /** Initialize new Parametric Map object except directly pixel-related data
   *  @param  modality The modality of this Parametric Map (series level attribute).
   *          A list of Defined Terms can be found in the standard. Very often
   *          "MR" is the right choice. Only if a mix of different modalities has been
   *          use for creation "OT" should be used.
   *  @param  seriesNumber A number identifying this series. If importPatientStudyFor()
   *          is called later in order to put this Parametric Map into an existing Series,
   *          the Series  Number will be taken over from the existing series instead.
   *  @param  instanceNumber A number identifying this image
   *  @param  equipmentInfo Information about the equipment creating thing Parametric Map
   *  @param  contentIdentification General information about this content
   *  @param  imageFlavor 3rd value of attribute Image Type. See standard for list of
   *          applicable Defined Terms.
   *  @param  derivedPixelContrast 4th value of attribute Image Type. See standard for list of
   *          applicable Defined Terms.
   *  @param  contentQualification Either one of CQ_PRODUCT, CQ_RESEARCH, CQ_SERVICE
   *  @return EC_Normal in case of success, error otherwise
   */
  OFCondition init(const OFString& modality,
                   const OFString& seriesNumber,
                   const OFString& instanceNumber,
                   const IODEnhGeneralEquipmentModule::EquipmentInfo& equipmentInfo,
                   const ContentIdentificationMacro& contentIdentification,
                   const OFString& imageFlavor,
                   const OFString& derivedPixelContrast,
                   const DPMTypes::ContentQualification& contentQualification);


  /// Parametric Map Image Module's Content Identification
  ContentIdentificationMacro m_ContentIdentification;

  /// Binary frame data
  OFVector<DcmIODTypes::Frame*> m_Frames;

};

#endif // DPMPARAMETRICMAPIOD_H