DCMTK: ContentItemMacro Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ContentItemMacro Class Reference

Class representing the Content Item Macro: More...

Inheritance diagram for ContentItemMacro:

## Classes
class | ReferencedSOPSequenceItem
| Class representing an item within the Content Item Macro's Referenced SOP Sequence. More...

## Public Member Functions
| ContentItemMacro (OFshared_ptr< DcmItem > item, OFshared_ptr< IODRules > rules)
| Constructor.
| ContentItemMacro ()
| Constructor.
virtual | ~ContentItemMacro ()
| Destructor.
virtual void | resetRules ()
| Resets rules to their original values.
virtual OFString | getName () const
| Get name of module ("ContentItemMacro")
virtual OFCondition | read (DcmItem &source, const OFBool clearOldData=OFTrue)
| Read attributes from given item into this class.
virtual OFCondition | write (DcmItem &destination)
| Write attributes from this class into given item.
virtual OFCondition | getValueType (OFString &value, const signed long pos=0) const
| Get ValueType.
virtual OFCondition | getValueType (ValueType &value) const
| Get ValueType.
virtual CodeSequenceMacro * | getConceptNameCodeSequence ()
| Get reference to the ConceptNameCodeSequence.
virtual OFVector< CodeSequenceMacro * > & | getEntireConceptNameCodeSequence ()
| Get a reference to the entire ConceptNameCodeSequence, including items exceeding the value multiplicity restriction of "1".
virtual OFCondition | getDateTime (OFString &value, const signed long pos=0) const
| Get DateTime.
virtual OFCondition | getDate (OFString &value, const signed long pos=0) const
| Get Date.
virtual OFCondition | getTime (OFString &value, const signed long pos=0) const
| Get Time.
virtual OFCondition | getPersonName (OFString &value, const signed long pos=0) const
| Get PersonName.
virtual OFCondition | getUID (OFString &value, const signed long pos=0) const
| Get UID.
virtual OFCondition | getTextValue (OFString &value, const signed long pos=0) const
| Get TextValue.
virtual CodeSequenceMacro * | getConceptCodeSequence ()
| Get reference to the ConceptCodeSequence.
virtual OFVector< CodeSequenceMacro * > & | getEntireConceptCodeSequence ()
| Get a reference to the entire ConceptCodeSequence, including items exceeding the value multiplicity restriction of "1".
virtual OFCondition | getNumericValue (OFString &value, const signed long pos=0) const
| Get NumericValue.
virtual OFCondition | getFloatingPointValue (Float64 &value, const unsigned long pos=0) const
| Get FloatingPointValue.
virtual OFCondition | getRationalNumeratorValue (Sint32 &value, const unsigned long pos=0) const
| Get RationalNumeratorValue.
virtual OFCondition | getRationalDenominatorValue (Uint32 &value, const unsigned long pos=0) const
| Get RationalDenominatorValue.
virtual CodeSequenceMacro * | getMeasurementUnitsCodeSequence ()
| Get reference to the MeasurementUnitsCodeSequence.
virtual OFVector< CodeSequenceMacro * > & | getEntireMeasurementUnitsCodeSequence ()
| Get a reference to the entire MeasurementUnitsCodeSequence, including items exceeding the value multiplicity restriction of "1".
virtual ReferencedSOPSequenceItem * | getReferencedSOPSequence ()
| Get reference to the ReferencedSOPSequence.
virtual OFVector< ReferencedSOPSequenceItem * > & | getEntireReferencedSOPSequence ()
| Get a reference to the entire ReferencedSOPSequence, including items exceeding the value multiplicity restriction of "1".
virtual OFCondition | setValueType (const OFString &value, const OFBool checkValue=OFTrue)
| Set ValueType.
virtual OFCondition | setValueType (const ValueType value, const OFBool checkValue=OFTrue)
| Set ValueType.
virtual OFCondition | setDateTime (const OFString &value, const OFBool checkValue=OFTrue)
| Set DateTime.
virtual OFCondition | setDate (const OFString &value, const OFBool checkValue=OFTrue)
| Set Date.
virtual OFCondition | setTime (const OFString &value, const OFBool checkValue=OFTrue)
| Set Time.
virtual OFCondition | setPersonName (const OFString &value, const OFBool checkValue=OFTrue)
| Set PersonName.
virtual OFCondition | setUID (const OFString &value, const OFBool checkValue=OFTrue)
| Set UID.
virtual OFCondition | setTextValue (const OFString &value, const OFBool checkValue=OFTrue)
| Set TextValue.
virtual OFCondition | setNumericValue (const OFString &value, const OFBool checkValue=OFTrue)
| Set NumericValue.
virtual OFCondition | setFloatingPointValue (const Float64 value, const unsigned long pos=0, const OFBool checkValue=OFTrue)
| Set FloatingPointValue.
virtual OFCondition | setRationalNumeratorValue (const Sint32 value, const unsigned long pos=0, const OFBool checkValue=OFTrue)
| Set RationalNumeratorValue.
virtual OFCondition | setRationalDenominatorValue (const Uint32 value, const unsigned long pos=0, const OFBool checkValue=OFTrue)
| Set RationalDenominatorValue.
Public Member Functions inherited from IODComponent
| IODComponent (OFshared_ptr< DcmItem > item, OFshared_ptr< IODRules > rules, IODComponent *parent=NULL)
| Constructor.
| IODComponent (IODComponent *parent=NULL)
| Constructor, creates rules and item from scratch.
IODComponent & | operator= (const IODComponent &rhs)
| Assignment operator, copies contained item and rule set from rhs to "this" attribute set.
| IODComponent (const IODComponent &rhs)
| Copy constructor, copies reference to contained item and rule set to "this" attribute set.
virtual | ~IODComponent ()
| Virtual Destructor.
void | clearData ()
| Clear all attributes from the data that are handled by this module.
virtual void | inventMissing ()
| Set missing values by inventing "default values".
OFshared_ptr< IODRules > | getRules ()
| Get rules handled by this module.
virtual void | makeOptional ()
| Make component optional by turning all attributes requirement types of it to type 3.
DcmItem & | getData ()
| Get the data handled by this module.
virtual OFCondition | check (const OFBool quiet=OFFalse)
| Check whether this component's data satisfies the underlying rules.
virtual int | compare (const IODComponent &rhs) const
| Comparison operator for IOD Components.
virtual bool | getValueCheckOnWrite () const
| Get whether attribute value errors will be handled as errors on writing.
virtual void | setValueCheckOnWrite (const OFBool checkValue)
| Set whether attribute values should be checked on writing, i.e.

