DCMTK: DcmDirectoryRecord Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

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

a class representing a directory record dataset in a DICOMDIR. More...

Inheritance diagram for DcmDirectoryRecord:

## Public Member Functions
| DcmDirectoryRecord ()
| default constructor
| DcmDirectoryRecord (const DcmTag &tag, const Uint32 len)
| constructor.
| DcmDirectoryRecord (const E_DirRecType recordType, const char *referencedFileID, const OFFilename &sourceFileName, DcmFileFormat *fileFormat=NULL)
| constructor
| DcmDirectoryRecord (const char *recordTypeName, const char *referencedFileID, const OFFilename &sourceFileName, DcmFileFormat *fileFormat=NULL)
| constructor
| DcmDirectoryRecord (const DcmDirectoryRecord &oldDirRec)
| copy constructor
DcmDirectoryRecord & | operator= (const DcmDirectoryRecord &obj)
| assignment operator
virtual | ~DcmDirectoryRecord ()
| destructor
virtual DcmObject * | clone () const
| clone method
virtual OFCondition | copyFrom (const DcmObject &rhs)
| Virtual object copying.
virtual DcmEVR | ident () const
| return identifier for this class.
OFCondition | error () const
| returns current status flag
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.
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 record and that are affected by SpecificCharacterSet from the given source character set to the given destination character set.
virtual OFCondition | convertCharacterSet (const OFString &toCharset, const size_t flags=0, const OFBool ignoreCharset=OFFalse)
| convert all element values that are contained in this record and that are affected by SpecificCharacterSet to the given destination character set.
virtual OFCondition | convertCharacterSet (DcmSpecificCharacterSet &converter)
| convert all element values that are contained in this record and that are affected by SpecificCharacterSet from the currently selected source character set to the currently selected destination character set.
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 all elements of the item to a stream
virtual OFCondition | read (DcmInputStream &inStream, const E_TransferSyntax xfer, const E_GrpLenEncoding glenc=EGL_noChange, const Uint32 maxReadLength=DCM_MaxReadLength)
| This function reads the information of all attributes which are captured in the input stream and captures this information in elementList.
virtual OFCondition | writeXML (STD_NAMESPACE ostream &out, const size_t flags=0)
| write object in XML format
virtual OFCondition | verify (const OFBool autocorrect=OFFalse)
| check the currently stored element value
virtual OFCondition | search (const DcmTagKey &xtag, DcmStack &resultStack, E_SearchMode mode=ESM_fromHere, OFBool searchIntoSub=OFTrue)
| a complex, stack-based, hierarchical search method.
virtual E_DirRecType | getRecordType ()
| get record type of this directory record
virtual DcmDirectoryRecord * | getReferencedMRDR ()
| if this directory record references an MRDR (multi-reference directory record), return pointer to the MRDR referenced by this object.
virtual OFCondition | assignToMRDR (DcmDirectoryRecord *mrdr)
| create a reference from this record to an MRDR
virtual OFCondition | assignToSOPFile (const char *referencedFileID, const OFFilename &sourceFileName)
| open a DICOM file and make this directory record into a directory record for that DICOM file.
virtual unsigned long | cardSub () const
| return number of directory records that are child record of this one
virtual OFCondition | insertSub (DcmDirectoryRecord *dirRec, unsigned long where=DCM_EndOfListIndex, OFBool before=OFFalse)
| insert a child directory record
virtual OFCondition | insertSubAtCurrentPos (DcmDirectoryRecord *dirRec, OFBool before=OFFalse)
| insert new directory child record at the current position.
virtual DcmDirectoryRecord * | getSub (const unsigned long num)
| access child directory record.
virtual DcmDirectoryRecord * | nextSub (const DcmDirectoryRecord *dirRec)
| get next directory child record starting at a given record
virtual DcmDirectoryRecord * | removeSub (const unsigned long num)
| remove child directory record.
virtual DcmDirectoryRecord * | removeSub (DcmDirectoryRecord *dirRec)
| remove child directory record.
virtual OFCondition | deleteSubAndPurgeFile (const unsigned long num)
| remove child directory record and delete file referenced by that record, if any
virtual OFCondition | deleteSubAndPurgeFile (DcmDirectoryRecord *dirRec)
| remove child directory record and delete file referenced by that record, if any
virtual OFCondition | clearSub ()
| revert the list of child directory records to default constructed (empty) state
virtual void | setRecordsOriginFile (const OFFilename &fname)
| store the filename from which this directory record was read from
virtual const OFFilename & | getRecordsOriginFile ()
| get the filename from which this directory record was read from, empty if not set
Uint32 | getFileOffset () const
| get the offset in file of this directory record
Public Member Functions inherited from DcmItem
| DcmItem ()
| default constructor
| DcmItem (const DcmTag &tag, const Uint32 len=0)
| constructor.
| DcmItem (const DcmItem &old)
| copy constructor
DcmItem & | operator= (const DcmItem &obj)
| assignment operator.
virtual int | compare (const DcmItem &rhs) const
| comparison operator that compares the value of this object with a given object of the same type.
virtual | ~DcmItem ()
| destructor
virtual unsigned long | getVM ()
| get value multiplicity
virtual unsigned long | getNumberOfValues ()
| get number of values (elements) stored in this item.
virtual unsigned long | card () const
| get cardinality of this item
virtual OFBool | isLeaf () const
| check if this element is a leaf node in a dataset tree.
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
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.
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.
virtual void | transferInit ()
| initialize the transfer state of this object.
virtual void | transferEnd ()
| finalize the transfer state of this object.
virtual DcmItem * | getParentItem ()
| get parent item of this object, i.e. the item/dataset in which the surrounding sequence element is stored.
virtual OFBool | canWriteXfer (const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer)
| check if this DICOM object can be encoded in the given transfer syntax.
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.
virtual OFCondition | write (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
| write object to a stream
virtual OFCondition | writeJson (STD_NAMESPACE ostream &out, DcmJsonFormat &format)
| write object in JSON format
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
virtual OFCondition | writeSignatureFormat (DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
| special write method for creation of digital signatures
virtual OFBool | containsUnknownVR () const
| returns true if the object contains an element with Unknown VR at any nesting level
virtual OFBool | containsExtendedCharacters (const OFBool checkAllStrings=OFFalse)
| check if this object contains non-ASCII characters at any nesting level.
virtual OFBool | isAffectedBySpecificCharacterSet () const
| check if this object is affected by SpecificCharacterSet at any nesting level.
virtual OFCondition | convertToUTF8 ()
| convert all element values that are contained in this item and that are affected by SpecificCharacterSet to UTF-8 (Unicode).
virtual OFCondition | insert (DcmElement *elem, OFBool replaceOld=OFFalse, OFBool checkInsertOrder=OFFalse)
| insert a new element into the list of elements maintained by this item.
virtual DcmElement * | getElement (const unsigned long num)
| access an element from the item.
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).
virtual DcmObject * | nextInContainer (const DcmObject *obj)
| this method is only used in container classes, that is, DcmItem and DcmSequenceOfItems.
virtual DcmElement * | remove (const unsigned long num)
| remove element from list.
virtual DcmElement * | remove (DcmObject *elem)
| remove element from list.
virtual DcmElement * | remove (const DcmTagKey &tag)
| remove element from list.
virtual OFBool | isEmpty (const OFBool normalize=OFTrue)
| check if this item is empty
virtual OFCondition | clear ()
| clear (remove) all attributes from item and delete them from memory.
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.
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.
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.
OFBool | tagExists (const DcmTagKey &key, OFBool searchIntoSub=OFFalse)
| check if an element with the given attribute tag exists in the dataset
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
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).
OFCondition | findAndGetElements (const DcmTagKey &tagKey, DcmStack &resultStack)
| find all elements matching a particular tag and return references to them on a stack.
OFCondition | findAndGetString (const DcmTagKey &tagKey, const char *&value, const OFBool searchIntoSub=OFFalse)
| find element and get value as a reference to a C string.
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.
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).
OFCondition | findAndGetOFStringArray (const DcmTagKey &tagKey, OFString &value, const OFBool searchIntoSub=OFFalse)
| find element and get value as a C++ string (all components).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
OFCondition | findAndGetSequence (const DcmTagKey &seqTagKey, DcmSequenceOfItems *&sequence, const OFBool searchIntoSub=OFFalse, const OFBool createCopy=OFFalse)
| looks up and returns a given sequence.
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.
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.
OFCondition | findAndInsertCopyOfElement (const DcmTagKey &tagKey, DcmItem *destItem, const OFBool replaceOld=OFTrue)
| find element, create a copy and insert it into the given destination dataset.
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.
OFCondition | findAndDeleteSequenceItem (const DcmTagKey &seqTagKey, const signed long itemNum)
| looks up the given sequence in the current dataset and deletes the given item.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
OFCondition | putAndInsertSint32Array (const DcmTag &tag, const Sint32 *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.
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.
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.
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.
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.
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.
OFCondition | insertEmptyElement (const DcmTag &tag, const OFBool replaceOld=OFTrue)
| create a new element (with no value) and insert it into the dataset/item.
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.
Public Member Functions inherited from DcmObject
| DcmObject (const DcmTag &tag, const Uint32 len=0)
| constructor.
| DcmObject (const DcmObject &obj)
| copy constructor
virtual | ~DcmObject ()
| destructor
DcmObject & | operator= (const DcmObject &obj)
| copy assignment operator
DcmEVR | getVR () const
| return the value representation assigned to this object.
OFBool | isaString () const
| check if this element is a string type, based on the VR.
virtual OFBool | isElement () const
| check if this element can be safely casted to DcmElement
E_TransferState | transferState () const
| return the current transfer (read/write) state of this object.
DcmItem * | getRootItem ()
| get root dataset/item (top-level) that contains this object.
DcmObject * | getParent ()
| get parent of this object.
const DcmObject * | getParent () const
| get parent of this object.
void | setParent (DcmObject *parent)
| set parent of this object.
Uint16 | getGTag () const
| return the group number of the attribute tag for this object
Uint16 | getETag () const
| return the element number of the attribute tag for this object
const DcmTag & | getTag () const
| return const reference to the attribute tag for this object
void | setGTag (Uint16 gtag)
| assign group tag (but not element tag) of the attribute tag for this object.
virtual OFCondition | setVR (DcmEVR vr)
| assign a new Value Representation (VR) to this object.
virtual OFBool | isSignable () const
| returns true if the current object may be included in a digital signature
Uint32 | getLengthField () const
| return the current value of the Length field (which is different from the functionality of the public getLength() method).

## Protected Member Functions
OFCondition | fillElementsAndReadSOP (const char *referencedFileID, const OFFilename &sourceFileName, DcmFileFormat *fileFormat=NULL)
| Load all necessary info for this directory record.
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.
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.
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.
OFBool | 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).
void | updateSpecificCharacterSet (OFCondition &status, const DcmSpecificCharacterSet &converter)
| update the SpecificCharacterSet (0008,0005) element depending on the given parameters.
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.
void | printInfoLineStart (STD_NAMESPACE ostream &out, const size_t flags, const int level, DcmTag *tag=NULL)
| print beginning of the info line.
void | printInfoLineEnd (STD_NAMESPACE ostream &out, const size_t flags, const unsigned long printedLength=0xffffffff, DcmTag *tag=NULL)
| print end of the info line.
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.
virtual OFCondition | writeTagAndLength (DcmOutputStream &outStream, const E_TransferSyntax oxfer, Uint32 &writtenBytes) const
| write tag, VR and length field to the given output stream
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.
const char * | getTagName ()
| return the DICOM attribute tag name for this object.
void | setTagVR (DcmEVR vr)
| set the VR for this attribute
E_TransferState | getTransferState () const
| return the current transfer state of this object during serialization/deserialization
void | setTransferState (E_TransferState newState)
| set the current transfer state of this object during serialization/deserialization
Uint32 | getTransferredBytes () const
| return the number of transferred bytes for this object during serialization/deserialization
void | setTransferredBytes (Uint32 val)
| set the number of transferred bytes for this object during serialization/deserialization
void | incTransferredBytes (Uint32 val)
| add to the number of transferred bytes for this object during serialization/deserialization
void | setLengthField (Uint32 val)
| set the current value of the Length field

