Loading...
Searching...
No Matches
DcmIODCommon Class Reference

Interface class to those modules and data attributes are common for many DICOM IODs. More...

Inheritance diagram for DcmIODCommon:

## Public Member Functions

| DcmIODCommon ()
| Constructor.
| DcmIODCommon (const DcmIODCommon &rhs)
| Copy Constructor.
OFshared_ptr< IODRules > | getRules ()
| Get rules handled by this IOD.
OFshared_ptr< DcmItem > | getData ()
| Get item managed by this IOD.
IODPatientModule & | getPatient ()
| Get Patient Module.
IODPatientStudyModule & | getPatientStudy ()
| Get Patient Study Module.
IODGeneralStudyModule & | getStudy ()
| Get General Study Module.
IODGeneralEquipmentModule & | getEquipment ()
| Get General Equipment Module.
IODGeneralSeriesModule & | getSeries ()
| Get Series Module.
IODFoRModule & | getFrameOfReference ()
| Get Frame of Reference Module.
IODSOPCommonModule & | getSOPCommon ()
| Get SOP Common Module.
IODCommonInstanceReferenceModule & | getCommonInstanceReference ()
| Get Common Instance Reference Module.
virtual | ~DcmIODCommon ()
| Destructor.
virtual void | clearData ()
| Clear (removes) all attributes handled by the modules of this IOD.
virtual void | createNewStudy (const OFBool clearEquipment=OFTrue)
| Create new study.
virtual void | createNewSeries (const OFBool clearFoR=OFTrue)
| Create a new series.
virtual void | createNewSOPInstance ()
| Create a new SOP instance.
virtual void | ensureInstanceUIDs (const OFBool correctInvalid=OFFalse)
| Make sure that the IOD contains a SOP Instance, Series Instance and Study Instance UID.
virtual OFCondition | read (DcmItem &dataset)
| Read data into this class.
virtual OFCondition | importHierarchy (DcmItem &dataset, const OFBool readPatient, const OFBool readStudy, const OFBool readFoR=OFFalse, const OFBool readSeries=OFFalse, const OFBool takeOverCharset=OFTrue)
| Import common module attributes from dataset but only read Patient, Study, Series and/or Frame of Reference level portions.
virtual OFCondition | importHierarchy (const OFString &filename, const OFBool readPatient, const OFBool readStudy, const OFBool readFoR=OFFalse, const OFBool readSeries=OFFalse, const OFBool takeOverCharset=OFTrue)
| CAUTION: Parameter order (readFoR and readSeries) changed compared to the old import() function.
virtual OFCondition | write (DcmItem &dataset)
| Write the attributes managed by this class to DICOM dataset.
virtual void | setValueCheckOnWrite (const OFBool checkValue)
| Set whether attribute values should be checked on writing, i.e.
virtual OFBool | getValueCheckOnWrite () const
| Get whether attribute value errors will be handled as errors on writing.

## Private Member Functions

DcmIODCommon & | operator= (const DcmIODCommon &rhs)
| Copy assignment disabled.

## Private Attributes

OFshared_ptr< DcmItem > | m_Item
| The data hold by this class (shared with modules below).
OFshared_ptr< IODRules > | m_Rules
| The rules hold by this class (shared with modules below).
IODPatientModule | m_Patient
| Patient Module.
IODPatientStudyModule | m_PatientStudy
| Patient Study Module.
IODGeneralStudyModule | m_Study
| General Study Module.
IODGeneralEquipmentModule | m_Equipment
| General Equipment Module.
IODGeneralSeriesModule | m_Series
| General Series Module.
IODFoRModule | m_FrameOfReference
| Frame of Reference Module.
IODSOPCommonModule | m_SOPCommon
| SOP Common Module.
IODCommonInstanceReferenceModule | m_CommonInstanceReferenceModule
| Common Instance Reference Module.
OFVector< IODModule * > | m_Modules
| Collects all modules of this class for convenience (iteration).
OFBool | m_CheckValueOnWrite
| Denotes whether attribute values should be checked on writing, i.e.

## Detailed Description

Interface class to those modules and data attributes are common for many DICOM IODs.

The class offers a dedicated API for getting and settings those attributes. Modules included: Patient Module, General Study Module, General Equipment Module, General Series Module, Frame of Reference Module, SOP Common Module.

## Constructor & Destructor Documentation

## DcmIODCommon()

DcmIODCommon::DcmIODCommon | ( | const DcmIODCommon & | rhs | ) |

Copy Constructor.

Parameters

  rhs | The object to copy from

References DcmIODCommon().

## Member Function Documentation

## clearData()

virtual void DcmIODCommon::clearData | ( |  | ) |

