00001 /* 00002 * 00003 * Copyright (C) 1994-2010, OFFIS e.V. 00004 * All rights reserved. See COPYRIGHT file for details. 00005 * 00006 * This software and supporting documentation were developed by 00007 * 00008 * OFFIS e.V. 00009 * R&D Division Health 00010 * Escherweg 2 00011 * D-26121 Oldenburg, Germany 00012 * 00013 * 00014 * Module: dcmdata 00015 * 00016 * Author: Gerd Ehlers 00017 * 00018 * Purpose: Interface of class DcmItem 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-11-02 15:31:06 $ 00022 * CVS/RCS Revision: $Revision: 1.83 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 00030 #ifndef DCITEM_H 00031 #define DCITEM_H 00032 00033 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00034 00035 #include "dcmtk/ofstd/offile.h" /* for offile_off_t */ 00036 #include "dcmtk/dcmdata/dctypes.h" 00037 #include "dcmtk/dcmdata/dcobject.h" 00038 #include "dcmtk/dcmdata/dclist.h" 00039 #include "dcmtk/dcmdata/dcpcache.h" 00040 00041 00042 // forward declaration 00043 class DcmSequenceOfItems; 00044 class DcmElement; 00045 00046 00051 class DcmItem 00052 : public DcmObject 00053 { 00054 public: 00055 00058 DcmItem(); 00059 00065 DcmItem(const DcmTag &tag, 00066 const Uint32 len = 0); 00067 00071 DcmItem(const DcmItem &old); 00072 00077 DcmItem &operator=(const DcmItem &obj); 00078 00081 virtual ~DcmItem(); 00082 00086 virtual DcmObject *clone() const 00087 { 00088 return new DcmItem(*this); 00089 } 00090 00103 virtual OFCondition copyFrom(const DcmObject& rhs); 00104 00108 virtual DcmEVR ident() const; 00109 00113 virtual unsigned long getVM(); 00114 00118 virtual unsigned long card() const; 00119 00126 virtual OFBool isLeaf() const { return OFFalse; } 00127 00135 virtual void print(STD_NAMESPACE ostream&out, 00136 const size_t flags = 0, 00137 const int level = 0, 00138 const char *pixelFileName = NULL, 00139 size_t *pixelCounter = NULL); 00140 00157 virtual Uint32 calcElementLength(const E_TransferSyntax xfer, 00158 const E_EncodingType enctype); 00159 00172 virtual Uint32 getLength(const E_TransferSyntax xfer = EXS_LittleEndianImplicit, 00173 const E_EncodingType enctype = EET_UndefinedLength); 00174 00178 virtual void transferInit(); 00179 00183 virtual void transferEnd(); 00184 00190 virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, 00191 const E_TransferSyntax oldXfer); 00192 00206 virtual OFCondition read(DcmInputStream &inStream, 00207 const E_TransferSyntax ixfer, 00208 const E_GrpLenEncoding glenc = EGL_noChange, 00209 const Uint32 maxReadLength = DCM_MaxReadLength); 00210 00218 virtual OFCondition write( 00219 DcmOutputStream &outStream, 00220 const E_TransferSyntax oxfer, 00221 const E_EncodingType enctype, 00222 DcmWriteCache *wcache); 00223 00229 virtual OFCondition writeXML(STD_NAMESPACE ostream&out, 00230 const size_t flags = 0); 00231 00239 virtual OFCondition writeSignatureFormat( 00240 DcmOutputStream &outStream, 00241 const E_TransferSyntax oxfer, 00242 const E_EncodingType enctype, 00243 DcmWriteCache *wcache); 00244 00248 virtual OFBool containsUnknownVR() const; 00249 00255 virtual OFBool containsExtendedCharacters(const OFBool checkAllStrings = OFFalse); 00256 00263 virtual OFBool isAffectedBySpecificCharacterSet() const; 00264 00277 virtual OFCondition insert(DcmElement *elem, 00278 OFBool replaceOld = OFFalse, 00279 OFBool checkInsertOrder = OFFalse); 00280 00286 virtual DcmElement *getElement(const unsigned long num); 00287 00303 virtual OFCondition nextObject(DcmStack &stack, 00304 const OFBool intoSub); 00305 00316 virtual DcmObject *nextInContainer(const DcmObject *obj); 00317 00324 virtual DcmElement *remove(const unsigned long num); 00325 00332 virtual DcmElement *remove(DcmObject *elem); 00333 00340 virtual DcmElement *remove(const DcmTagKey &tag); 00341 00346 virtual OFBool isEmpty(const OFBool normalize = OFTrue); 00347 00351 virtual OFCondition clear(); 00352 00357 virtual OFCondition verify(const OFBool autocorrect = OFFalse ); 00358 00381 virtual OFCondition search(const DcmTagKey &xtag, // in 00382 DcmStack &resultStack, // inout 00383 E_SearchMode mode = ESM_fromHere, // in 00384 OFBool searchIntoSub = OFTrue ); // in 00385 00393 virtual OFCondition loadAllDataIntoMemory(); 00394 00423 virtual OFCondition computeGroupLengthAndPadding(const E_GrpLenEncoding glenc, 00424 const E_PaddingEncoding padenc = EPD_noChange, 00425 const E_TransferSyntax xfer = EXS_Unknown, 00426 const E_EncodingType enctype = EET_ExplicitLength, 00427 const Uint32 padlen = 0, 00428 const Uint32 subPadlen = 0, 00429 Uint32 instanceLength = 0); 00430 00431 00438 OFBool tagExists(const DcmTagKey &key, 00439 OFBool searchIntoSub = OFFalse); 00440 00448 OFBool tagExistsWithValue(const DcmTagKey &key, 00449 OFBool searchIntoSub = OFFalse); 00450 00451 /* --- findAndGet functions: find an element and get it or the value, respectively --- */ 00452 00462 OFCondition findAndGetElement(const DcmTagKey &tagKey, 00463 DcmElement *&element, 00464 const OFBool searchIntoSub = OFFalse, 00465 const OFBool createCopy = OFFalse); 00466 00474 OFCondition findAndGetElements(const DcmTagKey &tagKey, 00475 DcmStack &resultStack); 00476 00487 OFCondition findAndGetString(const DcmTagKey &tagKey, 00488 const char *&value, 00489 const OFBool searchIntoSub = OFFalse); 00490 00507 OFCondition findAndGetOFString(const DcmTagKey &tagKey, 00508 OFString &value, 00509 const unsigned long pos = 0, 00510 const OFBool searchIntoSub = OFFalse); 00511 00525 OFCondition findAndGetOFStringArray(const DcmTagKey &tagKey, 00526 OFString &value, 00527 const OFBool searchIntoSub = OFFalse); 00528 00538 OFCondition findAndGetUint8(const DcmTagKey &tagKey, 00539 Uint8 &value, 00540 const unsigned long pos = 0, 00541 const OFBool searchIntoSub = OFFalse); 00542 00552 OFCondition findAndGetUint8Array(const DcmTagKey &tagKey, 00553 const Uint8 *&value, 00554 unsigned long *count = NULL, 00555 const OFBool searchIntoSub = OFFalse); 00556 00566 OFCondition findAndGetUint16(const DcmTagKey &tagKey, 00567 Uint16 &value, 00568 const unsigned long pos = 0, 00569 const OFBool searchIntoSub = OFFalse); 00570 00580 OFCondition findAndGetUint16Array(const DcmTagKey &tagKey, 00581 const Uint16 *&value, 00582 unsigned long *count = NULL, 00583 const OFBool searchIntoSub = OFFalse); 00584 00594 OFCondition findAndGetSint16(const DcmTagKey &tagKey, 00595 Sint16 &value, 00596 const unsigned long pos = 0, 00597 const OFBool searchIntoSub = OFFalse); 00598 00608 OFCondition findAndGetSint16Array(const DcmTagKey &tagKey, 00609 const Sint16 *&value, 00610 unsigned long *count = NULL, 00611 const OFBool searchIntoSub = OFFalse); 00612 00622 OFCondition findAndGetUint32(const DcmTagKey &tagKey, 00623 Uint32 &value, 00624 const unsigned long pos = 0, 00625 const OFBool searchIntoSub = OFFalse); 00626 00636 OFCondition findAndGetUint32Array(const DcmTagKey &tagKey, 00637 const Uint32 *&value, 00638 unsigned long *count = NULL, 00639 const OFBool searchIntoSub = OFFalse); 00640 00650 OFCondition findAndGetSint32(const DcmTagKey &tagKey, 00651 Sint32 &value, 00652 const unsigned long pos = 0, 00653 const OFBool searchIntoSub = OFFalse); 00654 00664 OFCondition findAndGetSint32Array(const DcmTagKey &tagKey, 00665 const Sint32 *&value, 00666 unsigned long *count = NULL, 00667 const OFBool searchIntoSub = OFFalse); 00668 00678 OFCondition findAndGetLongInt(const DcmTagKey &tagKey, 00679 long int &value, 00680 const unsigned long pos = 0, 00681 const OFBool searchIntoSub = OFFalse); 00682 00692 OFCondition findAndGetFloat32(const DcmTagKey &tagKey, 00693 Float32 &value, 00694 const unsigned long pos = 0, 00695 const OFBool searchIntoSub = OFFalse); 00696 00706 OFCondition findAndGetFloat32Array(const DcmTagKey &tagKey, 00707 const Float32 *&value, 00708 unsigned long *count = NULL, 00709 const OFBool searchIntoSub = OFFalse); 00710 00720 OFCondition findAndGetFloat64(const DcmTagKey &tagKey, 00721 Float64 &value, 00722 const unsigned long pos = 0, 00723 const OFBool searchIntoSub = OFFalse); 00724 00734 OFCondition findAndGetFloat64Array(const DcmTagKey &tagKey, 00735 const Float64 *&value, 00736 unsigned long *count = NULL, 00737 const OFBool searchIntoSub = OFFalse); 00738 00749 OFCondition findAndGetSequence(const DcmTagKey &seqTagKey, 00750 DcmSequenceOfItems *&sequence, 00751 const OFBool searchIntoSub = OFFalse, 00752 const OFBool createCopy = OFFalse); 00753 00765 OFCondition findAndGetSequenceItem(const DcmTagKey &seqTagKey, 00766 DcmItem *&item, 00767 const signed long itemNum = 0, 00768 const OFBool createCopy = OFFalse); 00769 00770 00771 /* --- findOrCreate functions: find an element or create a new one --- */ 00772 00785 OFCondition findOrCreateSequenceItem(const DcmTag &seqTag, 00786 DcmItem *&item, 00787 const signed long itemNum = 0); 00788 00789 /* --- findAndXXX functions: find an element and do something with it --- */ 00790 00802 OFCondition findAndInsertCopyOfElement(const DcmTagKey &tagKey, 00803 DcmItem *destItem, 00804 const OFBool replaceOld = OFTrue); 00805 00814 OFCondition findAndDeleteElement(const DcmTagKey &tagKey, 00815 const OFBool allOccurrences = OFFalse, 00816 const OFBool searchIntoSub = OFFalse); 00817 00824 OFCondition findAndDeleteSequenceItem(const DcmTagKey &seqTagKey, 00825 const signed long itemNum); 00826 00827 00828 /* --- putAndInsert functions: put value and insert new element --- */ 00829 00838 OFCondition putAndInsertString(const DcmTag &tag, 00839 const char *value, 00840 const OFBool replaceOld = OFTrue); 00841 00849 OFCondition putAndInsertOFStringArray(const DcmTag &tag, 00850 const OFString &value, 00851 const OFBool replaceOld = OFTrue); 00852 00861 OFCondition putAndInsertUint8Array(const DcmTag &tag, 00862 const Uint8 *value, 00863 const unsigned long count, 00864 const OFBool replaceOld = OFTrue); 00865 00875 OFCondition putAndInsertUint16(const DcmTag &tag, 00876 const Uint16 value, 00877 const unsigned long pos = 0, 00878 const OFBool replaceOld = OFTrue); 00879 00888 OFCondition putAndInsertUint16Array(const DcmTag &tag, 00889 const Uint16 *value, 00890 const unsigned long count, 00891 const OFBool replaceOld = OFTrue); 00892 00902 OFCondition putAndInsertSint16(const DcmTag &tag, 00903 const Sint16 value, 00904 const unsigned long pos = 0, 00905 const OFBool replaceOld = OFTrue); 00906 00915 OFCondition putAndInsertSint16Array(const DcmTag &tag, 00916 const Sint16 *value, 00917 const unsigned long count, 00918 const OFBool replaceOld = OFTrue); 00919 00929 OFCondition putAndInsertUint32(const DcmTag &tag, 00930 const Uint32 value, 00931 const unsigned long pos = 0, 00932 const OFBool replaceOld = OFTrue); 00933 00943 OFCondition putAndInsertSint32(const DcmTag &tag, 00944 const Sint32 value, 00945 const unsigned long pos = 0, 00946 const OFBool replaceOld = OFTrue); 00947 00957 OFCondition putAndInsertFloat32(const DcmTag &tag, 00958 const Float32 value, 00959 const unsigned long pos = 0, 00960 const OFBool replaceOld = OFTrue); 00961 00971 OFCondition putAndInsertFloat64(const DcmTag &tag, 00972 const Float64 value, 00973 const unsigned long pos = 0, 00974 const OFBool replaceOld = OFTrue); 00975 00976 00977 /* --- insertXXX functions: insert new element --- */ 00978 00986 OFCondition insertEmptyElement(const DcmTag &tag, 00987 const OFBool replaceOld = OFTrue); 00988 01001 OFCondition insertSequenceItem(const DcmTag &seqTag, 01002 DcmItem *item, 01003 const signed long itemNum = -2); 01004 01005 protected: 01006 01008 DcmList *elementList; 01009 01014 OFBool lastElementComplete; 01015 01020 offile_off_t fStartPosition; 01021 01022 protected: 01023 01042 OFCondition readTagAndLength(DcmInputStream &inStream, // inout 01043 const E_TransferSyntax xfer, // in 01044 DcmTag &tag, // out 01045 Uint32 &length, // out 01046 Uint32 &bytesRead); // out 01047 01064 OFCondition readSubElement(DcmInputStream &inStream, // inout 01065 DcmTag &newTag, // inout 01066 const Uint32 newLength, // in 01067 const E_TransferSyntax xfer, // in 01068 const E_GrpLenEncoding glenc, // in 01069 const Uint32 maxReadLength = DCM_MaxReadLength); 01070 01080 E_TransferSyntax checkTransferSyntax(DcmInputStream &inStream); 01081 01090 void checkAndUpdateVR(DcmItem &item, 01091 DcmTag &tag); 01092 01093 01094 private: 01095 01105 OFCondition searchSubFromHere(const DcmTagKey &tag, // in 01106 DcmStack &resultStack, // inout 01107 OFBool searchIntoSub ); // in 01108 01115 static OFBool foundVR(const Uint8* atposition); 01116 01118 DcmPrivateTagCache privateCreatorCache; 01119 }; 01120 01121 // 01122 // SUPPORT FUNCTIONS 01123 // 01124 01135 OFCondition newDicomElement(DcmElement *&newElement, 01136 DcmTag &tag, 01137 const Uint32 length, 01138 DcmPrivateTagCache *privateCreatorCache, 01139 OFBool& readAsUN); 01140 01148 OFCondition newDicomElement(DcmElement *&newElement, 01149 const DcmTag &tag, 01150 const Uint32 length = 0); 01151 01158 DcmElement *newDicomElement(const DcmTag &tag, 01159 const Uint32 length = 0); 01160 01166 OFCondition nextUp(DcmStack &st); 01167 01168 01169 #endif // DCITEM_H 01170 01171 01172 /* 01173 ** CVS/RCS Log: 01174 ** $Log: dcitem.h,v $ 01175 ** Revision 1.83 2010-11-02 15:31:06 joergr 01176 ** Added special handling for data elements that are associated with different 01177 ** VRs (according to the data dictinary) when read with an implicit transfer 01178 ** syntax, e.g. PixelPaddingValue or WaveformData. 01179 ** 01180 ** Revision 1.82 2010-10-14 13:15:41 joergr 01181 ** Updated copyright header. Added reference to COPYRIGHT file. 01182 ** 01183 ** Revision 1.81 2010-10-01 13:55:01 joergr 01184 ** Added new helper function findAndInsertCopyOfElement(). 01185 ** 01186 ** Revision 1.80 2010-03-01 09:08:44 uli 01187 ** Removed some unnecessary include directives in the headers. 01188 ** 01189 ** Revision 1.79 2010-02-22 11:39:53 uli 01190 ** Remove some unneeded includes. 01191 ** 01192 ** Revision 1.78 2009-09-02 09:58:21 joergr 01193 ** Revised documentation of parameter "pos" for some putAndInsertXXX() functions 01194 ** in order to make clear what the possible range of values is. 01195 ** 01196 ** Revision 1.77 2009-08-07 14:40:38 joergr 01197 ** Enhanced isEmpty() method by checking whether the data element value consists 01198 ** of non-significant characters only. 01199 ** 01200 ** Revision 1.76 2009-03-25 10:22:09 joergr 01201 ** Added new method isEmpty() to DICOM object, item and sequence class. 01202 ** 01203 ** Revision 1.75 2009-03-05 14:07:56 onken 01204 ** Fixed typo. 01205 ** 01206 ** Revision 1.74 2009-03-05 13:35:47 onken 01207 ** Added checks for sequence and item lengths which prevents overflow in length 01208 ** field, if total length of contained items (or sequences) exceeds 01209 ** 32-bit length field. Also introduced new flag (default: enabled) 01210 ** for writing in explicit length mode, which allows for automatically 01211 ** switching encoding of only that very sequence/item to undefined 01212 ** length coding (thus permitting to actually write the file). 01213 ** 01214 ** Revision 1.73 2009-02-04 17:52:17 joergr 01215 ** Fixes various type mismatches reported by MSVC introduced with OFFile class. 01216 ** 01217 ** Revision 1.72 2008-12-12 11:44:40 onken 01218 ** Moved path access functions to separate classes 01219 ** 01220 ** Revision 1.71 2008-12-05 13:28:14 onken 01221 ** Splitted findOrCreatePath() function API for also offering a simple API 01222 ** for non-wildcard searches. 01223 ** 01224 ** Revision 1.70 2008-12-04 16:55:14 onken 01225 ** Changed findOrCreatePath() to also support wildcard as item numbers. 01226 ** 01227 ** Revision 1.69 2008-11-26 12:08:22 joergr 01228 ** Updated documentation of newDicomElement() in order to reflect the current 01229 ** implementation. 01230 ** 01231 ** Revision 1.68 2008-10-15 12:31:20 onken 01232 ** Added findOrCreatePath() functions which allow for finding or creating a 01233 ** hierarchy of sequences, items and attributes according to a given "path" 01234 ** string. 01235 ** 01236 ** Revision 1.67 2008-07-17 11:19:48 onken 01237 ** Updated copyFrom() documentation. 01238 ** 01239 ** Revision 1.66 2008-07-17 10:30:23 onken 01240 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which 01241 ** permits setting an instance's value from an existing object. Implemented 01242 ** assignment operator where necessary. 01243 ** 01244 ** Revision 1.65 2008-06-23 12:09:13 joergr 01245 ** Fixed inconsistencies in Doxygen API documentation. 01246 ** 01247 ** Revision 1.64 2007/11/29 14:30:19 meichel 01248 ** Write methods now handle large raw data elements (such as pixel data) 01249 ** without loading everything into memory. This allows very large images to 01250 ** be sent over a network connection, or to be copied without ever being 01251 ** fully in memory. 01252 ** 01253 ** Revision 1.63 2007/09/21 10:40:15 onken 01254 ** Changed foundVR() API and implementation to use Uint8* instead of char* to 01255 ** avoid calls to isalpha() with negative arguments (undef. behaviour/assertion) 01256 ** 01257 ** Revision 1.62 2007/06/29 14:17:49 meichel 01258 ** Code clean-up: Most member variables in module dcmdata are now private, 01259 ** not protected anymore. 01260 ** 01261 ** Revision 1.61 2007/06/08 14:56:04 joergr 01262 ** Added new helper functions insertSequenceItem(), findAndDeleteSequenceItem(). 01263 ** Replaced helper function findAndCopyElement() by new optional parameter 01264 ** 'createCopy' in various findAndGetXXX() functions. 01265 ** 01266 ** Revision 1.60 2007/03/09 10:38:13 joergr 01267 ** Added support for missing VRs (SL, SS, UL, SS) to insertEmptyElement(). 01268 ** 01269 ** Revision 1.59 2007/02/19 15:04:34 meichel 01270 ** Removed searchErrors() methods that are not used anywhere and added 01271 ** error() methods only in the DcmObject subclasses where really used. 01272 ** 01273 ** Revision 1.58 2006/12/15 14:18:07 joergr 01274 ** Added new method that checks whether a DICOM object or element is affected 01275 ** by SpecificCharacterSet (0008,0005). 01276 ** 01277 ** Revision 1.57 2006/12/13 13:58:14 joergr 01278 ** Added new optional parameter "checkAllStrings" to method containsExtended 01279 ** Characters(). 01280 ** 01281 ** Revision 1.56 2006/08/15 15:49:56 meichel 01282 ** Updated all code in module dcmdata to correctly compile when 01283 ** all standard C++ classes remain in namespace std. 01284 ** 01285 ** Revision 1.55 2006/05/30 15:01:52 joergr 01286 ** Modified comment of method containsExtendedCharacters(). 01287 ** 01288 ** Revision 1.54 2006/05/11 08:54:00 joergr 01289 ** Moved checkForNonASCIICharacters() from application to library. 01290 ** 01291 ** Revision 1.53 2005/12/08 16:28:19 meichel 01292 ** Changed include path schema for all DCMTK header files 01293 ** 01294 ** Revision 1.52 2005/11/15 18:28:02 meichel 01295 ** Added new global flag dcmEnableUnknownVRConversion that enables the automatic 01296 ** re-conversion of defined length UN elements read in an explicit VR transfer 01297 ** syntax, if the real VR is defined in the data dictionary. Default is OFFalse, 01298 ** i.e. to retain the previous behavior. 01299 ** 01300 ** Revision 1.51 2005/06/24 10:03:14 joergr 01301 ** Added support for internal VR "xs" to putAndInsertXXX() helper methods. 01302 ** 01303 ** Revision 1.50 2004/07/01 12:28:25 meichel 01304 ** Introduced virtual clone method for DcmObject and derived classes. 01305 ** 01306 ** Revision 1.49 2004/02/04 16:02:08 joergr 01307 ** Removed pointer declaration from parameter "resultStack" in method 01308 ** findAndGetElements(). 01309 ** 01310 ** Revision 1.48 2003/10/08 10:24:40 joergr 01311 ** Added support for AT, OB, OF, OW, SL, SS, UL, US to putAndInsertString(). 01312 ** 01313 ** Revision 1.47 2003/07/16 14:34:05 joergr 01314 ** Added new function findAndGetSequence(). 01315 ** 01316 ** Revision 1.46 2003/06/26 09:17:25 onken 01317 ** Added commandline-application dcmodify. 01318 ** 01319 ** Revision 1.45 2003/06/12 13:33:46 joergr 01320 ** Fixed inconsistent API documentation reported by Doxygen. 01321 ** 01322 ** Revision 1.44 2003/06/02 17:16:23 joergr 01323 ** Added new helper function DcmItem::findAndCopyElement(). 01324 ** 01325 ** Revision 1.43 2003/06/02 16:58:12 meichel 01326 ** Renamed local variables to avoid name clashes with STL 01327 ** 01328 ** Revision 1.42 2003/05/20 09:01:58 joergr 01329 ** Added new helper methods: findAndGetElement(), findAndGetUint32Array(), 01330 ** FindAndGetSint32Array(), findAndGetFloat64Array(), findAndDeleteElement(). 01331 ** Enhanced findAndGetSequenceItem() and findOrCreateSequenceItem() by checking 01332 ** the return value of ident() - avoids crashes when applied to non-sequence 01333 ** elements. 01334 ** 01335 ** Revision 1.41 2002/12/09 09:31:15 wilkens 01336 ** Modified/Added doc++ documentation. 01337 ** 01338 ** Revision 1.40 2002/12/06 12:49:10 joergr 01339 ** Enhanced "print()" function by re-working the implementation and replacing 01340 ** the boolean "showFullData" parameter by a more general integer flag. 01341 ** Added doc++ documentation. 01342 ** Made source code formatting more consistent with other modules/files. 01343 ** 01344 ** Revision 1.39 2002/08/27 16:55:34 meichel 01345 ** Initial release of new DICOM I/O stream classes that add support for stream 01346 ** compression (deflated little endian explicit VR transfer syntax) 01347 ** 01348 ** Revision 1.38 2002/08/02 08:42:44 joergr 01349 ** Added optional 'pos' parameter to the putAndInsertXXX() methods. 01350 ** 01351 ** Revision 1.37 2002/07/23 14:21:26 meichel 01352 ** Added support for private tag data dictionaries to dcmdata 01353 ** 01354 ** Revision 1.36 2002/06/26 15:47:40 joergr 01355 ** Added support for polymorp OB/OW value representation (e.g. pixel data) to 01356 ** putAndInsertUint8/16Array() methods. 01357 ** 01358 ** Revision 1.35 2002/05/17 09:58:14 meichel 01359 ** fixed bug in DcmItem which caused the parser to fail if the same attribute 01360 ** tag appeared twice within one dataset (which is illegal in DICOM anyway). 01361 ** Added console warning if the attributes read are not in ascending order. 01362 ** 01363 ** Revision 1.34 2002/04/25 10:06:46 joergr 01364 ** Added support for XML output of DICOM objects. 01365 ** 01366 ** Revision 1.33 2001/12/18 11:37:24 joergr 01367 ** Added helper method allowing to create and insert empty elements into an 01368 ** item/dataset. 01369 ** 01370 ** Revision 1.32 2001/11/16 15:54:38 meichel 01371 ** Adapted digital signature code to final text of supplement 41. 01372 ** 01373 ** Revision 1.31 2001/11/09 15:51:59 joergr 01374 ** Added new helper routines for managing sequences and items. 01375 ** 01376 ** Revision 1.30 2001/10/10 15:14:04 joergr 01377 ** Changed parameter DcmTagKey to DcmTag in DcmItem::putAndInsert... methods 01378 ** to support elements which are not in the data dictionary (e.g. private 01379 ** extensions). 01380 ** 01381 ** Revision 1.29 2001/10/02 11:46:45 joergr 01382 ** Added functions to get/put 8 bit values/arrays from/to an item/dataset. 01383 ** 01384 ** Revision 1.28 2001/10/01 15:01:14 joergr 01385 ** Introduced new general purpose functions to get/put DICOM element values 01386 ** from/to an item/dataset - removed some old and rarely used functions. 01387 ** 01388 ** Revision 1.27 2001/09/25 17:19:26 meichel 01389 ** Adapted dcmdata to class OFCondition 01390 ** 01391 ** Revision 1.26 2001/06/01 15:48:40 meichel 01392 ** Updated copyright header 01393 ** 01394 ** Revision 1.25 2000/11/07 16:56:06 meichel 01395 ** Initial release of dcmsign module for DICOM Digital Signatures 01396 ** 01397 ** Revision 1.24 2000/04/14 15:31:32 meichel 01398 ** Removed default value from output stream passed to print() method. 01399 ** Required for use in multi-thread environments. 01400 ** 01401 ** Revision 1.23 2000/03/08 16:26:15 meichel 01402 ** Updated copyright header. 01403 ** 01404 ** Revision 1.22 2000/03/03 14:05:24 meichel 01405 ** Implemented library support for redirecting error messages into memory 01406 ** instead of printing them to stdout/stderr for GUI applications. 01407 ** 01408 ** Revision 1.21 2000/02/10 10:50:51 joergr 01409 ** Added new feature to dcmdump (enhanced print method of dcmdata): write 01410 ** pixel data/item value fields to raw files. 01411 ** 01412 ** Revision 1.20 1999/03/31 09:24:40 meichel 01413 ** Updated copyright header in module dcmdata 01414 ** 01415 ** Revision 1.19 1998/07/15 15:48:48 joergr 01416 ** Removed several compiler warnings reported by gcc 2.8.1 with 01417 ** additional options, e.g. missing copy constructors and assignment 01418 ** operators, initialization of member variables in the body of a 01419 ** constructor instead of the member initialization list, hiding of 01420 ** methods by use of identical names, uninitialized member variables, 01421 ** missing const declaration of char pointers. Replaced tabs by spaces. 01422 ** 01423 ** Revision 1.18 1997/09/22 14:50:43 hewett 01424 ** - Added 2 simple methods to test for the existance of an attribute 01425 ** to DcmItem class (tagExists and tagExistsWithValue). This code 01426 ** was part of dcmgpdir.cc but is more generally useful. 01427 ** - Added 2 methods to find an attribute and retrieve numeric values 01428 ** to DcmItem class (findIntegerNumber and findRealNumber). The old 01429 ** method findLong is now marked as obsolete and reimplemented using 01430 ** findIntegerNumber. 01431 ** 01432 ** Revision 1.17 1997/09/11 15:13:11 hewett 01433 ** Modified getOFString method arguments by removing a default value 01434 ** for the pos argument. By requiring the pos argument to be provided 01435 ** ensures that callers realise getOFString only gets one component of 01436 ** a multi-valued string. 01437 ** 01438 ** Revision 1.16 1997/08/29 08:32:39 andreas 01439 ** - Added methods getOFString and getOFStringArray for all 01440 ** string VRs. These methods are able to normalise the value, i. e. 01441 ** to remove leading and trailing spaces. This will be done only if 01442 ** it is described in the standard that these spaces are not relevant. 01443 ** These methods do not test the strings for conformance, this means 01444 ** especially that they do not delete spaces where they are not allowed! 01445 ** getOFStringArray returns the string with all its parts separated by \ 01446 ** and getOFString returns only one value of the string. 01447 ** CAUTION: Currently getString returns a string with trailing 01448 ** spaces removed (if dcmEnableAutomaticInputDataCorrection == OFTrue) and 01449 ** truncates the original string (since it is not copied!). If you rely on this 01450 ** behaviour please change your application now. 01451 ** Future changes will ensure that getString returns the original 01452 ** string from the DICOM object (NULL terminated) inclusive padding. 01453 ** Currently, if you call getOF... before calling getString without 01454 ** normalisation, you can get the original string read from the DICOM object. 01455 ** 01456 ** Revision 1.15 1997/07/21 08:25:08 andreas 01457 ** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL) 01458 ** with one unique boolean type OFBool. 01459 ** 01460 ** Revision 1.14 1997/07/07 07:42:03 andreas 01461 ** - Changed parameter type DcmTag & to DcmTagKey & in all search functions 01462 ** in DcmItem, DcmSequenceOfItems, DcmDirectoryRecord and DcmObject 01463 ** 01464 ** Revision 1.13 1997/05/30 06:45:42 andreas 01465 ** - fixed problem of inconsistent interfaces and implementation that the 01466 ** syntax check of GNU C++ does not find. 01467 ** 01468 ** Revision 1.12 1997/05/27 13:48:28 andreas 01469 ** - Add method canWriteXfer to class DcmObject and all derived classes. 01470 ** This method checks whether it is possible to convert the original 01471 ** transfer syntax to an new transfer syntax. The check is used in the 01472 ** dcmconv utility to prohibit the change of a compressed transfer 01473 ** syntax to a uncompressed. 01474 ** 01475 ** Revision 1.11 1997/05/16 08:13:43 andreas 01476 ** - Revised handling of GroupLength elements and support of 01477 ** DataSetTrailingPadding elements. The enumeratio E_GrpLenEncoding 01478 ** got additional enumeration values (for a description see dctypes.h). 01479 ** addGroupLength and removeGroupLength methods are replaced by 01480 ** computeGroupLengthAndPadding. To support Padding, the parameters of 01481 ** element and sequence write functions changed. 01482 ** - Added a new method calcElementLength to calculate the length of an 01483 ** element, item or sequence. For elements it returns the length of 01484 ** tag, length field, vr field, and value length, for item and 01485 ** sequences it returns the length of the whole item. sequence including 01486 ** the Delimitation tag (if appropriate). It can never return 01487 ** UndefinedLength. 01488 ** - Deleted obsolete method DcmItem::calcHeaderLength because the 01489 ** samce functionality is performed by DcmXfer::sizeofTagHeader 01490 ** 01491 ** Revision 1.10 1996/08/05 08:45:23 andreas 01492 ** new print routine with additional parameters: 01493 ** - print into files 01494 ** - fix output length for elements 01495 ** corrected error in search routine with parameter ESM_fromStackTop 01496 ** 01497 ** Revision 1.9 1996/07/17 12:38:58 andreas 01498 ** new nextObject to iterate a DicomDataset, DicomFileFormat, Item, ... 01499 ** 01500 ** Revision 1.8 1996/04/29 15:08:53 hewett 01501 ** Replaced DcmItem::findInt(...) with the more general DcmItem::findLong(...). 01502 ** 01503 ** Revision 1.7 1996/04/16 16:00:05 andreas 01504 ** - added const for Tag in newDicomElement 01505 ** 01506 ** Revision 1.6 1996/03/28 18:52:30 hewett 01507 ** Added 2 simple find&get methods (findString & findInt). 01508 ** 01509 ** Revision 1.5 1996/01/29 13:38:12 andreas 01510 ** - new put method for every VR to put value as a string 01511 ** - better and unique print methods 01512 ** 01513 ** Revision 1.4 1996/01/09 11:06:15 andreas 01514 ** New Support for Visual C++ 01515 ** Correct problems with inconsistent const declarations 01516 ** 01517 ** Revision 1.3 1996/01/05 13:22:56 andreas 01518 ** - changed to support new streaming facilities 01519 ** - more cleanups 01520 ** - merged read / write methods for block and file transfer 01521 ** 01522 */