## Protected Attributes
OFVector< CodeSequenceMacro * > | m_ConceptNameCodeSequence
| ConceptNameCodeSequence.
OFVector< CodeSequenceMacro * > | m_ConceptCodeSequence
| ConceptCodeSequence.
OFVector< CodeSequenceMacro * > | m_MeasurementUnitsCodeSequence
| MeasurementUnitsCodeSequence.
OFVector< ReferencedSOPSequenceItem * > | m_ReferencedSOPSequence
| ReferencedSOPSequence.
Protected Attributes inherited from IODComponent
OFshared_ptr< DcmItem > | m_Item
| Shared pointer to the data handled by this class.
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.

## Static Protected Attributes
static const OFString | m_ModuleName
| The name of this module ("ContentItemMacro")

## Additional Inherited Members
Static Public Member Functions inherited from IODComponent
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.
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.

## Detailed Description

Class representing the Content Item Macro:

ValueType: (CS, 1, 1) ConceptNameCodeSequence: (SQ, 1, 1) DateTime: (DT, 1, 1C) Date: (DA, 1, 1C) Time: (TM, 1, 1C) PersonName: (PN, 1, 1C) UID: (UI, 1, 1C) TextValue: (UT, 1, 1C) ConceptCodeSequence: (SQ, 1, 1C) NumericValue: (DS, 1-n, 1C) FloatingPointValue: (FD, 1-n, 1C) RationalNumeratorValue: (SL, 1-n, 1C) RationalDenominatorValue: (UL, 1-n, 1C) MeasurementUnitsCodeSequence: (SQ, 1, 1C) ReferencedSOPSequence: (SQ, 1, 1C)

## Constructor & Destructor Documentation

## ◆ ContentItemMacro()

ContentItemMacro::ContentItemMacro | ( | OFshared_ptr< DcmItem > | item,
|  | OFshared_ptr< IODRules > | rules )

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 one from scratch and adds its values.

Referenced by ~ContentItemMacro().

## Member Function Documentation

