DCMTK: DcmDataUtil Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
DcmDataUtil Class Reference

Class with helper functions used within the dcmdata module (and beyond) More...

## Static Public Member Functions
static OFCondition | getSOPInstanceFromFile (const OFFilename &filename, OFString &sopClassUID, OFString &sopInstanceUID, OFString &transferSyntaxUID, const E_FileReadMode readMode=ERM_fileOnly)
| Get SOP Class UID, SOP Instance UID and Transfer Syntax UID from a DICOM file.
static OFCondition | getSOPInstanceFromDataset (DcmDataset *dataset, const E_TransferSyntax datasetXfer, OFString &sopClassUID, OFString &sopInstanceUID, OFString &transferSyntaxUID)
| Get SOP Class UID, SOP Instance UID and Transfer Syntax UID from a DICOM dataset.

## Detailed Description

Class with helper functions used within the dcmdata module (and beyond)

## Member Function Documentation

## ◆ getSOPInstanceFromDataset()

static OFCondition DcmDataUtil::getSOPInstanceFromDataset | ( | DcmDataset * | dataset,
|  | const E_TransferSyntax | datasetXfer,
|  | OFString & | sopClassUID,
|  | OFString & | sopInstanceUID,
|  | OFString & | transferSyntaxUID )
| static

Get SOP Class UID, SOP Instance UID and Transfer Syntax UID from a DICOM dataset.

The first two UID values are directly copied from the dataset. The latter is either taken from the parameter 'datasetXfer' or, if it is unknown, determined automatically from the dataset (if possible).

Parameters

  dataset | DICOM dataset from which the SOP Class UID and SOP Instance UID values are retrieved
  datasetXfer | Transfer syntax of the dataset (if known, otherwise set to set to EXS_Unknown and then it is determined automatically)
  sopClassUID | Variable in which the value of the SOP Class UID is stored
  sopInstanceUID | Variable in which the value of the SOP Instance UID is stored
  transferSyntaxUID | Variable in which the value of the Transfer Syntax UID is stored

Returns
  EC_Normal if successful, an error code otherwise

## ◆ getSOPInstanceFromFile()

static OFCondition DcmDataUtil::getSOPInstanceFromFile | ( | const OFFilename & | filename,
|  | OFString & | sopClassUID,
|  | OFString & | sopInstanceUID,
|  | OFString & | transferSyntaxUID,
|  | const E_FileReadMode | readMode = ERM_fileOnly )
| static

Get SOP Class UID, SOP Instance UID and Transfer Syntax UID from a DICOM file.

The first two UID values are either copied from the meta-header (preferred) or from the dataset. The latter is either copied from the meta-header (preferred) or determined automatically (if possible).

Parameters

  filename | Name of the DICOM file from which the SOP Class UID and SOP Instance UID values are retrieved
  sopClassUID | Variable to which the value of the SOP Class UID is stored
  sopInstanceUID | Variable to which the value of the SOP Instance UID is stored
  transferSyntaxUID | Variable to which the value of the Transfer Syntax UID is stored
  readMode | Read mode passed to the DcmFileFormat::loadFile() method. If ERM_fileOnly, only the file meta information header is loaded, i.e. the behavior is identical to using ERM_metaOnly.

Returns
  EC_Normal if successful, an error code otherwise

References ERM_fileOnly.

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

- dcmdata/include/dcmtk/dcmdata/dcdatutl.h

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