DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
IODComponent Class Referenceabstract

Class for managing sets of DICOM attributes (e.g. macros and modules). More...

Inheritance diagram for IODComponent:

## Public Member Functions
| IODComponent (OFshared_ptr< DcmItem > item, OFshared_ptr< IODRules > rules, IODComponent *parent=NULL)
| Constructor. More...
| IODComponent (IODComponent *parent=NULL)
| Constructor, creates rules and item from scratch. More...
IODComponent & | operator= (const IODComponent &rhs)
| Assignment operator, copies contained item and rule set from rhs to "this" attribute set. More...
| IODComponent (const IODComponent &rhs)
| Copy constructor, copies reference to contained item and rule set to "this" attribute set. More...
virtual | ~IODComponent ()
| Virtual Destructor.
virtual void | clearData ()
| Clear all attributes from the data that are handled by this module. More...
virtual void | inventMissing ()
| Set missing values by inventing "default values". More...
virtual void | resetRules ()=0
| Resets rules to their original values.
OFshared_ptr< IODRules > | getRules ()
| Get rules handled by this module. More...
virtual void | makeOptional ()
| Make component optional by turning all attributes requirement types of it to type 3. More...
virtual OFString | getName () const =0
| Get name of component. More...
DcmItem & | getData ()
| Get the data handled by this module. More...
virtual OFCondition | read (DcmItem &source, const OFBool clearOldData=OFTrue)
| Read attributes from given item into this class. More...
virtual OFCondition | write (DcmItem &destination)
| Write attributes from this class into given item. More...
virtual OFCondition | check (const OFBool quiet=OFFalse)
| Check whether this component's data satisfies the underlying rules. More...
virtual int | compare (const IODComponent &rhs) const
| Comparison operator for IOD Components. More...
virtual bool | getValueCheckOnWrite () const
| Get whether attribute value errors will be handled as errors on writing. More...
virtual void | setValueCheckOnWrite (const OFBool checkValue)
| Set whether attribute values should be checked on writing, i.e. More...

## Static Public Member Functions
static OFCondition | read (DcmItem &source, IODRules &rules, DcmItem &destination, const OFString &componentName)
| Static helper function that reads attributes from given item into destination item, as determined by the provided rules and component name. More...
static OFCondition | write (DcmItem &source, IODRules &rules, DcmItem &destination, const OFString &componentName, const OFBool checkValue)
| Static helper function that writes attributes from given item into destination item, as determined by the provided rules and component name. More...

## Protected Attributes
OFshared_ptr< DcmItem > | m_Item
| Shared pointer to the data handled by this class. More...
OFshared_ptr< IODRules > | m_Rules
| Rules describing the attributes governed by this class.
IODComponent * | m_Parent
| The parent component (may be NULL) of this class.
OFBool | m_CheckValueOnWrite
| Denotes whether attribute values should be checked on writing, i.e. More...

## Detailed Description

Class for managing sets of DICOM attributes (e.g. macros and modules).

The data is hold in a container (DcmItem) that can be shared with other components, i.e. different modules that hold their data in a common container. In order to know which attributes in the container should be actually handled by a component, the component also has a set of rules, which can also be shared between different components (e.g. all modules of an IOD can share the same set of rules). For each attribute there is one rule in the rule set, denoting the requirement type (1,2,3,1C,2C), the VM, and besides others also the name of the component that the attribute belongs to (e.g. "PatientModule"). Since the component knows its own name, it can decide which attributes in the data container it is responsible for. This class is meant to support nested substructures but so far only writes attributes on a single level (including sequences). Also, in this context the class carries a parent relationship which is not used at the moment.

## Constructor & Destructor Documentation

## ◆ IODComponent() [1/3]

IODComponent::IODComponent | ( | OFshared_ptr< DcmItem > | item,
|  | OFshared_ptr< IODRules > | rules,
|  | IODComponent * | parent = `NULL`
| ) |  |

Constructor.