## ◆ getConceptCodeSequence()

virtual CodeSequenceMacro * ContentItemMacro::getConceptCodeSequence | ( |  | ) |
| virtual

Get reference to the ConceptCodeSequence.

Returns
  a reference to the ConceptCodeSequence

## ◆ getConceptNameCodeSequence()

virtual CodeSequenceMacro * ContentItemMacro::getConceptNameCodeSequence | ( |  | ) |
| virtual

Get reference to the ConceptNameCodeSequence.

Returns
  a reference to the ConceptNameCodeSequence

## ◆ getDate()

virtual OFCondition ContentItemMacro::getDate | ( | OFString & | value,
|  | const signed long | pos = 0 ) const
| virtual

Get Date.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getDateTime()

virtual OFCondition ContentItemMacro::getDateTime | ( | OFString & | value,
|  | const signed long | pos = 0 ) const
| virtual

Get DateTime.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getEntireConceptCodeSequence()

virtual OFVector< CodeSequenceMacro * > & ContentItemMacro::getEntireConceptCodeSequence | ( |  | ) |
| virtual

Get a reference to the entire ConceptCodeSequence, including items exceeding the value multiplicity restriction of "1".

Returns
  a reference to the entire ConceptCodeSequence

## ◆ getEntireConceptNameCodeSequence()

virtual OFVector< CodeSequenceMacro * > & ContentItemMacro::getEntireConceptNameCodeSequence | ( |  | ) |
| virtual

Get a reference to the entire ConceptNameCodeSequence, including items exceeding the value multiplicity restriction of "1".

Returns
  a reference to the entire ConceptNameCodeSequence

## ◆ getEntireMeasurementUnitsCodeSequence()

virtual OFVector< CodeSequenceMacro * > & ContentItemMacro::getEntireMeasurementUnitsCodeSequence | ( |  | ) |
| virtual

Get a reference to the entire MeasurementUnitsCodeSequence, including items exceeding the value multiplicity restriction of "1".

Returns
  a reference to the entire MeasurementUnitsCodeSequence

## ◆ getEntireReferencedSOPSequence()

virtual OFVector< ReferencedSOPSequenceItem * > & ContentItemMacro::getEntireReferencedSOPSequence | ( |  | ) |
| virtual

Get a reference to the entire ReferencedSOPSequence, including items exceeding the value multiplicity restriction of "1".

Returns
  a reference to the entire ReferencedSOPSequence

## ◆ getFloatingPointValue()

virtual OFCondition ContentItemMacro::getFloatingPointValue | ( | Float64 & | value,
|  | const unsigned long | pos = 0 ) const
| virtual

Get FloatingPointValue.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1)

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getMeasurementUnitsCodeSequence()

virtual CodeSequenceMacro * ContentItemMacro::getMeasurementUnitsCodeSequence | ( |  | ) |
| virtual

Get reference to the MeasurementUnitsCodeSequence.

Returns
  a reference to the MeasurementUnitsCodeSequence

## ◆ getName()

virtual OFString ContentItemMacro::getName | ( |  | ) | const
| virtual

Get name of module ("ContentItemMacro")

Returns
  Name of the module ("ContentItemMacro")

Implements IODComponent.

## ◆ getNumericValue()

virtual OFCondition ContentItemMacro::getNumericValue | ( | OFString & | value,
|  | const signed long | pos = 0 ) const
| virtual

Get NumericValue.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getPersonName()

virtual OFCondition ContentItemMacro::getPersonName | ( | OFString & | value,
|  | const signed long | pos = 0 ) const
| virtual

Get PersonName.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getRationalDenominatorValue()

virtual OFCondition ContentItemMacro::getRationalDenominatorValue | ( | Uint32 & | value,
|  | const unsigned long | pos = 0 ) const
| virtual

Get RationalDenominatorValue.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1)

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getRationalNumeratorValue()

virtual OFCondition ContentItemMacro::getRationalNumeratorValue | ( | Sint32 & | value,
|  | const unsigned long | pos = 0 ) const
| virtual

Get RationalNumeratorValue.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1)

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getReferencedSOPSequence()

virtual ReferencedSOPSequenceItem * ContentItemMacro::getReferencedSOPSequence | ( |  | ) |
| virtual

Get reference to the ReferencedSOPSequence.

Returns
  a reference to the ReferencedSOPSequence