virtual

Clear (removes) all attributes handled by the modules of this IOD.

IOD Rules are not reset.

Reimplemented in DcmIODImage<>, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Sint16 > >, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Sint16 >, IODFloatingPointImagePixelModule, IODDoubleFloatingPointImagePixelModule >, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Uint8 > >, DcmSegmentation, DPMParametricMapBase, and TrcTractographyResults.

Referenced by DcmIODImage<>::clearData().

## createNewSeries()

virtual void DcmIODCommon::createNewSeries | ( | const OFBool | clearFoR = OFTrue | ) |

virtual

Create a new series.

After generating a new Series Instance UID the method createNewSOPInstance() is called, i.e. Series-related attributes managed by the series-level modules of this class are cleared, as well as instance-level data.

Parameters

  clearFoR | If OFTrue (default), also the frame of reference is cleared (FoR Module)

## createNewSOPInstance()

virtual void DcmIODCommon::createNewSOPInstance | ( |  | ) |

virtual

Create a new SOP instance.

Generate a new SOP Instance UID and set the Instance Creation Date/Time to the current date and time. It could be used explicitly from the calling application if a new UID should be created (this is the case if the Study Instance UID or Series Instance UID has changed as well as any other attribute on the instance level, e.g. image pixel data). Also clears other instance related data.

## createNewStudy()

virtual void DcmIODCommon::createNewStudy | ( | const OFBool | clearEquipment = OFTrue | ) |

virtual

Create new study.

After generating a new Study Instance UID the method createNewSeries() is called, i.e. also a new Series Instance UID and SOP instance UID are generated. This is a requirement of the DICOM standard. All other study-related attributes from the study-level modules managed by this class are cleared (as well as Series and Instance level attributes).

Parameters

  clearEquipment | If OFTrue (default), also the equipment information is cleared (General Equipment Module))

## ensureInstanceUIDs()

virtual void DcmIODCommon::ensureInstanceUIDs | ( | const OFBool | correctInvalid = OFFalse | ) |

virtual

Make sure that the IOD contains a SOP Instance, Series Instance and Study Instance UID.

They are created if empty. Invalid UIDs are corrected if desired.

Parameters

  correctInvalid | If OFTrue, invalid instance UIDs will be replaced by new ones

## getCommonInstanceReference()

IODCommonInstanceReferenceModule & DcmIODCommon::getCommonInstanceReference | ( |  | ) |

Get Common Instance Reference Module.

Returns
  Common Instance Reference Module

## getData()

OFshared_ptr< DcmItem > DcmIODCommon::getData | ( |  | ) |

Get item managed by this IOD.

Returns
  The item

Referenced by DcmIODImage<>::DcmIODImage(), and DcmIODImage<>::DcmIODImage().

## getEquipment()

IODGeneralEquipmentModule & DcmIODCommon::getEquipment | ( |  | ) |

Get General Equipment Module.

Returns
  Reference to General Equipment Module

## getFrameOfReference()

IODFoRModule & DcmIODCommon::getFrameOfReference | ( |  | ) |

Get Frame of Reference Module.

Returns
  Reference to Frame of Reference Module

## getPatient()

IODPatientModule & DcmIODCommon::getPatient | ( |  | ) |

Get Patient Module.

Returns
  Reference to Patient Module

## getPatientStudy()

IODPatientStudyModule & DcmIODCommon::getPatientStudy | ( |  | ) |

Get Patient Study Module.

Returns
  Reference to Patient Study Module

## getRules()

OFshared_ptr< IODRules > DcmIODCommon::getRules | ( |  | ) |

Get rules handled by this IOD.

Returns
  The rules

Referenced by DcmIODImage<>::DcmIODImage(), and DcmIODImage<>::DcmIODImage().

## getSeries()

IODGeneralSeriesModule & DcmIODCommon::getSeries | ( |  | ) |

Get Series Module.

Returns
  Reference to General Series Module

## getSOPCommon()

IODSOPCommonModule & DcmIODCommon::getSOPCommon | ( |  | ) |

Get SOP Common Module.

Returns
  Reference to SOP Common Module

## getStudy()

IODGeneralStudyModule & DcmIODCommon::getStudy | ( |  | ) |

Get General Study Module.

Returns
  Reference to General Study Module

## getValueCheckOnWrite()

virtual OFBool DcmIODCommon::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.

## importHierarchy() [1/2]

virtual OFCondition DcmIODCommon::importHierarchy | ( | const OFString & | filename,
|  | const OFBool | readPatient,
|  | const OFBool | readStudy,
|  | const OFBool | readFoR = OFFalse,
|  | const OFBool | readSeries = OFFalse,
|  | const OFBool | takeOverCharset = OFTrue )

