DCMTK  Version 3.6.7
OFFIS DICOM Toolkit
Classes | Functions | Variables
dcobject.h File Reference

interface to DICOM object/dataset handling More...

Classes

class  DcmObject
 Abstract base class for most classes in module dcmdata. More...
 
class  DcmObject::PrintHelper
 helper class to print a DcmObject to an ostream using operator<< More...
 

Functions

static STD_NAMESPACE ostream & operator<< (STD_NAMESPACE ostream &stream, DcmObject::PrintHelper obj)
 Print a DcmObject::PrintHelper to an ostream. More...
 

Variables

DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmEnableAutomaticInputDataCorrection
 This flags defines whether automatic correction should be applied to input data (e.g. stripping of padding blanks, removal of blanks in UIDs, etc). More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmAcceptOddAttributeLength
 This flag defines the handling of illegal odd-length attributes: If flag is true, odd lengths are respected (i.e. an odd number of bytes is read from the input stream.) After successful reading, padding to even number of bytes is enforced by adding a zero pad byte if dcmEnableAutomaticInputDataCorrection is true. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmEnableCP246Support
 This flag defines how UN attributes with undefined length are treated by the parser when reading. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmEnableOldSignatureFormat
 DCMTK releases up to 3.5.3 created a non-conforming byte stream as input to the MAC algorithm when creating or verifying digital signatures including compressed pixel data (i.e. signatures including attribute (7FE0,0010) in an encapsulated transfer syntax). More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmAutoDetectDatasetXfer
 This flag defines whether the transfer syntax for uncompressed datasets is detected automatically. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmAcceptUnexpectedImplicitEncoding
 This flag defines how non-standard VRs are treated by the parser when reading. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmPreferVRFromDataDictionary
 This flag defines how the element's VR is treated by the parser when reading from a dataset with explicit VR encoding. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmPreferLengthFieldSizeFromDataDictionary
 This flag defines how the element's length field is interpreted when reading from a dataset with explicit VR encoding and the data dictionary doesn't agree with the VR from the dataset. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmReadImplPrivAttribMaxLengthAsSQ
 This flag indicates, whether private attributes with implicit transfer syntax having a maximum length should be handled as sequences (ignoring any dictionary entries for that tag). More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmIgnoreParsingErrors
 This flag indicates, whether parsing errors during reading should be ignored, i.e. whether the parser should try to recover and parse the rest of the stream. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< DcmTagKeydcmStopParsingAfterElement
 This flag indicates, whether parsing should stop after a certain element in the stream was parsed. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmWriteOversizedSeqsAndItemsUndefined
 This flag influences behaviour when writing a dataset with items and sequences set to be encoded with explicit length. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmIgnoreFileMetaInformationGroupLength
 This flag allows for ignoring the value of (0002,0000) File Meta Information Group Length which is useful in cases where this value is incorrect. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmReplaceWrongDelimitationItem
 This flag enables the replacement of a wrong delimitation item at the end of a sequence or item. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmConvertUndefinedLengthOBOWtoSQ
 This flag enables the "silent" conversion of illegal OB/OW elements with undefined length (other than PixelData) to SQ elements while reading. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmConvertVOILUTSequenceOWtoSQ
 This flag enables the "silent" conversion of incorrectly encoded VOI LUT Sequence elements with VR=OW and explicit length into a sequence. More...
 
DCMTK_DCMDATA_EXPORT OFGlobal< OFBool > dcmUseExplLengthPixDataForEncTS
 This flag influences the behaviour when reading Pixel Data elements. More...
 

Detailed Description

interface to DICOM object/dataset handling

Function Documentation

◆ operator<<()

static STD_NAMESPACE ostream& operator<< ( STD_NAMESPACE ostream &  stream,
DcmObject::PrintHelper  obj 
)
inlinestatic

Print a DcmObject::PrintHelper to an ostream.

Parameters
streamstream to print to
objobject which will be print()ed
Returns
the stream argument

References DcmObject::print().

Variable Documentation