Parameters

  item | The item to be used for data storage. If NULL, the class creates an empty data container.
  rules | The rule set for this class. If NULL, the class creates an empty rule set.
  parent | The parent of the IOD component (NULL if none or unknown)

## ◆ IODComponent() [2/3]

IODComponent::IODComponent | ( | IODComponent * | parent = `NULL` | ) |

Constructor, creates rules and item from scratch.

Parameters

  parent | The parent of the IOD component (NULL if none or unknown)

## ◆ IODComponent() [3/3]

IODComponent::IODComponent | ( | const IODComponent & | rhs | ) |

Copy constructor, copies reference to contained item and rule set to "this" attribute set.

Parameters

  rhs | The component to be assigned

## Member Function Documentation

## ◆ check()

virtual OFCondition IODComponent::check | ( | const OFBool | quiet = `OFFalse` | ) |
| virtual

Check whether this component's data satisfies the underlying rules.

Parameters

  quiet | If OFTrue, not error / warning messages will be produced. Only the returned error code will indicate error or OK. Per default, logging output is produced (OFFalse).

Returns
  EC_Normal if rules are satisfied, error otherwise

Reimplemented in TrcTrack, TrcTractographyResultsModule, CodeWithModifiers, and CodeSequenceMacro.

## ◆ clearData()

virtual void IODComponent::clearData | ( |  | ) |
| virtual

Clear all attributes from the data that are handled by this module.

An attribute is considered belonging to the module if there are rules marked as belonging to this module via the rule's module name.

Reimplemented in TrcTrackSet, TrcTrack, TrcStatistic, TrcTractographyResultsModule, TrcMeasurement, IODPaletteColorLUTModule, IODMultiframeDimensionModule, IODICCProfileModule, IODGeneralStudyModule, IODCommonInstanceReferenceModule, IODCommonInstanceReferenceModule, MandatoryViewAndSliceProgressionDirectionMacro, IODSeriesAndInstanceReferenceMacro, IODSeriesAndInstanceReferenceMacro, and CodeWithModifiers.

Referenced by DcmIODImage<>::clearData().

## ◆ compare()

virtual int IODComponent::compare | ( | const IODComponent & | rhs | ) | const
| virtual

Comparison operator for IOD Components.

Parameters

  rhs | The right hand side of the comparison

Returns
  0, if the given object is equal to this object, other value otherwise

Reimplemented in ImageSOPInstanceReferenceMacro, and CodeWithModifiers.

## ◆ getData()

DcmItem& IODComponent::getData | ( |  | ) |
| inline

Get the data handled by this module.

Returns
  The item containing the data of this module

## ◆ getName()

virtual OFString IODComponent::getName | ( |  | ) | const
| pure virtual

Get name of component.

Returns
  Name of the module

Implemented in TrcTrackSet, TrcTrack, TrcTrackSetStatistic, TrcTracksStatistic, TrcTractographyResultsModule, TrcMeasurement, TrcMeasurement::Values, DPMParametricMapSeriesModule, DPMParametricMapImageModule, IODUSFoRModule, IODSynchronizationModule, IODSOPCommonModule, IODSegmentationSeriesModule, IODPatientStudyModule, IODPatientModule, IODPaletteColorLUTModule, IODMultiFrameFGModule::ConcatenationInfo, IODMultiFrameFGModule, IODMultiframeDimensionModule, IODMultiframeDimensionModule::DimensionIndexItem, IODMultiframeDimensionModule::DimensionOrganizationItem, IODImagePixelBase, IODImagePixelModule< T >, IODICCProfileModule, IODGeneralStudyModule, IODGeneralSeriesModule, IODGeneralImageModule, IODFoRModule, IODDoubleFloatingPointImagePixelModule, IODFloatingPointImagePixelModule, IODGeneralEquipmentModule, IODEnhancedUSSeriesModule, IODEnhUSImageModule, IODEnhGeneralEquipmentModule, IODCommonInstanceReferenceModule, IODCommonInstanceReferenceModule, IODAcquisitionContextModule, MandatoryViewAndSliceProgressionDirectionMacro, HL7HierarchicDesignatorMacro, IODSeriesAndInstanceReferenceMacro, IODSeriesAndInstanceReferenceMacro, SOPInstanceReferenceMacro, CodeWithModifiers, CodeSequenceMacro, ContentItemMacro, and ContentItemMacro::ReferencedSOPSequenceItem.

