DCMTK  Version 3.6.6
OFFIS DICOM Toolkit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DcmMetaInfo Class Reference

a class representing the DICOM file meta information header More...

+ Inheritance diagram for DcmMetaInfo:

Public Member Functions

 DcmMetaInfo ()
 default constructor
 
 DcmMetaInfo (const DcmMetaInfo &old)
 copy constructor More...
 
DcmMetaInfooperator= (const DcmMetaInfo &obj)
 assignment operator. More...
 
virtual ~DcmMetaInfo ()
 destructor
 
virtual DcmObjectclone () const
 clone method More...
 
virtual OFCondition copyFrom (const DcmObject &rhs)
 Virtual object copying. More...
 
virtual DcmEVR ident () const
 get type identifier More...
 
virtual void removeInvalidGroups ()
 remove all elements with an invalid group number, i.e. More...
 
E_TransferSyntax getOriginalXfer () const
 return the transfer syntax in which this dataset was originally read. More...
 
virtual void print (STD_NAMESPACE ostream &out, const size_t flags=0, const int level=0, const char *pixelFileName=NULL, size_t *pixelCounter=NULL)
 print meta information header to a stream More...
 
virtual void transferInit ()
 initialize the transfer state of this object. More...
 
virtual void transferEnd ()
 finalize the transfer state of this object. More...
 
virtual Uint32 calcElementLength (const E_TransferSyntax xfer, const E_EncodingType enctype)
 calculate the length of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences. More...
 