## Private Attributes
OFFilename | recordsOriginFile
| filename (path) of the file from which this directory record was read
DcmSequenceOfItems * | lowerLevelList
| list of child directory records, kept in a sequence of items
E_DirRecType | DirRecordType
| directory record type of this record
DcmDirectoryRecord * | referencedMRDR
| pointer to multi-referenced directory record (MRDR) if this record refers to one, NULL otherwise
Uint32 | numberOfReferences
| number of other directory records referring to this one; used for MRDR records
Uint32 | offsetInFile
| byte offset at which the start of this directory record resides in the file from which it was read

## Friends
class | DcmDicomDir

## Additional Inherited Members
Static Public Member Functions inherited from DcmItem
static DcmElement * | newDicomElement (const DcmTagKey &tag, const char *privateCreator=NULL)
| creates new DICOM element from given attribute tag.
static OFCondition | newDicomElement (DcmElement *&newElement, const DcmTagKey &tag, const char *privateCreator=NULL)
| creates new DICOM element from given attribute tag.
static OFCondition | newDicomElementWithVR (DcmElement *&newElement, const DcmTag &tag)
| creates new DICOM element from given attribute tag and VR.
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.
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.
Protected Attributes inherited from DcmItem
DcmList * | elementList
| the list of elements maintained by this object
OFBool | lastElementComplete
| flag used during suspended I/O.
offile_off_t | fStartPosition
| used during reading.
Protected Attributes inherited from DcmObject
OFCondition | errorFlag
| error flag for this object.

