/usr/include/dcmtk/dcmtract/trcstatistic.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 | /*
*
* Copyright (C) 2016-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: dcmtract
*
* Author: Michael Onken
*
* Purpose: Statistics from a Tractography Results IOD
*
*/
#ifndef TRCSTATISTIC_H
#define TRCSTATISTIC_H
#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmiod/modbase.h"
#include "dcmtk/dcmiod/iodutil.h"
#include "dcmtk/dcmiod/iodmacro.h"
#include "dcmtk/dcmtract/trctypes.h"
// Forward declarations
class CodeSequenceMacro;
/** Base class representing a statistic within the "Tractography Results" IOD. A
* statistic is of a certain type and applies to a specific region of interest.
* For each Track Set and for each track there may be one or more statistics
* defined. The specializations can be found in classes TrcTracksStatistic and
* TrcTrackSetStatistic.
*/
class DCMTK_DCMTRACT_EXPORT TrcStatistic
: public IODComponent
{
public:
// Allow read/write functions in DcmIODUtil to access class internals
friend class DcmIODUtil;
/** Constructor
*/
TrcStatistic();
/** Destructor, frees memory
*/
virtual ~TrcStatistic();
/** Clears all data
*/
virtual void clearData();
/** 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 descriptive information of statistic
* @param typeCode Returns type of statistic
* @param typeModifierCode Returns region of interest
* @param unitsCode Returns physical units of the statistic value
* @return EC_Normal if getting was successful, error otherwise.
*/
virtual OFCondition get(CodeSequenceMacro& typeCode,
CodeSequenceMacro& typeModifierCode,
CodeSequenceMacro& unitsCode);
/** Resets rules to their original values
*/
virtual void resetRules();
protected:
/** Set descriptive information of statistic
* @param typeCode The type of statistic, DICOM prescribes codes from
* CID 7263 "Diffusion Tractography Measurement Types"
* @param typeModifierCode Defines the region of interest, DICOM prescribes
* code from CID 7464 "General Region of Interest Measurement
* Modifiers"
* @param unitsCode The physical units of the statistic value, DICOM
* prescribes code from CID 82 "Units of Measurement" (UCUM).
* @return EC_Normal if setting was successful, error otherwise.
*/
virtual OFCondition setCommon(const CodeSequenceMacro& typeCode,
const CodeSequenceMacro& typeModifierCode,
const CodeSequenceMacro& unitsCode);
/// Single item from Concept Name Code Sequence
CodeSequenceMacro m_Type;
/// Single item from Modifier Code Sequence
CodeSequenceMacro m_TypeModifier;
/// Single item from Unit Code Sequence
CodeSequenceMacro m_Units;
/// Floating Point Value(s), one for each Track in Track Set (for Track
/// Statistic), or a single value in case of Track Set Statistic
OFVector<Float32*> m_Values;
};
/** Class representing a statistic for Tracks in Track Set. Besides describing
* information like type of statistic, region o interest and units of the
* statistic values, the statistic defines a single statistic value for each
* track. Thus the number of statistic values must be identical to the number
* of tracks in the containing Track Set.
*/
class TrcTracksStatistic : public TrcStatistic
{
public:
/** Constructor
*/
TrcTracksStatistic();
/** Destructor, frees memory
*/
~TrcTracksStatistic();
/** Create track statistic by providing the required information
* @param typeCode The value for which the statistic is a summary. DICOM
* prescribes code from CID 7263 "Diffusion Tractography Measurement
* Types"
* @param typeModifierCode The region of interest of the statistic. DICOM
* prescribes code from CID 7464 "General Region of Interest
* Measurement Modifiers"
* @param unitsCode The physical units of the statistic value. DICOM
* prescribes code from CID 82 "Units of Measurement".
* @param statisticValues The statistic values
* @param numValues The number of statistic values in statisticValues, must
* be equal to number of Tracks in the Track Set that this statistic
* applies to
* @param statistic Returns the resulting TrcTracksStatistic object (NULL
* in case of any error)
* @return EC_Normal if creation was successful, error otherwise
*/
static OFCondition create(const CodeSequenceMacro& typeCode,
const CodeSequenceMacro& typeModifierCode,
const CodeSequenceMacro& unitsCode,
const Float32* statisticValues,
const size_t numValues,
TrcTracksStatistic*& statistic /* result */);
/** 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);
/** Resets rules to their original values
*/
virtual void resetRules();
/** Get name of component
* @return Name of the module ("TrackStatisticsSequenceItem")
*/
virtual OFString getName() const;
/** Set Track statistic
* @param typeCode The value for which the statistic is a summary. DICOM
* prescribes code from CID 7263 "Diffusion Tractography Measurement
* Types"
* @param typeModifierCode The region of interest of the statistic. DICOM
* prescribes code from CID 7464 "General Region of Interest
* Measurement Modifiers"
* @param unitsCode The physical units of the statistic value. DICOM
* prescribes code from CID 82 "Units of Measurement".
* @param statisticValues The statistic values
* @param numValues The number of statistic values in statisticValues, must
* equal the number of tracks in containing Track Set
* @return EC_Normal if setting was successful, error otherwise
*/
virtual OFCondition set(const CodeSequenceMacro& typeCode,
const CodeSequenceMacro& typeModifierCode,
const CodeSequenceMacro& unitsCode,
const Float32* statisticValues,
const size_t numValues);
/** Get Track statistic information
* @param typeCode Returns value for which the statistic is a summary.
* @param typeModifierCode Returns region of interest of the statistic.
* @param unitsCode Returns physical units of the statistic value.
* @param statisticValues Returns statistic values
* @param numValues Returns number of statistic values in statisticValues,
* should be equal to number of tracks in containing Track Set
* @return EC_Normal if data could be retrieved, error otherwise
*/
virtual OFCondition get(CodeSequenceMacro& typeCode,
CodeSequenceMacro& typeModifierCode,
CodeSequenceMacro& unitsCode,
const Float32*& statisticValues,
unsigned long& numValues);
// Make sure the original virtual get() function from TrcStatistic
// stays visible
using TrcStatistic::get;
};
/** Class representing a Track Set statistic, i.e. a single statistic value that
* is amended by information about type of statistic, region of interest it as
* well as physical unit of the value. A Track Set can define 0 or more
* statistics.
*/
class TrcTrackSetStatistic : public TrcStatistic
{
public:
/** Constructor
*/
TrcTrackSetStatistic();
/** Destructor, frees memory
*/
virtual ~TrcTrackSetStatistic();
/** Create track statistic by providing the required information
* @param typeCode The value for which the statistic is a summary. DICOM
* prescribes code from CID 7263 "Diffusion Tractography Measurement
* Types"
* @param typeModifierCode The region of interest of the statistic. DICOM
* prescribes code from CID 7464 "General Region of Interest
* Measurement Modifiers"
* @param unitsCode The physical units of the statistic value. DICOM
* prescribes code from CID 82 "Units of Measurement".
* @param statisticValue The statistic value
* @param statistic Returns the resulting TrcTrackSetStatistic object (NULL
* in case of any error)
* @return EC_Normal if creation was successful, error otherwise
*/
static OFCondition create(const CodeSequenceMacro& typeCode,
const CodeSequenceMacro& typeModifierCode,
const CodeSequenceMacro& unitsCode,
const Float64 statisticValue,
TrcTrackSetStatistic*& statistic /* result */);
/** 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);
/** Resets rules to their original values
*/
virtual void resetRules();
/** Get name of component
* @return Name of the module ("TrackSetStatisticsSequenceItem")
*/
virtual OFString getName() const;
/** Set Track Set statistic
* @param typeCode The value for which the statistic is a summary. DICOM
* prescribes code from CID 7263 "Diffusion Tractography Measurement
* Types"
* @param typeModifierCode The region of interest of the statistic. DICOM
* prescribes code from CID 7464 "General Region of Interest
* Measurement Modifiers"
* @param unitsCode The physical units of the statistic value. DICOM
* prescribes code from CID 82 "Units of Measurement".
* @param statisticValue The statistic value
* @return EC_Normal if setting was successful, error otherwise
*/
virtual OFCondition set(const CodeSequenceMacro& typeCode,
const CodeSequenceMacro& typeModifierCode,
const CodeSequenceMacro& unitsCode,
const Float64 statisticValue);
/** Get Track Set statistic information
* @param typeCode Returns value for which the statistic is a summary.
* @param typeModifierCode Returns region of interest of the statistic.
* @param unitsCode Returns physical units of the statistic value.
* @param statisticValue Returns the statistic value
* @return EC_Normal if data could be retrieved, error otherwise
*/
virtual OFCondition get(CodeSequenceMacro& typeCode,
CodeSequenceMacro& typeModifierCode,
CodeSequenceMacro& unitsCode,
Float64& statisticValue);
// Make sure the original virtual get() function from TrcStatistic
// stays visible
using TrcStatistic::get;
};
#endif // TRCSTATISTIC_H
|