DCMTK: DcmEncapsulatedDocument Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
DcmEncapsulatedDocument Class Reference

This class handles common functions of all command line applications for document encapsulation. More...

## Public Member Functions
| DcmEncapsulatedDocument ()
| Constructor.
| ~DcmEncapsulatedDocument ()
| Destructor.
OFString | XMLgetAllAttributeValues (XMLNode fileNode, OFString attr)
| This function is only used to process CDA files.
OFString | XMLgetAttribute (XMLNode fileNode, DcmTagKey attr)
| This function is only used to process CDA files.
int | getCDAData (const char *filename, OFLogger &appLogger)
| Retrieves patient, concept and document data from the CDA file and checks for data conflicts with series, study and user input.
OFBool | XMLsearchAttribute (XMLNode currnode, OFList< OFString > *results, OFString attr)
| Recursive function used by getAttributeValues to get all occurrences of an attribute as list.
void | addCDACommandlineOptions (OFCommandLine &cmd)
| Add CDA specific command line options to the OFCommandLine object passed to the constructor.
void | addPDFCommandlineOptions (OFCommandLine &cmd)
| Add PDF specific command line options to the OFCommandLine object passed to the constructor.
void | addSTLCommandlineOptions (OFCommandLine &cmd)
| Add STL specific command line options to the OFCommandLine object passed to the constructor.
void | addGeneralOptions (OFCommandLine &cmd)
| Add general command line options to the OFCommandLine object passed to the constructor.
void | addDocumentOptions (OFCommandLine &cmd)
| Add command line options specific for documents to the OFCommandLine object passed to the constructor.
void | addOutputOptions (OFCommandLine &cmd)
| Add command line options specific for output to the OFCommandLine object passed to the constructor.
void | parseArguments (OFConsoleApplication &app, OFCommandLine &cmd)
| Parse and evaluate the given command line arguments.
OFCondition | createHeader (DcmItem *dataset, OFLogger &logger)
| Includes basic information into the DICOM file.
int | insertEncapsulatedDocument (DcmItem *dataset, OFLogger &logger)
| Correctly inserts encapsulated document data.
OFCondition | createIdentifiers (OFLogger &appLogger)
| Get study or series data from provided file.
OFCondition | applyOverrideKeys (DcmDataset *outputDset)
| Copy override keys over existing keys in given dataset.
void | setOverrideKeys (const OFList< OFString > &ovkeys)
| Specifies some attributes that should be inserted after encapsulation They will override any identical attributes already existing in the resulting encapsulated DICOM object.
OFString | getInputFileName ()
| Returns the input file name.
void | setInputFileName (OFString fName)
| Sets the input file name to the given string.
OFString | getOutputFileName ()
| Returns the output file name.
void | setOutputFileName (OFString fName)
| Sets the output file name.
OFCondition | saveFile (DcmFileFormat fileformat)
| Attempt to save the output file .
E_TransferSyntax | getTransferSyntax ()
| Returns the transfer syntax.
OFString | getFileType ()
| Returns the current filetype.
void | setFileType (OFString fType)
| Sets the current filetype.

## Private Attributes
OFString | opt_ifname
| input file name
OFString | opt_ofname
| output file name
OFString | opt_patientBirthdate
| optional parameters *patient data
OFString | opt_conceptCM
| *concept data
OFString | opt_documentTitle
| *document specific options
E_EncodingType | opt_oenctype
| *assign default values for file encoding and padding
OFBool | opt_readSeriesInfo
| *pre-existing series
OFList< OFString > | opt_overrideKeys
| These attributes are applied to the dataset after conversion (They are not checked by the isValid() function).
OFString | cda_mediaTypes
| CDA specific variables.
OFString | opt_frameOfReferenceUID
| STL specific variables Frame of Reference module.
OFString | opt_manufacturer
| Enhanced general equipment module Manufacturer (VM 1)
OFString | opt_manufacturerModelName
| Manufacturer's Model Name (VM 1)
OFString | opt_deviceSerialNumber
| Device Serial Number (VM 1)
OFString | opt_softwareVersions
| Software Version(s) (VM 1-n)
OFString | opt_measurementUnitsCM
| Manufacturing 3D Model Module 3d Model Measurement Units Code Meaning.
OFString | opt_measurementUnitsCSD
| 3d Model Measurement Units Code Scheme Designator
OFString | opt_measurementUnitsCV
| 3d Model Measurement Units Code Value
OFString | ftype
| Type of file currently being converted.

## Detailed Description

This class handles common functions of all command line applications for document encapsulation.

## Member Function Documentation

## ◆ addCDACommandlineOptions()

void DcmEncapsulatedDocument::addCDACommandlineOptions | ( | OFCommandLine & | cmd | ) |

Add CDA specific command line options to the OFCommandLine object passed to the constructor.

Parameters

  cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application.

Returns
  none.

## ◆ addDocumentOptions()

void DcmEncapsulatedDocument::addDocumentOptions | ( | OFCommandLine & | cmd | ) |

Add command line options specific for documents to the OFCommandLine object passed to the constructor.

Parameters

  cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application.

Returns
  none.

## ◆ addGeneralOptions()

void DcmEncapsulatedDocument::addGeneralOptions | ( | OFCommandLine & | cmd | ) |

Add general command line options to the OFCommandLine object passed to the constructor.

Parameters

  cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application.

Returns
  none.

## ◆ addOutputOptions()

void DcmEncapsulatedDocument::addOutputOptions | ( | OFCommandLine & | cmd | ) |

Add command line options specific for output to the OFCommandLine object passed to the constructor.

Parameters

  cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application.

Returns
  none.

## ◆ addPDFCommandlineOptions()

void DcmEncapsulatedDocument::addPDFCommandlineOptions | ( | OFCommandLine & | cmd | ) |

Add PDF specific command line options to the OFCommandLine object passed to the constructor.

Parameters

  cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application.

Returns
  none.

## ◆ addSTLCommandlineOptions()

void DcmEncapsulatedDocument::addSTLCommandlineOptions | ( | OFCommandLine & | cmd | ) |

Add STL specific command line options to the OFCommandLine object passed to the constructor.

Parameters

  cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application.

Returns
  none.

## ◆ applyOverrideKeys()

OFCondition DcmEncapsulatedDocument::applyOverrideKeys | ( | DcmDataset * | outputDset | ) |

Copy override keys over existing keys in given dataset.

Parameters

  outputDset | dataset to which the override keys are copied

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ createHeader()

OFCondition DcmEncapsulatedDocument::createHeader | ( | DcmItem * | dataset,
|  | OFLogger & | logger )

Includes basic information into the DICOM file.

Parameters

  dataset | a reference to a DcmItem containing the information to be included.
  logger | The logger of the application calling this method.

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ createIdentifiers()

OFCondition DcmEncapsulatedDocument::createIdentifiers | ( | OFLogger & | appLogger | ) |

Get study or series data from provided file.

Generate UID if none present.

Parameters

  appLogger | The logger of the application calling this method.

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ getCDAData()

int DcmEncapsulatedDocument::getCDAData | ( | const char * | filename,
|  | OFLogger & | appLogger )

Retrieves patient, concept and document data from the CDA file and checks for data conflicts with series, study and user input.

It also retrieves all mediatypes found in the CDA document.

Parameters

  filename | The filename of the CDA document.
  appLogger | The logger of the application calling this method.

Returns
  EXITCODE_NO_ERROR (0) if successful or error code in case of failure.

## ◆ getFileType()

OFString DcmEncapsulatedDocument::getFileType | ( |  | ) |

Returns the current filetype.

Returns
  the current filetype as OFString.

## ◆ getInputFileName()

OFString DcmEncapsulatedDocument::getInputFileName | ( |  | ) |

Returns the input file name.

Returns
  the input file name as OFString.

## ◆ getOutputFileName()

OFString DcmEncapsulatedDocument::getOutputFileName | ( |  | ) |

Returns the output file name.

Returns
  the output file name as OFString.

## ◆ getTransferSyntax()

E_TransferSyntax DcmEncapsulatedDocument::getTransferSyntax | ( |  | ) |

Returns the transfer syntax.

Returns
  the transfer syntax as E_TransferSyntax.

## ◆ insertEncapsulatedDocument()

int DcmEncapsulatedDocument::insertEncapsulatedDocument | ( | DcmItem * | dataset,
|  | OFLogger & | logger )

Correctly inserts encapsulated document data.

Parameters

  dataset | The dataset to which we should encapsulate this document.
  logger | The logger of the application calling this method.

Returns
  EXITCODE_NO_ERROR (0) if successful or error code in case of failure.

## ◆ parseArguments()

void DcmEncapsulatedDocument::parseArguments | ( | OFConsoleApplication & | app,
|  | OFCommandLine & | cmd )

Parse and evaluate the given command line arguments.

Parameters

  app | a reference to an OFConsoleApplication object used in the calling application.
  cmd | a reference to an OFCommandLine object used to parse the command line argument give to the calling application.

Returns
  none.

## ◆ saveFile()

OFCondition DcmEncapsulatedDocument::saveFile | ( | DcmFileFormat | fileformat | ) |

Attempt to save the output file .

Parameters

  fileformat | the DICOM Fileformat including the output file params.

Returns
  Error code as condition, if error occurs, EC_Normal otherwise.

## ◆ setFileType()

void DcmEncapsulatedDocument::setFileType | ( | OFString | fType | ) |

Sets the current filetype.

Parameters

  fType | the current filetype.

Returns
  none.

## ◆ setInputFileName()

void DcmEncapsulatedDocument::setInputFileName | ( | OFString | fName | ) |

Sets the input file name to the given string.

Parameters

  fName | the file name to be set.

Returns
  none.

## ◆ setOutputFileName()

void DcmEncapsulatedDocument::setOutputFileName | ( | OFString | fName | ) |

Sets the output file name.

Parameters

  fName | the file name to be set.

Returns
  none.

## ◆ setOverrideKeys()

void DcmEncapsulatedDocument::setOverrideKeys | ( | const OFList< OFString > & | ovkeys | ) |

Specifies some attributes that should be inserted after encapsulation They will override any identical attributes already existing in the resulting encapsulated DICOM object.

The override keys are applied at the very end of the conversion and do not undergo any validity checking.

Parameters

  ovkeys | override keys that can be tags, dictionary names and paths (see DcmPath for syntax). Also it is permitted to set a value if appropriate, e. g. "PatientName=Doe^John" would be a valid overridekey.

Returns
  none.

## ◆ XMLgetAllAttributeValues()

OFString DcmEncapsulatedDocument::XMLgetAllAttributeValues | ( | XMLNode | fileNode,
|  | OFString | attr )

This function is only used to process CDA files.

It retrieves all entries of an attribute and returns them separated by backslashes.

Parameters

  fileNode | the root XML node.
  attr | the attribute to search for.

Returns
  OFstring containing all entries found, separated by double backslashes

## ◆ XMLgetAttribute()

OFString DcmEncapsulatedDocument::XMLgetAttribute | ( | XMLNode | fileNode,
|  | DcmTagKey | attr )

This function is only used to process CDA files.

It retrieves the value from the CDA document corresponding to the DCM Tag. According to Standard v. 2013 part20/sect_A.8.

Parameters

  fileNode | the root XML node.
  attr | the tag to search for in the CDA file.

Returns
  OFstring containing the value of the corresponding tag.

## ◆ XMLsearchAttribute()

OFBool DcmEncapsulatedDocument::XMLsearchAttribute | ( | XMLNode | currnode,
|  | OFList< OFString > * | results,
|  | OFString | attr )

Recursive function used by getAttributeValues to get all occurrences of an attribute as list.

Parameters

  currnode | the current XML node to be processed.
  results | a pointer to the list of strings where the results should be stored.
  attr | the attribute to search for.

Returns
  OFTrue if the attribute value was found, OFFalse otherwise.

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

- dcmdata/include/dcmtk/dcmdata/dcencdoc.h

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