## Detailed Description

a class representing a directory record dataset in a DICOMDIR.

## Constructor & Destructor Documentation

## ◆ DcmDirectoryRecord() [1/4]

DcmDirectoryRecord::DcmDirectoryRecord | ( | const DcmTag & | tag,
|  | const Uint32 | len )

constructor.

Create new element from given tag and length.

Parameters

  tag | attribute tag
  len | length of the attribute value

## ◆ DcmDirectoryRecord() [2/4]

DcmDirectoryRecord::DcmDirectoryRecord | ( | const E_DirRecType | recordType,
|  | const char * | referencedFileID,
|  | const OFFilename & | sourceFileName,
|  | DcmFileFormat * | fileFormat = NULL )

constructor

Parameters

  recordType | record type
  referencedFileID | referenced file ID in DICOM format
  sourceFileName | path to referenced file in operating system specific format
  fileFormat | fileFormat for sourceFileName, can be NULL

## ◆ DcmDirectoryRecord() [3/4]

DcmDirectoryRecord::DcmDirectoryRecord | ( | const char * | recordTypeName,
|  | const char * | referencedFileID,
|  | const OFFilename & | sourceFileName,
|  | DcmFileFormat * | fileFormat = NULL )

constructor

Parameters

  recordTypeName | record type as string
  referencedFileID | referenced file ID in DICOM format
  sourceFileName | path to referenced file in operating system specific format
  fileFormat | fileFormat for sourceFileName, can be NULL