◆ dcmAcceptOddAttributeLength

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmAcceptOddAttributeLength
extern

This flag defines the handling of illegal odd-length attributes: If flag is true, odd lengths are respected (i.e. an odd number of bytes is read from the input stream.) After successful reading, padding to even number of bytes is enforced by adding a zero pad byte if dcmEnableAutomaticInputDataCorrection is true.

Otherwise the odd number of bytes remains as read.

If flag is false, old (pre DCMTK 3.5.2) behaviour applies: The length field implicitly incremented and an even number of bytes is read from the stream.

◆ dcmAcceptUnexpectedImplicitEncoding

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmAcceptUnexpectedImplicitEncoding
extern

This flag defines how non-standard VRs are treated by the parser when reading.

The default is to treat data element with non-standard VR as unknown. If this flag is enabled, the parser will try to read the data element with Implicit VR Little Endian transfer syntax.

◆ dcmAutoDetectDatasetXfer

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmAutoDetectDatasetXfer
extern

This flag defines whether the transfer syntax for uncompressed datasets is detected automatically.

The automatic detection has been introduced since there are (incorrectly encoded) DICOM dataset stored with a different transfer syntax than specified in the meta header.

◆ dcmConvertUndefinedLengthOBOWtoSQ

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmConvertUndefinedLengthOBOWtoSQ
extern

This flag enables the "silent" conversion of illegal OB/OW elements with undefined length (other than PixelData) to SQ elements while reading.

The default behaviour is to reject such elements with an error message.

◆ dcmConvertVOILUTSequenceOWtoSQ

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmConvertVOILUTSequenceOWtoSQ
extern

This flag enables the "silent" conversion of incorrectly encoded VOI LUT Sequence elements with VR=OW and explicit length into a sequence.

This incorrect encoding was detected "in the wild" in 2016.

◆ dcmEnableAutomaticInputDataCorrection

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmEnableAutomaticInputDataCorrection
extern

This flags defines whether automatic correction should be applied to input data (e.g. stripping of padding blanks, removal of blanks in UIDs, etc).

Default is enabled.

◆ dcmEnableCP246Support

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmEnableCP246Support
extern

This flag defines how UN attributes with undefined length are treated by the parser when reading.

The default is to expect the content of the UN element (up to and including the sequence delimitation item) to be encoded in Implicit VR Little Endian, as described in CP 246. DCMTK expects the attribute to be encoded like a DICOM sequence, i.e. the content of each item is parsed as a DICOM dataset. If the flag is disabled old (pre DCMTK 3.5.4) behaviour applies: The attribute is treated as if it was an Explicit VR SQ element.

Note that the flag only affects the read behaviour but not the write behaviour - DCMTK will never write UN elements with undefined length.

◆ dcmEnableOldSignatureFormat

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmEnableOldSignatureFormat
extern

DCMTK releases up to 3.5.3 created a non-conforming byte stream as input to the MAC algorithm when creating or verifying digital signatures including compressed pixel data (i.e. signatures including attribute (7FE0,0010) in an encapsulated transfer syntax).

This has been fixed in DCMTK 3.5.4, but this flag allows to revert to the old behavior in order to create or verify signatures that are compatible with older releases. Default is "off" (OFFalse).

◆ dcmIgnoreFileMetaInformationGroupLength

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmIgnoreFileMetaInformationGroupLength
extern

This flag allows for ignoring the value of (0002,0000) File Meta Information Group Length which is useful in cases where this value is incorrect.

If the header length is ignored, the behavior is identical to the case when no value is available (i.e. all elements are read as long as the group number is 0x0002).

◆ dcmIgnoreParsingErrors

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmIgnoreParsingErrors
extern

This flag indicates, whether parsing errors during reading should be ignored, i.e. whether the parser should try to recover and parse the rest of the stream.

This flag does not work for all parsing errors (at this time) making sense but was introduced afterwards.

◆ dcmPreferLengthFieldSizeFromDataDictionary

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmPreferLengthFieldSizeFromDataDictionary
extern