## ◆ getTextValue()

virtual OFCondition ContentItemMacro::getTextValue | ( | OFString & | value,
|  | const signed long | pos = 0 ) const
| virtual

Get TextValue.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getTime()

virtual OFCondition ContentItemMacro::getTime | ( | OFString & | value,
|  | const signed long | pos = 0 ) const
| virtual

Get Time.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getUID()

virtual OFCondition ContentItemMacro::getUID | ( | OFString & | value,
|  | const signed long | pos = 0 ) const
| virtual

Get UID.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getValueType() [1/2]

virtual OFCondition ContentItemMacro::getValueType | ( | OFString & | value,
|  | const signed long | pos = 0 ) const
| virtual

Get ValueType.

Parameters

  value | Reference to variable in which the value should be stored
  pos | Index of the value to get (0..vm-1), -1 for all components

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getValueType() [2/2]

virtual OFCondition ContentItemMacro::getValueType | ( | ValueType & | value | ) | const
| virtual

Get ValueType.

Parameters

  value | Reference to variable in which the value should be stored

Returns
  EC_Normal if successful, an error code otherwise

## ◆ read()

virtual OFCondition ContentItemMacro::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 from IODComponent.

## ◆ setDate()

virtual OFCondition ContentItemMacro::setDate | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set Date.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value' for conformance with VR (DA) and VM (1) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setDateTime()

virtual OFCondition ContentItemMacro::setDateTime | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set DateTime.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value' for conformance with VR (DT) and VM (1) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setFloatingPointValue()

virtual OFCondition ContentItemMacro::setFloatingPointValue | ( | const Float64 | value,
|  | const unsigned long | pos = 0,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set FloatingPointValue.

Parameters

  value | Value to be set (single value only) or "" for no value
  pos | Index of the value to be set (starting from 0)
  checkValue | Check 'value' for conformance with VR (FD) and VM (1-n) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setNumericValue()

virtual OFCondition ContentItemMacro::setNumericValue | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set NumericValue.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value' for conformance with VR (DS) and VM (1-n) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setPersonName()

virtual OFCondition ContentItemMacro::setPersonName | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set PersonName.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value' for conformance with VR (PN) and VM (1) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setRationalDenominatorValue()

virtual OFCondition ContentItemMacro::setRationalDenominatorValue | ( | const Uint32 | value,
|  | const unsigned long | pos = 0,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set RationalDenominatorValue.

Parameters

  value | Value to be set (single value only) or "" for no value
  pos | Index of the value to be set (starting from 0)
  checkValue | Check 'value' for conformance with VR (UL) and VM (1-n) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setRationalNumeratorValue()

virtual OFCondition ContentItemMacro::setRationalNumeratorValue | ( | const Sint32 | value,
|  | const unsigned long | pos = 0,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set RationalNumeratorValue.

Parameters

  value | Value to be set (single value only) or "" for no value
  pos | Index of the value to be set (starting from 0)
  checkValue | Check 'value' for conformance with VR (SL) and VM (1-n) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setTextValue()

virtual OFCondition ContentItemMacro::setTextValue | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set TextValue.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value' for conformance with VR (UT) and VM (1) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setTime()

virtual OFCondition ContentItemMacro::setTime | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set Time.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value' for conformance with VR (TM) and VM (1) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setUID()

virtual OFCondition ContentItemMacro::setUID | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set UID.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value' for conformance with VR (UI) and VM (1) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setValueType() [1/2]

virtual OFCondition ContentItemMacro::setValueType | ( | const OFString & | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set ValueType.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value' for conformance with VR (CS) and VM (1) if enabled

Returns
  EC_Normal if successful, an error code otherwise

## ◆ setValueType() [2/2]

virtual OFCondition ContentItemMacro::setValueType | ( | const ValueType | value,
|  | const OFBool | checkValue = OFTrue )
| virtual

Set ValueType.

Parameters

  value | Value to be set (single value only) or "" for no value
  checkValue | Check 'value'. Does nothing, here for consistency with other set() functions.

Returns
  EC_Normal if successful, an error code otherwise

## ◆ write()

virtual OFCondition ContentItemMacro::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 from IODComponent.

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

- dcmiod/include/dcmtk/dcmiod/iodcontentitemmacro.h

Generated on Wed Apr 30 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2