## ◆ DcmDirectoryRecord() [4/4]

DcmDirectoryRecord::DcmDirectoryRecord | ( | const DcmDirectoryRecord & | oldDirRec | ) |

copy constructor

Parameters

  oldDirRec | element to be copied

References DcmDirectoryRecord().

## Member Function Documentation

## ◆ assignToMRDR()

virtual OFCondition DcmDirectoryRecord::assignToMRDR | ( | DcmDirectoryRecord * | mrdr | ) |
| virtual

create a reference from this record to an MRDR

Parameters

  mrdr | pointer to MRDR

Returns
  EC_Normal upon success, an error code otherwise

References DcmDirectoryRecord().

## ◆ assignToSOPFile()

virtual OFCondition DcmDirectoryRecord::assignToSOPFile | ( | const char * | referencedFileID,
|  | const OFFilename & | sourceFileName )
| virtual

open a DICOM file and make this directory record into a directory record for that DICOM file.

The most relevant record keys (SOP Class UID, SOP instance UID, Transfer Syntax UID) are inserted into the directory record.

Parameters

  referencedFileID | referenced file ID in DICOM format
  sourceFileName | path to file in operating system specific format

Returns
  EC_Normal upon success, an error code otherwise

## ◆ checkForSpecificCharacterSet()