## ◆ getRules()

OFshared_ptr<IODRules> IODComponent::getRules | ( |  | ) |
| inline

Get rules handled by this module.

Returns
  The rules

## ◆ getValueCheckOnWrite()

virtual bool IODComponent::getValueCheckOnWrite | ( |  | ) | const
| virtual

Get whether attribute value errors will be handled as errors on writing.

Returns
  OFTrue if attribute value errors are handled as errors on writing, OFFalse otherwise.

## ◆ inventMissing()

virtual void IODComponent::inventMissing | ( |  | ) |
| virtual

Set missing values by inventing "default values".

Automatically called during write() in IODComponent. In this bas class implementation, this method checks for every rule of this component whether it has a default value, and if, invents the attribute if it is not present in the data, i.e. creating it with the default value or setting it to the default value if no value is present. This happens independently of the requirement type.

Reimplemented in TrcTrackSet, IODSOPCommonModule, IODGeneralStudyModule, and IODGeneralSeriesModule.

## ◆ makeOptional()

virtual void IODComponent::makeOptional | ( |  | ) |
| virtual

Make component optional by turning all attributes requirement types of it to type 3.

In order to reset to the attribute's original types, resetRules() can be used.

## ◆ operator=()

IODComponent& IODComponent::operator= | ( | const IODComponent & | rhs | ) |

Assignment operator, copies contained item and rule set from rhs to "this" attribute set.

Performs deep copy, i.e. the contained item and the rule set are copied. The parent component is set to NULL.

Parameters

  rhs | The IODComponent to be assigned

Returns
  Reference to this module

## ◆ read() [1/2]

virtual OFCondition IODComponent::read | ( | DcmItem & | source,
|  | const OFBool | clearOldData = `OFTrue`
| ) |  |
| virtual

Read attributes from given item into this class.

Parameters

  source | The source to read from
  clearOldData | If OFTrue, old data is cleared before reading. Otherwise old data is overwritten (or amended)

Returns
  EC_Normal if reading was successful, error otherwise

Reimplemented in TrcTrackSet, TrcTrack, TrcTrackSetStatistic, TrcTracksStatistic, TrcStatistic, TrcTractographyResultsModule, TrcMeasurement, DPMParametricMapSeriesModule, DPMParametricMapImageModule, IODPaletteColorLUTModule, IODMultiFrameFGModule, IODMultiframeDimensionModule, IODImagePixelModule< T >, IODICCProfileModule, IODGeneralStudyModule, IODGeneralSeriesModule, IODDoubleFloatingPointImagePixelModule, IODFloatingPointImagePixelModule, IODEnhancedUSSeriesModule, IODEnhUSImageModule, IODCommonInstanceReferenceModule, IODCommonInstanceReferenceModule, MandatoryViewAndSliceProgressionDirectionMacro, ImageSOPInstanceReferenceMacro, IODSeriesAndInstanceReferenceMacro, IODSeriesAndInstanceReferenceMacro, CodeWithModifiers, ContentItemMacro, and ContentItemMacro::ReferencedSOPSequenceItem.

Referenced by DcmIODImage<>::read().

## ◆ read() [2/2]

static OFCondition IODComponent::read | ( | DcmItem & | source,
|  | IODRules & | rules,
|  | DcmItem & | destination,
|  | const OFString & | componentName
| ) |  |
| static

Static helper function that reads attributes from given item into destination item, as determined by the provided rules and component name.