This flag defines how the element's length field is interpreted when reading from a dataset with explicit VR encoding and the data dictionary doesn't agree with the VR from the dataset.

By default, the length field is assumed to match the size of the VR in the dataset. If this flag is enabled and the tag is defined in the data dictionary, the parser will use the size for the VR from the data dictionary (and ignore the one from the dataset). This flag is, therefore, useful for reading incorrectly encoded DICOM datasets.

◆ dcmPreferVRFromDataDictionary

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmPreferVRFromDataDictionary
extern

This flag defines how the element's VR is treated by the parser when reading from a dataset with explicit VR encoding.

By default, the VR from the dataset is used. If this flag is enabled and the VR of the tag is defined in the data dictionary, the parser will use the VR from the data dictionary (and ignore the one from the dataset). This flag is, therefore, useful for reading incorrectly encoded DICOM datasets.

◆ dcmReadImplPrivAttribMaxLengthAsSQ

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmReadImplPrivAttribMaxLengthAsSQ
extern

This flag indicates, whether private attributes with implicit transfer syntax having a maximum length should be handled as sequences (ignoring any dictionary entries for that tag).

This can happen, if for example a private creator element is illegally inserted with VR SQ (undefined length and implicit coding). The parser usually would then try to parse the element with VR=LO (private creator) with maximum length, which would lead to an error. The default behaviour is to rely on the dictionary.

◆ dcmReplaceWrongDelimitationItem

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmReplaceWrongDelimitationItem
extern

This flag enables the replacement of a wrong delimitation item at the end of a sequence or item.

This is because there are incorrect systems that write a Sequence Delimitation Item (fffe,e0dd) at the end of an item or an Item Delimitation Item (fffe,e00d) at the end of a sequence. By default, no delimitation items are replaced.

◆ dcmStopParsingAfterElement

DCMTK_DCMDATA_EXPORT OFGlobal<DcmTagKey> dcmStopParsingAfterElement
extern

This flag indicates, whether parsing should stop after a certain element in the stream was parsed.

This is especially useful for datasets containing garbage at the end, usually after the Pixel Data attribute. To prevent the parser for "stumbling" over that garbage, it is possible to tell the parser to stop after a specific element. The flag is only sensitive to elements on dataset level, i.e. inside sequence any occurrence of the specified tag is ignored. Caution: Note that if Pixel Data is chosen as stop element, any attributes behind will not be parsed, e. g. any digital signature attributes coming after. Default is (0xffff,0xffff), which means that the feature is disabled.

◆ dcmUseExplLengthPixDataForEncTS

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmUseExplLengthPixDataForEncTS
extern

This flag influences the behaviour when reading Pixel Data elements.

Pixel Data in those top level datasets that are using a compression-enabled Transfer Syntax (with few exceptions such as Deflated TS), is being stored in an encapsulated way. That means DICOM requires that the Pixel Data then element uses an undefined length and internally uses a pseudo sequence structure called Pixel Sequence with Pixel items inside. If this flag is set to OFFalse (default), an error is reported when reading datasets with encapsulated Transfer Syntaxes but with Pixel Data being stored using explicit length encoding. If this flag is set to OFTrue, such an invalid Pixel Data encoding is accepted and the element is read with the given length as if it would be the case for datasets in uncompressed transfer syntaxes.

◆ dcmWriteOversizedSeqsAndItemsUndefined

DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmWriteOversizedSeqsAndItemsUndefined
extern

This flag influences behaviour when writing a dataset with items and sequences set to be encoded with explicit length.

It is possible that the content of a sequence (or item) has an encoded length greater than the maximum 32-bit value that can be written to the sequence (item) length field. If this flag is enabled (OFTrue) then the encoding of the very sequence (item) is switched to undefined length encoding. Any contained items (sequences) will be encoded explicitly if possible. Default is OFTrue, i.e. encoding is switched to implicit if maximum size of length field is exceeded.


Generated on Thu Apr 28 2022 for DCMTK Version 3.6.7 by Doxygen 1.9.1