virtual OFBool DcmDirectoryRecord::checkForSpecificCharacterSet | ( |  | ) | const
| inlinevirtual

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.

Returns
  always returns OFTrue, i.e. SpecificCharacterSet should be checked

Reimplemented from DcmItem.

## ◆ clone()

virtual DcmObject * DcmDirectoryRecord::clone | ( |  | ) | const
| inlinevirtual

clone method

Returns
  deep copy of this object

Reimplemented from DcmItem.

References DcmDirectoryRecord(), and DcmObject::DcmObject().

## ◆ convertCharacterSet() [1/3]

virtual OFCondition DcmDirectoryRecord::convertCharacterSet | ( | const OFString & | fromCharset,
|  | const OFString & | toCharset,
|  | const size_t | flags = 0,
|  | const OFBool | updateCharset = OFFalse )
| virtual

convert all element values that are contained in this record and that are affected by SpecificCharacterSet from the given source character set to the given destination character set.

The defined terms for a particular character set can be found in the DICOM standard, e.g. "ISO_IR 100" for ISO 8859-1 (Latin 1) or "ISO_IR 192" for Unicode in UTF-8. An empty string denotes the default character repertoire, which is ASCII (7-bit). If multiple values are given for 'fromCharset' (separated by a backslash) code extension techniques are used and escape sequences may be encountered in the source string to switch between the specified character sets.

Parameters

  fromCharset | name of the source character set(s) used for the conversion
  toCharset | name of the destination character set used for the conversion. Only a single value is permitted (i.e. no code extensions).
  flags | optional flag used to customize the conversion (see DCMTypes::CF_xxx)
  updateCharset | if OFTrue, the SpecificCharacterSet (0008,0005) element is updated, i.e. the current value is either replaced or a new element is inserted or the existing element is deleted. If OFFalse the SpecificCharacterSet element remains unchanged.

Returns
  status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.

## ◆ convertCharacterSet() [2/3]

virtual OFCondition DcmDirectoryRecord::convertCharacterSet | ( | const OFString & | toCharset,
|  | const size_t | flags = 0,
|  | const OFBool | ignoreCharset = OFFalse )
| virtual

convert all element values that are contained in this record and that are affected by SpecificCharacterSet to the given destination character set.

If not disabled, the source character set is determined automatically from the value of the SpecificCharacterSet (0008,0005) element. The defined terms for the destination character set can be found in the DICOM standard, e.g. "ISO_IR 100" for ISO 8859-1 (Latin 1) or "ISO_IR 192" for Unicode in UTF-8. An empty string denotes the default character repertoire, which is ASCII (7-bit).

Parameters

  toCharset | name of the destination character set used for the conversion. Only a single value is permitted (i.e. no code extensions).
  flags | optional flag used to customize the conversion (see DCMTypes::CF_xxx)
  ignoreCharset | if OFTrue, the value of SpecificCharacterSet is ignored. Also see checkForSpecificCharacterSet().

Returns
  status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.

## ◆ convertCharacterSet() [3/3]

virtual OFCondition DcmDirectoryRecord::convertCharacterSet | ( | DcmSpecificCharacterSet & | converter | ) |
| virtual

convert all element values that are contained in this record and that are affected by SpecificCharacterSet from the currently selected source character set to the currently selected destination character set.

Since the Basic Directory IOD, which specifies the structure and content of a DICOMDIR, does not contain the SpecificCharacterSet (0008,0005) element in the main dataset but in each directory record, this method also checks for this element and creates a new character set converter for the contained data elements (if needed).

Parameters

  converter | character set converter to be used to convert the element values

Returns
  status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.

## ◆ copyFrom()

virtual OFCondition DcmDirectoryRecord::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.

References DcmObject::DcmObject().

## ◆ deleteSubAndPurgeFile() [1/2]

virtual OFCondition DcmDirectoryRecord::deleteSubAndPurgeFile | ( | const unsigned long | num | ) |
| virtual

remove child directory record and delete file referenced by that record, if any

Parameters

  num | index number of element, must be < cardSub()

Returns
  status, EC_Normal upon success, an error code otherwise

## ◆ deleteSubAndPurgeFile() [2/2]

virtual OFCondition DcmDirectoryRecord::deleteSubAndPurgeFile | ( | DcmDirectoryRecord * | dirRec | ) |
| virtual

remove child directory record and delete file referenced by that record, if any

Parameters

  dirRec | pointer to element to be removed from list

Returns
  status, EC_Normal upon success, an error code otherwise

References DcmDirectoryRecord().

## ◆ fillElementsAndReadSOP()

OFCondition DcmDirectoryRecord::fillElementsAndReadSOP | ( | const char * | referencedFileID,
|  | const OFFilename & | sourceFileName,
|  | DcmFileFormat * | fileFormat = NULL )
| protected

Load all necessary info for this directory record.

Parameters

  referencedFileID | file ID that is being referenced, may be NULL
  sourceFileName | filename for the DICOM file, may be empty (unspecified)
  fileFormat | If not NULL, then this should be the result of loading sourceFileName. May only be non-NULL if sourceFileName isn't empty.

References DcmDirectoryRecord().

## ◆ getReferencedMRDR()

virtual DcmDirectoryRecord * DcmDirectoryRecord::getReferencedMRDR | ( |  | ) |
| virtual

if this directory record references an MRDR (multi-reference directory record), return pointer to the MRDR referenced by this object.

Returns
  pointer to MRDR referenced by this object or NULL of no MRDR referenced

References DcmDirectoryRecord().

## ◆ getSub()

virtual DcmDirectoryRecord * DcmDirectoryRecord::getSub | ( | const unsigned long | num | ) |
| virtual

access child directory record.

Returns a pointer to the object maintained as a child, not a copy.

Parameters

  num | index, must be < cardSub()

Returns
  pointer to child directory record or NULL if not found

References DcmDirectoryRecord().

## ◆ ident()

virtual DcmEVR DcmDirectoryRecord::ident | ( |  | ) | const
| virtual

return identifier for this class.

Every class derived from this class returns a unique value of type enum DcmEVR for this call. This is used as a "poor man's RTTI" to correctly identify instances derived from this class even on compilers not supporting RTTI.

Returns
  type identifier of this class

Reimplemented from DcmItem.

## ◆ insertSub()

virtual OFCondition DcmDirectoryRecord::insertSub | ( | DcmDirectoryRecord * | dirRec,
|  | unsigned long | where = DCM_EndOfListIndex,
|  | OFBool | before = OFFalse )
| virtual

insert a child directory record

Parameters

  dirRec | directory record to be inserted. Must be allocated on heap, ownership is transferred to this object
  where | index where to insert object
  before | flag indicating whether to insert the record before or after the element identified by where

Returns
  EC_Normal upon success, an error code otherwise

References DcmDirectoryRecord().

## ◆ insertSubAtCurrentPos()

virtual OFCondition DcmDirectoryRecord::insertSubAtCurrentPos | ( | DcmDirectoryRecord * | dirRec,
|  | OFBool | before = OFFalse )
| virtual

insert new directory child record at the current position.

The current position is stored internally in the 'lowerLevelList' member variable.

Parameters

  dirRec | new child record to be inserted
  before | flag indicating whether to insert the record before (OFFalse) or after (OFTrue) the current position

Returns
  status, EC_Normal upon success, an error code otherwise

References DcmDirectoryRecord().

## ◆ nextSub()

virtual DcmDirectoryRecord * DcmDirectoryRecord::nextSub | ( | const DcmDirectoryRecord * | dirRec | ) |
| virtual

get next directory child record starting at a given record

Parameters

  dirRec | record to start from (goto first record if NULL)

Returns
  pointer to next record if successful, NULL otherwise

References DcmDirectoryRecord().

## ◆ operator=()

DcmDirectoryRecord & DcmDirectoryRecord::operator= | ( | const DcmDirectoryRecord & | obj | ) |

assignment operator

Parameters

  obj | the directory record to be copied

References DcmDirectoryRecord().

## ◆ print()

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

print all elements of the item to a stream

Parameters

  out | output stream
  flags | optional flag used to customize the output (see DCMTypes::PF_xxx)
  level | current level of nested items. Used for indentation.
  pixelFileName | not used
  pixelCounter | not used