virtual OFCondition read (DcmInputStream &inStream, const E_TransferSyntax xfer=EXS_Unknown, const E_GrpLenEncoding glenc=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
 read object from a stream. More...
 
virtual OFCondition write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
 write meta information header to a stream More...
 
virtual OFCondition writeXML (STD_NAMESPACE ostream &out, const size_t flags=0)
 write object in XML format More...
 
virtual OFCondition writeJson (STD_NAMESPACE ostream &out, DcmJsonFormat &format)
 write object in JSON format More...
 
virtual OFCondition loadFile (const OFFilename &fileName, const E_TransferSyntax readXfer=EXS_Unknown, const E_GrpLenEncoding groupLength=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
 load object from a DICOM file. More...
 
- Public Member Functions inherited from DcmItem
 DcmItem ()
 default constructor
 
 DcmItem (const DcmTag &tag, const Uint32 len=0)
 constructor. More...
 
 DcmItem (const DcmItem &old)
 copy constructor More...
 
DcmItemoperator= (const DcmItem &obj)
 assignment operator. More...
 
virtual int compare (const DcmItem &rhs) const
 comparison operator that compares the value of this object with a given object of the same type. More...
 
virtual ~DcmItem ()
 destructor
 
virtual unsigned long getVM ()
 get value multiplicity More...
 
virtual unsigned long getNumberOfValues ()
 get number of values (elements) stored in this item. More...
 
virtual unsigned long card () const
 get cardinality of this item More...
 
virtual OFBool isLeaf () const
 check if this element is a leaf node in a dataset tree. More...
 
virtual OFBool isNested () const
 check if this item is nested in a sequence of items, i.e. not a top-level or stand-alone item/dataset More...
 
virtual Uint32 getLength (const E_TransferSyntax xfer=EXS_LittleEndianImplicit, const E_EncodingType enctype=EET_UndefinedLength)
 calculate the value length (without attribute tag, VR and length field) of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences. More...
 
virtual DcmItemgetParentItem ()
 get parent item of this object, i.e. the item/dataset in which the surrounding sequence element is stored. More...
 
virtual OFBool canWriteXfer (const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer)
 check if this DICOM object can be encoded in the given transfer syntax. More...
 
virtual OFCondition readUntilTag (DcmInputStream &inStream, const E_TransferSyntax ixfer, const E_GrpLenEncoding glenc=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength, const DcmTagKey &stopParsingAtElement=DCM_UndefinedTagKey)
 This function reads the information of all attributes which are captured in the input stream and captures this information in elementList, up to the attribute tag stopParsingAtElement. More...
 
virtual OFCondition writeJsonExt (STD_NAMESPACE ostream &out, DcmJsonFormat &format, OFBool printBraces, OFBool printNewline)
 write object in JSON format and control whether the output is encapsulated in braces More...
 
virtual OFCondition writeSignatureFormat (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
 special write method for creation of digital signatures More...
 
virtual OFBool containsUnknownVR () const
 returns true if the object contains an element with Unknown VR at any nesting level More...
 
virtual OFBool containsExtendedCharacters (const OFBool checkAllStrings=OFFalse)
 check if this object contains non-ASCII characters at any nesting level. More...
 
virtual OFBool isAffectedBySpecificCharacterSet () const
 check if this object is affected by SpecificCharacterSet at any nesting level. More...
 
virtual OFBool checkForSpecificCharacterSet () const
 mode specifying whether the SpecificCharacterSet (0008,0005) element should be checked by convertCharacterSet() or not, i.e. whether this element might be present on this dataset-level. More...
 
virtual OFCondition convertCharacterSet (const OFString &fromCharset, const OFString &toCharset, const size_t flags=0, const OFBool updateCharset=OFFalse)
 convert all element values that are contained in this item and that are affected by SpecificCharacterSet from the given source character set to the given destination character set. More...
 
virtual OFCondition convertCharacterSet (const OFString &toCharset, const size_t flags=0, const OFBool ignoreCharset=OFFalse)
 convert all element values that are contained in this item and that are affected by SpecificCharacterSet to the given destination character set. More...
 
virtual OFCondition convertCharacterSet (DcmSpecificCharacterSet &converter)
 convert all element values that are contained in this item and that are affected by SpecificCharacterSet from the currently selected source character set to the currently selected destination character set More...
 
virtual OFCondition convertToUTF8 ()
 convert all element values that are contained in this item and that are affected by SpecificCharacterSet to UTF-8 (Unicode). More...
 
virtual OFCondition insert (DcmElement *elem, OFBool replaceOld=OFFalse, OFBool checkInsertOrder=OFFalse)
 insert a new element into the list of elements maintained by this item. More...
 
virtual DcmElementgetElement (const unsigned long num)
 access an element from the item. More...
 
virtual OFCondition nextObject (DcmStack &stack, const OFBool intoSub)
 this method enables a stack based, depth-first traversal of a complete hierarchical DICOM dataset (that is, classes derived from DcmItem or DcmSequenceOfItems). More...
 
virtual DcmObjectnextInContainer (const DcmObject *obj)
 this method is only used in container classes, that is, DcmItem and DcmSequenceOfItems. More...
 
virtual DcmElementremove (const unsigned long num)
 remove element from list. More...
 
virtual DcmElementremove (DcmObject *elem)
 remove element from list. More...
 
virtual DcmElementremove (const DcmTagKey &tag)
 remove element from list. More...
 
virtual OFBool isEmpty (const OFBool normalize=OFTrue)
 check if this item is empty More...
 
virtual OFCondition clear ()
 clear (remove) all attributes from item and delete them from memory. More...
 
virtual OFCondition verify (const OFBool autocorrect=OFFalse)
 check the currently stored element value More...
 
virtual OFCondition search (const DcmTagKey &xtag, DcmStack &resultStack, E_SearchMode mode=ESM_fromHere, OFBool searchIntoSub=OFTrue)
 a complex, stack-based, hierarchical search method. More...
 
virtual OFCondition loadAllDataIntoMemory ()
 this method loads all attribute values maintained by this object and all sub-objects (in case of a container such as DcmDataset) into memory. More...
 
virtual void compactElements (const Uint32 maxLength)
 iterate over all elements and remove those element values from memory which exceed a given length and which can be loaded from file when needed again. More...
 
virtual OFCondition computeGroupLengthAndPadding (const E_GrpLenEncoding glenc, const E_PaddingEncoding padenc=EPD_noChange, const E_TransferSyntax xfer=EXS_Unknown, const E_EncodingType enctype=EET_ExplicitLength, const Uint32 padlen=0, const Uint32 subPadlen=0, Uint32 instanceLength=0)
 This function takes care of group length and padding elements in the current element list according to what is specified in glenc and padenc. More...
 
OFBool tagExists (const DcmTagKey &key, OFBool searchIntoSub=OFFalse)
 check if an element with the given attribute tag exists in the dataset More...
 
OFBool tagExistsWithValue (const DcmTagKey &key, OFBool searchIntoSub=OFFalse)
 check if an element with the given attribute tag exists in the dataset and has a non-empty value More...
 
OFCondition findAndGetElement (const DcmTagKey &tagKey, DcmElement *&element, const OFBool searchIntoSub=OFFalse, const OFBool createCopy=OFFalse)
 find element and get a pointer to it (or copy it). More...
 
OFCondition findAndGetElements (const DcmTagKey &tagKey, DcmStack &resultStack)
 find all elements matching a particular tag and return references to them on a stack. More...
 
OFCondition findAndGetString (const DcmTagKey &tagKey, const char *&value, const OFBool searchIntoSub=OFFalse)
 find element and get value as a reference to a C string. More...
 
OFCondition findAndGetString (const DcmTagKey &tagKey, const char *&value, Uint32 &length, const OFBool searchIntoSub=OFFalse)
 find element and get value as a reference to a C string. More...
 
OFCondition findAndGetOFString (const DcmTagKey &tagKey, OFString &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as a C++ string (only one component). More...
 
OFCondition findAndGetOFStringArray (const DcmTagKey &tagKey, OFString &value, const OFBool searchIntoSub=OFFalse)
 find element and get value as a C++ string (all components). More...
 
OFCondition findAndGetUint8 (const DcmTagKey &tagKey, Uint8 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as an unsigned 8-bit integer. More...
 
OFCondition findAndGetUint8Array (const DcmTagKey &tagKey, const Uint8 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of unsigned 8-bit integers. More...
 
OFCondition findAndGetUint16 (const DcmTagKey &tagKey, Uint16 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as an unsigned 16-bit integer. More...
 
OFCondition findAndGetUint16Array (const DcmTagKey &tagKey, const Uint16 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of unsigned 16-bit integers. More...
 
OFCondition findAndGetSint16 (const DcmTagKey &tagKey, Sint16 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as a signed 16-bit integer. More...
 
OFCondition findAndGetSint16Array (const DcmTagKey &tagKey, const Sint16 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of signed 16-bit integers. More...
 
OFCondition findAndGetUint32 (const DcmTagKey &tagKey, Uint32 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as an unsigned 32-bit integer. More...
 
OFCondition findAndGetUint32Array (const DcmTagKey &tagKey, const Uint32 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of unsigned 32-bit integers. More...
 
OFCondition findAndGetSint32 (const DcmTagKey &tagKey, Sint32 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as a signed 32-bit integer. More...
 
OFCondition findAndGetSint32Array (const DcmTagKey &tagKey, const Sint32 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of signed 32-bit integers. More...
 
OFCondition findAndGetUint64 (const DcmTagKey &tagKey, Uint64 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as an unsigned 64-bit integer. More...
 
OFCondition findAndGetUint64Array (const DcmTagKey &tagKey, const Uint64 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of unsigned 64-bit integers. More...
 
OFCondition findAndGetSint64 (const DcmTagKey &tagKey, Sint64 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as a signed 64-bit integer. More...
 
OFCondition findAndGetSint64Array (const DcmTagKey &tagKey, const Sint64 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of signed 64-bit integers. More...
 
OFCondition findAndGetLongInt (const DcmTagKey &tagKey, long int &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as a (signed) long integer. More...
 
OFCondition findAndGetFloat32 (const DcmTagKey &tagKey, Float32 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as a 32-bit floating point. More...
 
OFCondition findAndGetFloat32Array (const DcmTagKey &tagKey, const Float32 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of 32-bit floating point values. More...
 
OFCondition findAndGetFloat64 (const DcmTagKey &tagKey, Float64 &value, const unsigned long pos=0, const OFBool searchIntoSub=OFFalse)
 find element and get value as a 64-bit floating point. More...
 
OFCondition findAndGetFloat64Array (const DcmTagKey &tagKey, const Float64 *&value, unsigned long *count=NULL, const OFBool searchIntoSub=OFFalse)
 find element and get value as an array of 64-bit floating point values. More...
 
OFCondition findAndGetSequence (const DcmTagKey &seqTagKey, DcmSequenceOfItems *&sequence, const OFBool searchIntoSub=OFFalse, const OFBool createCopy=OFFalse)
 looks up and returns a given sequence. More...
 
OFCondition findAndGetSequenceItem (const DcmTagKey &seqTagKey, DcmItem *&item, const signed long itemNum=0, const OFBool createCopy=OFFalse)
 looks up and returns a given sequence item, if it exists. More...
 
OFCondition findOrCreateSequenceItem (const DcmTag &seqTag, DcmItem *&item, const signed long itemNum=0)
 looks up the given sequence in the current dataset and returns the given item. More...
 
OFCondition findAndInsertCopyOfElement (const DcmTagKey &tagKey, DcmItem *destItem, const OFBool replaceOld=OFTrue)
 find element, create a copy and insert it into the given destination dataset. More...
 
OFCondition findAndDeleteElement (const DcmTagKey &tagKey, const OFBool allOccurrences=OFFalse, const OFBool searchIntoSub=OFFalse)
 find element, remove it from the dataset and free the associated memory. More...
 
OFCondition findAndDeleteSequenceItem (const DcmTagKey &seqTagKey, const signed long itemNum)
 looks up the given sequence in the current dataset and deletes the given item. More...
 
OFCondition putAndInsertString (const DcmTag &tag, const char *value, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertString (const DcmTag &tag, const char *value, const Uint32 length, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertOFStringArray (const DcmTag &tag, const OFString &value, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertUint8Array (const DcmTag &tag, const Uint8 *value, const unsigned long count, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertUint16 (const DcmTag &tag, const Uint16 value, const unsigned long pos=0, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertUint16Array (const DcmTag &tag, const Uint16 *value, const unsigned long count, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertSint16 (const DcmTag &tag, const Sint16 value, const unsigned long pos=0, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertSint16Array (const DcmTag &tag, const Sint16 *value, const unsigned long count, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertUint32 (const DcmTag &tag, const Uint32 value, const unsigned long pos=0, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertUint32Array (const DcmTag &tag, const Uint32 *value, const unsigned long count, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertSint32 (const DcmTag &tag, const Sint32 value, const unsigned long pos=0, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertFloat32 (const DcmTag &tag, const Float32 value, const unsigned long pos=0, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertFloat32Array (const DcmTag &tag, const Float32 *value, const unsigned long count, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertFloat64 (const DcmTag &tag, const Float64 value, const unsigned long pos=0, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertFloat64Array (const DcmTag &tag, const Float64 *value, const unsigned long count, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition putAndInsertTagKey (const DcmTag &tag, const DcmTagKey &value, const unsigned long pos=0, const OFBool replaceOld=OFTrue)
 create a new element, put specified value to it and insert the element into the dataset/item. More...
 
OFCondition insertEmptyElement (const DcmTag &tag, const OFBool replaceOld=OFTrue)
 create a new element (with no value) and insert it into the dataset/item. More...
 
OFCondition insertSequenceItem (const DcmTag &seqTag, DcmItem *item, const signed long itemNum=-2)
 looks up the given sequence in the current dataset and inserts the given item. More...
 
- Public Member Functions inherited from DcmObject
 DcmObject (const DcmTag &tag, const Uint32 len=0)
 constructor. More...
 
 DcmObject (const DcmObject &obj)
 copy constructor More...
 
virtual ~DcmObject ()
 destructor
 
DcmObjectoperator= (const DcmObject &obj)
 copy assignment operator More...
 
DcmEVR getVR () const
 return the value representation assigned to this object. More...
 
OFBool isaString () const
 check if this element is a string type, based on the VR. More...
 
E_TransferState transferState () const
 return the current transfer (read/write) state of this object. More...
 
DcmItemgetRootItem ()
 get root dataset/item (top-level) that contains this object. More...
 
DcmObjectgetParent ()
 get parent of this object. More...
 
const DcmObjectgetParent () const
 get parent of this object. More...
 
void setParent (DcmObject *parent)
 set parent of this object. More...
 
Uint16 getGTag () const
 return the group number of the attribute tag for this object More...
 
Uint16 getETag () const
 return the element number of the attribute tag for this object More...
 
const DcmTaggetTag () const
 return const reference to the attribute tag for this object More...
 
void setGTag (Uint16 gtag)
 assign group tag (but not element tag) of the attribute tag for this object. More...
 
virtual OFCondition setVR (DcmEVR)
 assign a new Value Representation (VR) to this object. More...
 
virtual OFBool isSignable () const
 returns true if the current object may be included in a digital signature More...
 
Uint32 getLengthField () const
 return the current value of the Length field (which is different from the functionality of the public getLength() method). More...
 

Private Member Functions

void setPreamble ()
 initialize the preamble buffer with 128 zero bytes followed by "DICM"
 
OFBool checkAndReadPreamble (DcmInputStream &inStream, E_TransferSyntax &newxfer)
 check if the next 132 bytes in the input stream are a preamble followed by the DICOM "magic word" DICM. More...
 
OFBool nextTagIsMeta (DcmInputStream &inStream)
 peeks into the input stream and checks whether the next element is group 0002, i.e. More...
 
OFCondition readGroupLength (DcmInputStream &inStream, const E_TransferSyntax xfer, const DcmTagKey &xtag, const E_GrpLenEncoding glenc, Uint32 &headerLen, Uint32 &bytesRead, const Uint32 maxReadLength=DCM_MaxReadLength)
 read meta-header group length element which is important because it tells us where to switch from meta-header transfer syntax to dataset transfer syntax. More...
 

Private Attributes

char filePreamble [DCM_PreambleLen+DCM_MagicLen]
 buffer for 132 byte DICOM file preamble
 
OFBool preambleUsed
 true if the preamble was read from stream
 
E_TransferState fPreambleTransferState
 transfer state of the preamble
 
E_TransferSyntax Xfer
 transfer syntax in which the meta-header was read
 

Additional Inherited Members

- Static Public Member Functions inherited from DcmItem
static DcmElementnewDicomElement (const DcmTagKey &tag, const char *privateCreator=NULL)
 creates new DICOM element from given attribute tag. More...
 
static OFCondition newDicomElement (DcmElement *&newElement, const DcmTagKey &tag, const char *privateCreator=NULL)
 creates new DICOM element from given attribute tag. More...
 
static OFCondition newDicomElementWithVR (DcmElement *&newElement, const DcmTag &tag)
 creates new DICOM element from given attribute tag and VR. More...
 
- Protected Member Functions inherited from DcmItem
OFCondition readTagAndLength (DcmInputStream &inStream, const E_TransferSyntax xfer, DcmTag &tag, Uint32 &length, Uint32 &bytesRead)
 This function reads tag and length information from inStream and returns this information to the caller. More...
 
OFCondition readSubElement (DcmInputStream &inStream, DcmTag &newTag, const Uint32 newLength, const E_TransferSyntax xfer, const E_GrpLenEncoding glenc, const Uint32 maxReadLength=DCM_MaxReadLength)
 This function creates a new DcmElement object on the basis of the newTag and newLength information which was passed, inserts this new element into elementList, reads the actual data value which belongs to this element (attribute) from the inStream and also assigns this information to the object which was created at the beginning. More...
 
E_TransferSyntax checkTransferSyntax (DcmInputStream &inStream)
 This function reads the first 6 bytes from the input stream and determines the transfer syntax which was used to code the information in the stream. More...
 
void checkAndUpdateVR (DcmItem &item, DcmTag &tag)
 check whether the given tag requires some special handling regarding the VR (i.e. in case it is undefined and multiple values are possible). More...
 
void updateSpecificCharacterSet (OFCondition &status, const DcmSpecificCharacterSet &converter)
 update the SpecificCharacterSet (0008,0005) element depending on the given parameters. More...
 
- Protected Member Functions inherited from DcmObject
void printNestingLevel (STD_NAMESPACE ostream &out, const size_t flags, const int level)
 print line indentation, e.g. a couple of spaces for each nesting level. More...
 
void printInfoLineStart (STD_NAMESPACE ostream &out, const size_t flags, const int level, DcmTag *tag=NULL)
 print beginning of the info line. More...
 
void printInfoLineEnd (STD_NAMESPACE ostream &out, const size_t flags, const unsigned long printedLength=0xffffffff, DcmTag *tag=NULL)
 print end of the info line. More...
 
virtual void printInfoLine (STD_NAMESPACE ostream &out, const size_t flags, const int level=0, const char *info=NULL, DcmTag *tag=NULL, const OFBool isInfo=OFTrue)
 print given text with element information. More...
 
virtual OFCondition writeTagAndLength (DcmOutputStream &outStream, const E_TransferSyntax oxfer, Uint32 &writtenBytes) const
 write tag, VR and length field to the given output stream More...
 
virtual Uint32 getTagAndLengthSize (const E_TransferSyntax oxfer) const
 return the number of bytes needed to serialize the tag, VR and length information of the current object using the given transfer syntax. More...
 
const char * getTagName ()
 return the DICOM attribute tag name for this object. More...
 
void setTagVR (DcmEVR vr)
 set the VR for this attribute More...
 
E_TransferState getTransferState () const
 return the current transfer state of this object during serialization/deserialization More...
 
void setTransferState (E_TransferState newState)
 set the current transfer state of this object during serialization/deserialization More...
 
Uint32 getTransferredBytes () const
 return the number of transferred bytes for this object during serialization/deserialization More...
 
void setTransferredBytes (Uint32 val)
 set the number of transferred bytes for this object during serialization/deserialization More...
 
void incTransferredBytes (Uint32 val)
 add to the number of transferred bytes for this object during serialization/deserialization More...
 
void setLengthField (Uint32 val)
 set the current value of the Length field More...
 
- Static Protected Member Functions inherited from DcmItem
static OFCondition newDicomElement (DcmElement *&newElement, DcmTag &tag, const Uint32 length, DcmPrivateTagCache *privateCreatorCache, OFBool &readAsUN)
 creates new DICOM element from given attribute tag. More...
 
- Static Protected Member Functions inherited from DcmObject
static OFCondition writeTag (DcmOutputStream &outStream, const DcmTag &tag, const E_TransferSyntax oxfer)
 static helper function that writes a given attribute tag to a binary output stream using the byte order indicated by the transfer syntax. More...
 
- Protected Attributes inherited from DcmItem
DcmListelementList
 the list of elements maintained by this object
 
OFBool lastElementComplete
 flag used during suspended I/O. More...
 
offile_off_t fStartPosition
 used during reading. More...
 
- Protected Attributes inherited from DcmObject
OFCondition errorFlag
 error flag for this object.
 

Detailed Description

a class representing the DICOM file meta information header

Constructor & Destructor Documentation

◆ DcmMetaInfo()

DcmMetaInfo::DcmMetaInfo ( const DcmMetaInfo old)

copy constructor

Parameters
olditem to be copied

Member Function Documentation

◆ calcElementLength()

virtual Uint32 DcmMetaInfo::calcElementLength ( const E_TransferSyntax  xfer,
const E_EncodingType  enctype 
)
virtual

calculate the length of this DICOM element when encoded with the given transfer syntax and the given encoding type for sequences.

For elements, the length includes the length of the tag, length field, VR field and the value itself, for items and sequences it returns the length of the complete item or sequence including delimitation tags if applicable.

Warning
Since calcElementLength() returns a 32 bit integer, an overflow during calculation is possible for some derived classes that actually represent a compound value (e.g. items like DcmPixelItem). Such overflows will be detected, in which case the maximum possible value will be returned instead, coinciding with DCM_UndefinedLength.
The implementation in DcmPixelData may return zero if no conforming representation exists and set the EC_RepresentationNotFound error flag to indicated it.
When calculation the length of a sequence or an item containing multiple attributes, the implementation may return DCM_UndefinedLength to indicate a value that can not be encoded as a 32 bit length field. It will even do so if "dcmWriteOversizedSeqsAndItemsUndefined" is disabled, but then also set the EC_SeqOrItemContentOverflow error flag (inside getLength()) to indicated it.
Note
Just check for zero or DCM_UndefinedLength return value and then have a look at the error flag in either case.
Parameters
xfertransfer syntax for length calculation
enctypesequence encoding type for length calculation
Returns
length of DICOM element

Reimplemented from DcmItem.

◆ checkAndReadPreamble()

OFBool DcmMetaInfo::checkAndReadPreamble ( DcmInputStream inStream,
E_TransferSyntax newxfer 
)
private

check if the next 132 bytes in the input stream are a preamble followed by the DICOM "magic word" DICM.

If so, try to determine the transfer syntax of the meta-header and return in parameter newxfer. If not, reset stream to start position.

Parameters
inStreaminput stream, should be at start position
newxferas input parameter contains the expected transfer syntax, as output parameter returns the real transfer syntax of the meta-header as determined heuristically
Returns
true if meta-header found and read, false otherwise

◆ clone()

virtual DcmObject* DcmMetaInfo::clone ( ) const
inlinevirtual

clone method

Returns
deep copy of this object

Reimplemented from DcmItem.

◆ copyFrom()

virtual OFCondition DcmMetaInfo::copyFrom ( const DcmObject rhs)
virtual

Virtual object copying.

This method can be used for DcmObject and derived classes to get a deep copy of an object. Internally the assignment operator is called if the given DcmObject parameter is of the same type as "this" object instance. If not, an error is returned. This function permits copying an object by value in a virtual way which therefore is different to just calling the assignment operator of DcmElement which could result in slicing the object.

Parameters
rhs- [in] The instance to copy from. Has to be of the same class type as "this" object
Returns
EC_Normal if copying was successful, error otherwise

Reimplemented from DcmItem.

◆ getOriginalXfer()

E_TransferSyntax DcmMetaInfo::getOriginalXfer ( ) const

return the transfer syntax in which this dataset was originally read.

Returns
transfer syntax in which this dataset was originally read, EXS_Unknown if the dataset was created in memory

◆ ident()

virtual DcmEVR DcmMetaInfo::ident ( ) const
virtual

get type identifier

Returns
type identifier of this class (EVR_item)

Reimplemented from DcmItem.

◆ loadFile()

virtual OFCondition DcmMetaInfo::loadFile ( const OFFilename fileName,
const E_TransferSyntax  readXfer = EXS_Unknown,
const E_GrpLenEncoding  groupLength = EGL_noChange,
const Uint32  maxReadLength = DCM_MaxReadLength 
)
virtual

load object from a DICOM file.

If the file preamble is missing, an error is returned.

Parameters
fileNamename of the file to load (may contain wide chars if support enabled). Since there are various constructors for the OFFilename class, a "char *", "OFString" or "wchar_t *" can also be passed directly to this parameter.
readXfertransfer syntax used to read the data (auto detection if EXS_Unknown)
groupLengthflag, specifying how to handle the group length tags
maxReadLengthmaximum number of bytes to be read for an element value. Element values with a larger size are not loaded until their value is retrieved (with getXXX()) or loadAllDataIntoMemory() is called.
Returns
status, EC_Normal if successful, an error code otherwise

◆ nextTagIsMeta()

OFBool DcmMetaInfo::nextTagIsMeta ( DcmInputStream inStream)
private

peeks into the input stream and checks whether the next element is group 0002, i.e.

belongs to the meta-header

Parameters
inStreaminput stream
Returns
true if next element is part of meta-header, false otherwise

◆ operator=()

DcmMetaInfo& DcmMetaInfo::operator= ( const DcmMetaInfo obj)

assignment operator.

Parameters
objthe metainfo to be copied
Returns
reference to this object

◆ print()

virtual void DcmMetaInfo::print ( STD_NAMESPACE ostream &  out,
const size_t  flags = 0,
const int  level = 0,
const char *  pixelFileName = NULL,
size_t *  pixelCounter = NULL 
)
virtual

print meta information header to a stream

Parameters
outoutput stream
flagsoptional flag used to customize the output (see DCMTypes::PF_xxx)
levelcurrent level of nested items. Used for indentation.
pixelFileNamenot used
pixelCounternot used

Reimplemented from DcmItem.

◆ read()

virtual OFCondition DcmMetaInfo::read ( DcmInputStream inStream,
const E_TransferSyntax  xfer = EXS_Unknown,
const E_GrpLenEncoding  glenc = EGL_noChange,
const Uint32  maxReadLength = DCM_MaxReadLength 
)
virtual

read object from a stream.

Parameters
inStreamDICOM input stream
xfertransfer syntax to use when parsing. EXS_Unknown will lead to reading the preamble (if any) and parsing metaheader using detected transfer syntax, usually Explicit VR Little Endian.
glenchandling of group length parameters
maxReadLengthattribute values larger than this value are skipped while parsing and read later upon first access if the stream type supports this.
Returns
EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.

◆ readGroupLength()

OFCondition DcmMetaInfo::readGroupLength ( DcmInputStream inStream,
const E_TransferSyntax  xfer,
const DcmTagKey xtag,
const E_GrpLenEncoding  glenc,
Uint32 &  headerLen,
Uint32 &  bytesRead,
const Uint32  maxReadLength = DCM_MaxReadLength 
)
private

read meta-header group length element which is important because it tells us where to switch from meta-header transfer syntax to dataset transfer syntax.

Insert element into dataset

Parameters
inStreaminput stream
xfertransfer syntax of meta-header
xtagattribute tag for group length
glenchandling of group length encoding element in dataset
headerLenoutput parameter; length of meta-header as encoded in group length element
bytesReadoutput parameter; number of bytes read when reading group length (for counting the remaining number of meta-header bytes)
maxReadLengthmax read length for elements
Returns
EC_Normal if successful, an error code otherwise

◆ removeInvalidGroups()

virtual void DcmMetaInfo::removeInvalidGroups ( )
virtual

remove all elements with an invalid group number, i.e.

everything but 0x0002

◆ transferEnd()

virtual void DcmMetaInfo::transferEnd ( )
virtual

finalize the transfer state of this object.

This method must be called when reading/writing this object from/to a stream has been completed.

Reimplemented from DcmItem.

◆ transferInit()

virtual void DcmMetaInfo::transferInit ( )
virtual

initialize the transfer state of this object.

This method must be called before this object is written to a stream or read (parsed) from a stream.

Reimplemented from DcmItem.

◆ write()

virtual OFCondition DcmMetaInfo::write ( DcmOutputStream outStream,
const E_TransferSyntax  oxfer,
const E_EncodingType  enctype,
DcmWriteCache wcache 
)
virtual

write meta information header to a stream

Parameters
outStreamDICOM output stream
oxferoutput transfer syntax
enctypeencoding types (undefined or explicit length)
wcachepointer to write cache object, may be NULL
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.

◆ writeJson()

virtual OFCondition DcmMetaInfo::writeJson ( STD_NAMESPACE ostream &  out,
DcmJsonFormat format 
)
virtual

write object in JSON format

Parameters
outoutput stream to which the JSON document is written
formatused to format and customize the output
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.

◆ writeXML()

virtual OFCondition DcmMetaInfo::writeXML ( STD_NAMESPACE ostream &  out,
const size_t  flags = 0 
)
virtual

write object in XML format

Parameters
outoutput stream to which the XML document is written
flagsoptional flag used to customize the output (see DCMTypes::XF_xxx)
Returns
status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.


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