virtual

CAUTION: Parameter order (readFoR and readSeries) changed compared to the old import() function.

Import common module attributes from DICOM file but only read Patient, Study, Series and/or Frame of Reference level portions. The current content is not deleted before reading. If the log stream is set and valid the reason for any error might be obtained from the error/warning output.

Parameters

  filename | The filename to read from.
  readPatient | Read Patient-level information if OFTrue
  readStudy | Read Study-level information if OFTrue, including equipment module
  readFoR | Read Frame of Reference information if OFTrue. See also readSeries parameter.
  readSeries | Read Series-level information if OFTrue, always includes Frame of Reference, i.e. readFoR is considered to be OFTrue
  takeOverCharset | If OFTrue (default), Specific Character Set is taken over from imported dataset. If it's not present or empty (invalid), the attribute will not be present in this class either.

Returns
  EC_Normal if reading was successful (i.e. if any information could be read), otherwise an error is returned

## importHierarchy() [2/2]

virtual OFCondition DcmIODCommon::importHierarchy | ( | DcmItem & | dataset,
|  | const OFBool | readPatient,
|  | const OFBool | readStudy,
|  | const OFBool | readFoR = OFFalse,
|  | const OFBool | readSeries = OFFalse,
|  | const OFBool | takeOverCharset = OFTrue )

virtual

Import common module attributes from dataset but only read Patient, Study, Series and/or Frame of Reference level portions.

The current content is not deleted before reading. If the log stream is set and valid the reason for any error might be obtained from the error/warning output.

Parameters

  dataset | Reference to DICOM dataset from which the document should be read
  readPatient | Read Patient-level information if OFTrue
  readStudy | Read Study-level information if OFTrue, including equipment module
  readFoR | Read Frame of Reference information if OFTrue. See also readSeries parameter.
  readSeries | Read Series-level information if OFTrue, always includes Frame of Reference, i.e. readFoR is considered to be OFTrue
  takeOverCharset | If OFTrue (default), Specific Character Set is taken over from imported dataset. If it's not present or empty (invalid), the attribute will not be present in this class either.

Returns
  EC_Normal if successful, an error code otherwise

## operator=()

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

private

Copy assignment disabled.

Parameters

  rhs | Object to copy from

Returns
  Reference to "this" object

References DcmIODCommon().

## read()

virtual OFCondition DcmIODCommon::read | ( | DcmItem & | dataset | ) |

virtual

Read data into this class.

Please note that the current content is also deleted 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. The reading process will ignore missing attributes or values as possible in order to read as as much as possible.

Parameters

  dataset | DICOM dataset from which the document should be read

Returns
  EC_Normal if successful, an error code otherwise

Reimplemented in DcmIODImage<>, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Sint16 > >, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Sint16 >, IODFloatingPointImagePixelModule, IODDoubleFloatingPointImagePixelModule >, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Uint8 > >, DcmSegmentation, DPMParametricMapBase, DPMParametricMapIOD, EctEnhancedCT, and TrcTractographyResults.

Referenced by DcmIODImage<>::read().

## setValueCheckOnWrite()

virtual void DcmIODCommon::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.

Reimplemented in DcmIODImage<>, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Sint16 > >, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Sint16 >, IODFloatingPointImagePixelModule, IODDoubleFloatingPointImagePixelModule >, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Uint8 > >, DcmSegmentation, DPMParametricMapIOD, and EctEnhancedCT.

Referenced by DcmIODImage<>::setValueCheckOnWrite().

## write()

virtual OFCondition DcmIODCommon::write | ( | DcmItem & | dataset | ) |

virtual

Write the attributes managed by this class to DICOM dataset.

Parameters

  dataset | Reference to DICOM dataset to which the current document should be written. The dataset is not cleared before writing to it.

Returns
  EC_Normal if successful, an error code otherwise

Reimplemented in DcmIODImage<>, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Sint16 > >, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Sint16 >, IODFloatingPointImagePixelModule, IODDoubleFloatingPointImagePixelModule >, DcmIODImage< IODImagePixelModule< Uint16 >, IODImagePixelModule< Uint8 > >, DPMParametricMapBase, DPMParametricMapIOD, EctEnhancedCT, and TrcTractographyResults.

Referenced by DcmIODImage<>::write().

## Member Data Documentation

## m_CheckValueOnWrite

OFBool DcmIODCommon::m_CheckValueOnWrite

private

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.

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

- dcmiod/include/dcmtk/dcmiod/iodcommn.h

Generated on for DCMTK Version 3.7.0 by Doxygen 1.15.0