📄 dcitem.h
字号:
//// SUPPORT FUNCTIONS//// Function: newDicomElement// creates a new DicomElement from a Tag.//// Input:// tag : Tag of the new element// length : length of the element value//// Output:// newElement: point of a heap allocated new element. If the tag does not// describe a dicom element or has ambigious VR (e.g. EVR_ox)// a NULL pointer is returned.//// Result:// EC_Normal: tag describes an element (possibly with ambiguous VR)// EC_InvalidTag: tag describes an item begin or an unknown element// EC_SequEnd: tag describes a sequence delimitation element// EC_ItemEnd: tag describes an item delmitation element// other: an errorOFCondition newDicomElement(DcmElement *&newElement, DcmTag &tag, const Uint32 length, DcmPrivateTagCache *privateCreatorCache, OFBool& readAsUN);OFCondition newDicomElement(DcmElement *&newElement, const DcmTag &tag, const Uint32 length = 0);// Functions: newDicomElement// creates a new DicomElement from a Tag. They differ from the above functions// in not returning a condition.DcmElement *newDicomElement(const DcmTag &tag, const Uint32 length = 0);// Function: nextUp// pop Object from stack and get next Object in top of stackOFCondition nextUp(DcmStack &st);#endif // DCITEM_H/*** CVS/RCS Log:** $Log: dcitem.h,v $** Revision 1.53 2005/12/08 16:28:19 meichel** Changed include path schema for all DCMTK header files**** Revision 1.52 2005/11/15 18:28:02 meichel** Added new global flag dcmEnableUnknownVRConversion that enables the automatic** re-conversion of defined length UN elements read in an explicit VR transfer** syntax, if the real VR is defined in the data dictionary. Default is OFFalse,** i.e. to retain the previous behavior.**** Revision 1.51 2005/06/24 10:03:14 joergr** Added support for internal VR "xs" to putAndInsertXXX() helper methods.**** Revision 1.50 2004/07/01 12:28:25 meichel** Introduced virtual clone method for DcmObject and derived classes.**** Revision 1.49 2004/02/04 16:02:08 joergr** Removed pointer declaration from parameter "resultStack" in method** findAndGetElements().**** Revision 1.48 2003/10/08 10:24:40 joergr** Added support for AT, OB, OF, OW, SL, SS, UL, US to putAndInsertString().**** Revision 1.47 2003/07/16 14:34:05 joergr** Added new function findAndGetSequence().**** Revision 1.46 2003/06/26 09:17:25 onken** Added commandline-application dcmodify.**** Revision 1.45 2003/06/12 13:33:46 joergr** Fixed inconsistent API documentation reported by Doxygen.**** Revision 1.44 2003/06/02 17:16:23 joergr** Added new helper function DcmItem::findAndCopyElement().**** Revision 1.43 2003/06/02 16:58:12 meichel** Renamed local variables to avoid name clashes with STL**** Revision 1.42 2003/05/20 09:01:58 joergr** Added new helper methods: findAndGetElement(), findAndGetUint32Array(),** FindAndGetSint32Array(), findAndGetFloat64Array(), findAndDeleteElement().** Enhanced findAndGetSequenceItem() and findOrCreateSequenceItem() by checking** the return value of ident() - avoids crashes when applied to non-sequence** elements.**** Revision 1.41 2002/12/09 09:31:15 wilkens** Modified/Added doc++ documentation.**** Revision 1.40 2002/12/06 12:49:10 joergr** Enhanced "print()" function by re-working the implementation and replacing** the boolean "showFullData" parameter by a more general integer flag.** Added doc++ documentation.** Made source code formatting more consistent with other modules/files.**** Revision 1.39 2002/08/27 16:55:34 meichel** Initial release of new DICOM I/O stream classes that add support for stream** compression (deflated little endian explicit VR transfer syntax)**** Revision 1.38 2002/08/02 08:42:44 joergr** Added optional 'pos' parameter to the putAndInsertXXX() methods.**** Revision 1.37 2002/07/23 14:21:26 meichel** Added support for private tag data dictionaries to dcmdata**** Revision 1.36 2002/06/26 15:47:40 joergr** Added support for polymorp OB/OW value representation (e.g. pixel data) to** putAndInsertUint8/16Array() methods.**** Revision 1.35 2002/05/17 09:58:14 meichel** fixed bug in DcmItem which caused the parser to fail if the same attribute** tag appeared twice within one dataset (which is illegal in DICOM anyway).** Added console warning if the attributes read are not in ascending order.**** Revision 1.34 2002/04/25 10:06:46 joergr** Added support for XML output of DICOM objects.**** Revision 1.33 2001/12/18 11:37:24 joergr** Added helper method allowing to create and insert empty elements into an** item/dataset.**** Revision 1.32 2001/11/16 15:54:38 meichel** Adapted digital signature code to final text of supplement 41.**** Revision 1.31 2001/11/09 15:51:59 joergr** Added new helper routines for managing sequences and items.**** Revision 1.30 2001/10/10 15:14:04 joergr** Changed parameter DcmTagKey to DcmTag in DcmItem::putAndInsert... methods** to support elements which are not in the data dictionary (e.g. private** extensions).**** Revision 1.29 2001/10/02 11:46:45 joergr** Added functions to get/put 8 bit values/arrays from/to an item/dataset.**** Revision 1.28 2001/10/01 15:01:14 joergr** Introduced new general purpose functions to get/put DICOM element values** from/to an item/dataset - removed some old and rarely used functions.**** Revision 1.27 2001/09/25 17:19:26 meichel** Adapted dcmdata to class OFCondition**** Revision 1.26 2001/06/01 15:48:40 meichel** Updated copyright header**** Revision 1.25 2000/11/07 16:56:06 meichel** Initial release of dcmsign module for DICOM Digital Signatures**** Revision 1.24 2000/04/14 15:31:32 meichel** Removed default value from output stream passed to print() method.** Required for use in multi-thread environments.**** Revision 1.23 2000/03/08 16:26:15 meichel** Updated copyright header.**** Revision 1.22 2000/03/03 14:05:24 meichel** Implemented library support for redirecting error messages into memory** instead of printing them to stdout/stderr for GUI applications.**** Revision 1.21 2000/02/10 10:50:51 joergr** Added new feature to dcmdump (enhanced print method of dcmdata): write** pixel data/item value fields to raw files.**** Revision 1.20 1999/03/31 09:24:40 meichel** Updated copyright header in module dcmdata**** Revision 1.19 1998/07/15 15:48:48 joergr** Removed several compiler warnings reported by gcc 2.8.1 with** additional options, e.g. missing copy constructors and assignment** operators, initialization of member variables in the body of a** constructor instead of the member initialization list, hiding of** methods by use of identical names, uninitialized member variables,** missing const declaration of char pointers. Replaced tabs by spaces.**** Revision 1.18 1997/09/22 14:50:43 hewett** - Added 2 simple methods to test for the existance of an attribute** to DcmItem class (tagExists and tagExistsWithValue). This code** was part of dcmgpdir.cc but is more generally useful.** - Added 2 methods to find an attribute and retrieve numeric values** to DcmItem class (findIntegerNumber and findRealNumber). The old** method findLong is now marked as obsolete and reimplemented using** findIntegerNumber.**** Revision 1.17 1997/09/11 15:13:11 hewett** Modified getOFString method arguments by removing a default value** for the pos argument. By requiring the pos argument to be provided** ensures that callers realise getOFString only gets one component of** a multi-valued string.**** Revision 1.16 1997/08/29 08:32:39 andreas** - Added methods getOFString and getOFStringArray for all** string VRs. These methods are able to normalise the value, i. e.** to remove leading and trailing spaces. This will be done only if** it is described in the standard that these spaces are not relevant.** These methods do not test the strings for conformance, this means** especially that they do not delete spaces where they are not allowed!** getOFStringArray returns the string with all its parts separated by \** and getOFString returns only one value of the string.** CAUTION: Currently getString returns a string with trailing** spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and** truncates the original string (since it is not copied!). If you rely on this** behaviour please change your application now.** Future changes will ensure that getString returns the original** string from the DICOM object (NULL terminated) inclusive padding.** Currently, if you call getOF... before calling getString without** normalisation, you can get the original string read from the DICOM object.**** Revision 1.15 1997/07/21 08:25:08 andreas** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL)** with one unique boolean type OFBool.**** Revision 1.14 1997/07/07 07:42:03 andreas** - Changed parameter type DcmTag & to DcmTagKey & in all search functions** in DcmItem, DcmSequenceOfItems, DcmDirectoryRecord and DcmObject**** Revision 1.13 1997/05/30 06:45:42 andreas** - fixed problem of inconsistent interfaces and implementation that the** syntax check of GNU C++ does not find.**** Revision 1.12 1997/05/27 13:48:28 andreas** - Add method canWriteXfer to class DcmObject and all derived classes.** This method checks whether it is possible to convert the original** transfer syntax to an new transfer syntax. The check is used in the** dcmconv utility to prohibit the change of a compressed transfer** syntax to a uncompressed.**** Revision 1.11 1997/05/16 08:13:43 andreas** - Revised handling of GroupLength elements and support of** DataSetTrailingPadding elements. The enumeratio E_GrpLenEncoding** got additional enumeration values (for a description see dctypes.h).** addGroupLength and removeGroupLength methods are replaced by** computeGroupLengthAndPadding. To support Padding, the parameters of** element and sequence write functions changed.** - Added a new method calcElementLength to calculate the length of an** element, item or sequence. For elements it returns the length of** tag, length field, vr field, and value length, for item and** sequences it returns the length of the whole item. sequence including** the Delimitation tag (if appropriate). It can never return** UndefinedLength.** - Deleted obsolete method DcmItem::calcHeaderLength because the** samce functionality is performed by DcmXfer::sizeofTagHeader**** Revision 1.10 1996/08/05 08:45:23 andreas** new print routine with additional parameters:** - print into files** - fix output length for elements** corrected error in search routine with parameter ESM_fromStackTop**** Revision 1.9 1996/07/17 12:38:58 andreas** new nextObject to iterate a DicomDataset, DicomFileFormat, Item, ...**** Revision 1.8 1996/04/29 15:08:53 hewett** Replaced DcmItem::findInt(...) with the more general DcmItem::findLong(...).**** Revision 1.7 1996/04/16 16:00:05 andreas** - added const for Tag in newDicomElement**** Revision 1.6 1996/03/28 18:52:30 hewett** Added 2 simple find&get methods (findString & findInt).**** Revision 1.5 1996/01/29 13:38:12 andreas** - new put method for every VR to put value as a string** - better and unique print methods**** Revision 1.4 1996/01/09 11:06:15 andreas** New Support for Visual C++** Correct problems with inconsistent const declarations**** Revision 1.3 1996/01/05 13:22:56 andreas** - changed to support new streaming facilities** - more cleanups** - merged read / write methods for block and file transfer***/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -