DCMTK  Version 3.6.6
OFFIS DICOM Toolkit
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. More...
 
OFString XMLgetAttribute (XMLNode fileNode, DcmTagKey attr)
 This function is only used to process CDA files. More...
 
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. More...
 
OFBool XMLsearchAttribute (XMLNode currnode, OFList< OFString > *results, OFString attr)
 Recursive function used by getAttributeValues to get all occurrences of an attribute as list. More...
 
void addCDACommandlineOptions (OFCommandLine &cmd)
 Add CDA specific command line options to the OFCommandLine object passed to the constructor. More...
 
void addPDFCommandlineOptions (OFCommandLine &cmd)
 Add PDF specific command line options to the OFCommandLine object passed to the constructor. More...
 
void addSTLCommandlineOptions (OFCommandLine &cmd)
 Add STL specific command line options to the OFCommandLine object passed to the constructor. More...
 
void addGeneralOptions (OFCommandLine &cmd)
 Add general command line options to the OFCommandLine object passed to the constructor. More...
 
void addDocumentOptions (OFCommandLine &cmd)
 Add command line options specific for documents to the OFCommandLine object passed to the constructor. More...
 
void addOutputOptions (OFCommandLine &cmd)
 Add command line options specific for output to the OFCommandLine object passed to the constructor. More...
 
void parseArguments (OFConsoleApplication &app, OFCommandLine &cmd)
 Parse and evaluate the given command line arguments. More...
 
OFCondition createHeader (DcmItem *dataset, OFLogger &logger)
 Includes basic information into the DICOM file. More...
 
int insertEncapsulatedDocument (DcmItem *dataset, OFLogger &logger)
 Correctly inserts encapsulated document data. More...
 
OFCondition createIdentifiers (OFLogger &appLogger)
 Get study or series data from provided file. More...
 
OFCondition applyOverrideKeys (DcmDataset *outputDset)
 Copy override keys over existing keys in given dataset. More...
 
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. More...
 
OFString getInputFileName ()
 Returns the input file name. More...
 
void setInputFileName (OFString fName)
 Sets the input file name to the given string. More...
 
OFString getOutputFileName ()
 Returns the output file name. More...
 
void setOutputFileName (OFString fName)
 Sets the output file name. More...
 
OFCondition saveFile (DcmFileFormat fileformat)
 Attempt to save the output file . More...
 
E_TransferSyntax getTransferSyntax ()
 Returns the transfer syntax. More...
 
OFString getFileType ()
 Returns the current filetype. More...
 
void setFileType (OFString fType)
 Sets the current filetype. More...
 

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< OFStringopt_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
cmda 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
cmda 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
cmda 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
cmda 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
cmda 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
cmda 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
outputDsetdataset 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
dataseta reference to a DcmItem containing the information to be included.
loggerThe 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
appLoggerThe 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
filenameThe filename of the CDA document.
appLoggerThe 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
datasetThe dataset to which we should encapsulate this document.
loggerThe 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
appa reference to an OFConsoleApplication object used in the calling application.
cmda 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
fileformatthe 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
fTypethe current filetype.
Returns
none.

◆ setInputFileName()

void DcmEncapsulatedDocument::setInputFileName ( OFString  fName)

Sets the input file name to the given string.

Parameters
fNamethe file name to be set.
Returns
none.

◆ setOutputFileName()

void DcmEncapsulatedDocument::setOutputFileName ( OFString  fName)

Sets the output file name.

Parameters
fNamethe 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
ovkeysoverride 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
fileNodethe root XML node.
attrthe 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
fileNodethe root XML node.
attrthe 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
currnodethe current XML node to be processed.
resultsa pointer to the list of strings where the results should be stored.
attrthe 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:


Generated on Thu Jan 14 2021 for DCMTK Version 3.6.6 by Doxygen 1.8.18