Reimplemented from DcmItem.

## ◆ read()

virtual OFCondition DcmDirectoryRecord::read | ( | DcmInputStream & | inStream,
|  | const E_TransferSyntax | xfer,
|  | const E_GrpLenEncoding | glenc = EGL_noChange,
|  | const Uint32 | maxReadLength = DCM_MaxReadLength )
| virtual

This function reads the information of all attributes which are captured in the input stream and captures this information in elementList.

Each attribute is represented as an element in this list. If not all information for an attribute could be read from the stream, the function returns EC_StreamNotifyClient.

Parameters

  inStream | The stream which contains the information.
  xfer | The transfer syntax which was used to encode the information in inStream.
  glenc | Encoding type for group length; specifies what will be done with group length tags.
  maxReadLength | Maximum read length for reading an attribute value.

Returns
  status, EC_Normal if successful, an error code otherwise

Reimplemented from DcmItem.

References EGL_noChange.

## ◆ removeSub() [1/2]

virtual DcmDirectoryRecord * DcmDirectoryRecord::removeSub | ( | const unsigned long | num | ) |
| virtual

remove child directory record.

If found, the record is not deleted but returned to the caller who is responsible for further management of the DcmDirectoryRecord object.

Parameters

  num | index number of element, must be < cardSub()

Returns
  pointer to DcmDirectoryRecord if found, NULL otherwise

References DcmDirectoryRecord().

## ◆ removeSub() [2/2]

virtual DcmDirectoryRecord * DcmDirectoryRecord::removeSub | ( | DcmDirectoryRecord * | dirRec | ) |
| virtual

remove child directory record.

If found, the record is not deleted but returned to the caller who is responsible for further management of the DcmDirectoryRecord object.

Parameters

  dirRec | pointer to element to be removed from list

Returns
  pointer to element if found, NULL otherwise

References DcmDirectoryRecord().

## ◆ search()

virtual OFCondition DcmDirectoryRecord::search | ( | const DcmTagKey & | xtag,
|  | DcmStack & | resultStack,
|  | E_SearchMode | mode = ESM_fromHere,
|  | OFBool | searchIntoSub = OFTrue )
| virtual

a complex, stack-based, hierarchical search method.

It allows for a search for a DICOM object with a given attribute within a given container, hierarchically, from a starting position identified through a cursor stack.

Parameters

  xtag | the DICOM attribute tag we are searching for
  resultStack | depending on the search mode (see below), this parameter either serves as an input and output parameter, or as an output parameter only (the latter being the default). When used as an input parameter, the cursor stack defines the start position for the search within a hierarchical DICOM dataset. Upon successful return, the stack contains the position of the element found, in the form of a pointer to each dataset, sequence, item and element from the main dataset down to the found element.
  mode | search mode, controls how the search stack is handled. In the default mode, ESM_fromHere, the stack is ignored on input, and the search starts in the object for which this method is called. In the other modes, the stack is used both as an input and an output parameter and defines the starting point for the search.
  searchIntoSub | if true, the search will be performed hierarchically descending into the sequences and items of the dataset. If false, only the current container (sequence or item) will be traversed.

Returns
  EC_Normal if found, EC_TagNotFound if not found, an error code is something went wrong.

Reimplemented from DcmItem.

References ESM_fromHere.

## ◆ setRecordsOriginFile()

virtual void DcmDirectoryRecord::setRecordsOriginFile | ( | const OFFilename & | fname | ) |
| virtual

store the filename from which this directory record was read from

Parameters

  fname | filename, must not be empty

## ◆ verify()

virtual OFCondition DcmDirectoryRecord::verify | ( | const OFBool | autocorrect = OFFalse | ) |
| virtual

check the currently stored element value

Parameters

  autocorrect | correct value length if OFTrue

Returns
  status, EC_Normal if value length is correct, an error code otherwise

Reimplemented from DcmItem.

## ◆ writeXML()

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

write object in XML format

Parameters

  out | output stream to which the XML document is written
  flags | optional 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:

- dcmdata/include/dcmtk/dcmdata/dcdirrec.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2