The rules are only applied when reading from the source (which may result in warning messages on the logger), but if they could be found they are taken over into the destination item no matter whether the element validates against the rule.

Parameters

  source | The item to read from
  rules | The rules that provide the attributes and requirements for these attributes
  destination | The destination to write to
  componentName | The name of the module/component to write

Returns
  EC_Normal if reading was successful, error otherwise

## ◆ setValueCheckOnWrite()

virtual void IODComponent::setValueCheckOnWrite | ( | const OFBool | checkValue | ) |
| virtual

Set whether attribute values should be checked on writing, i.e.

if writing should fail if attribute values violate their VR, VM, character set or value length. A missing but required value is always considered an error, independent of this setting. If set to OFFalse, writing will always succeed, even if attribute value constraints are violated. A warning instead of an error will be printed to the logger.

Parameters

  checkValue | If OFTrue, attribute value errors are handled as errors on writing, if OFFalse any errors are ignored.

Referenced by DcmIODImage<>::setValueCheckOnWrite().

## ◆ write() [1/2]

virtual OFCondition IODComponent::write | ( | DcmItem & | destination | ) |
| virtual

Write attributes from this class into given item.

Parameters

  destination | The item to write to

Returns
  EC_Normal if writing was successful, error otherwise

Reimplemented in MandatoryViewAndSliceProgressionDirectionMacro, ImageSOPInstanceReferenceMacro, TrcTrackSet, TrcTrack, TrcTrackSetStatistic, TrcTracksStatistic, TrcStatistic, TrcTractographyResultsModule, TrcMeasurement, DPMParametricMapSeriesModule, DPMParametricMapImageModule, IODPaletteColorLUTModule, IODMultiFrameFGModule, IODMultiframeDimensionModule, IODImagePixelModule< T >, IODICCProfileModule, IODGeneralStudyModule, IODGeneralSeriesModule, IODDoubleFloatingPointImagePixelModule, IODFloatingPointImagePixelModule, IODEnhancedUSSeriesModule, IODEnhUSImageModule, IODCommonInstanceReferenceModule, IODCommonInstanceReferenceModule, IODSeriesAndInstanceReferenceMacro, IODSeriesAndInstanceReferenceMacro, CodeWithModifiers, ContentItemMacro, and ContentItemMacro::ReferencedSOPSequenceItem.

Referenced by DcmIODImage<>::write().

## ◆ write() [2/2]

static OFCondition IODComponent::write | ( | DcmItem & | source,
|  | IODRules & | rules,
|  | DcmItem & | destination,
|  | const OFString & | componentName,
|  | const OFBool | checkValue
| ) |  |
| static

Static helper function that writes attributes from given item into destination item, as determined by the provided rules and component name.

The rules are only applied when writing to the destination (which may result in warning messages on the logger, and the whole call returning with an error). During reading from the source item the elements read are not validated against the rules.

Parameters

  source | The item to read from
  rules | The rules that provide the attributes and requirements for these attributes
  destination | The destination to write to
  componentName | The name of the module/component to write
  checkValue | If OFTrue, attribute value errors are handled as errors on writing, if OFFalse any errors are ignored.

Returns
  EC_Normal if reading was successful, error otherwise

## Member Data Documentation

## ◆ m_CheckValueOnWrite

OFBool IODComponent::m_CheckValueOnWrite
| protected

Denotes whether attribute values should be checked on writing, i.e.

if writing should fail if attribute values violate their VR, VM, character set or value length. A missing but required value is always considered an error, independent of this setting. If set to OFFalse, writing will always succeed, even if attribute values constraints are violated. A warning instead of an error will be printed to the logger. OFTrue if attribute value errors are handled as errors on writing, OFFalse otherwise.

## ◆ m_Item

OFshared_ptr<DcmItem> IODComponent::m_Item
| protected

Shared pointer to the data handled by this class.

The item may contain more attributes than this class is actually responsible for

The documentation for this class was generated from the following file:

- dcmiod/include/dcmtk/dcmiod/modbase.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1