00001 /* 00002 * 00003 * Copyright (C) 1994-2005, OFFIS 00004 * 00005 * This software and supporting documentation were developed by 00006 * 00007 * Kuratorium OFFIS e.V. 00008 * Healthcare Information and Communication Systems 00009 * Escherweg 2 00010 * D-26121 Oldenburg, Germany 00011 * 00012 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 00013 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 00014 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 00015 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 00016 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 00017 * 00018 * Module: dcmdata 00019 * 00020 * Author: Andreas Barth 00021 * 00022 * Purpose: 00023 * Interface of class DcmPolymorphOBOW for Tags that can change their VR 00024 * between OB and OW (e.g. Tag PixelData, OverlayData). This class shall 00025 * not be used directly in applications. No identification exists. 00026 * 00027 * Last Update: $Author: meichel $ 00028 * Update Date: $Date: 2005/12/08 16:29:06 $ 00029 * Source File: $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcmtk/dcmdata/dcvrpobw.h,v $ 00030 * CVS/RCS Revision: $Revision: 1.13 $ 00031 * Status: $State: Exp $ 00032 * 00033 * CVS/RCS Log at end of file 00034 * 00035 */ 00036 00037 #ifndef DCVRPOBW_H 00038 #define DCVRPOBW_H 00039 00040 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00041 #include "dcmtk/dcmdata/dcvrobow.h" 00042 00043 class DcmPolymorphOBOW : public DcmOtherByteOtherWord 00044 { 00045 private: 00046 OFBool changeVR; 00047 DcmEVR currentVR; // current VR of value field (can change) 00048 00049 public: 00050 DcmPolymorphOBOW( 00051 const DcmTag & tag, 00052 const Uint32 len = 0); 00053 00054 DcmPolymorphOBOW( 00055 const DcmPolymorphOBOW & old); 00056 00057 virtual ~DcmPolymorphOBOW(); 00058 00059 DcmPolymorphOBOW &operator=( 00060 const DcmPolymorphOBOW &obj); 00061 00065 virtual DcmObject *clone() const 00066 { 00067 return new DcmPolymorphOBOW(*this); 00068 } 00069 00070 virtual OFCondition read( 00071 DcmInputStream & inStream, 00072 const E_TransferSyntax ixfer, 00073 const E_GrpLenEncoding glenc, 00074 const Uint32 maxReadLength); 00075 00076 virtual OFCondition write( 00077 DcmOutputStream & outStream, 00078 const E_TransferSyntax oxfer, 00079 const E_EncodingType enctype = EET_UndefinedLength); 00080 00083 virtual OFCondition writeSignatureFormat( 00084 DcmOutputStream & outStream, 00085 const E_TransferSyntax oxfer, 00086 const E_EncodingType enctype = EET_UndefinedLength); 00087 00088 virtual void transferInit(); 00089 virtual void transferEnd(); 00090 00091 // get data as Uint8 Array 00092 virtual OFCondition getUint8Array( 00093 Uint8 * & bytes); 00094 00095 // get data as Uint16 Array 00096 virtual OFCondition getUint16Array( 00097 Uint16 * & words); 00098 00099 // put an Unit8 array. It is converted to OW if VR == OW 00100 virtual OFCondition putUint8Array( 00101 const Uint8 * byteValue, 00102 const unsigned long length); 00103 00104 // put an Unit16 array. It is converted to OB if VR == OB 00105 virtual OFCondition putUint16Array( 00106 const Uint16 * wordValue, 00107 const unsigned long length ); 00108 00109 // create an empty Uint8 array of given number of words and set it 00110 virtual OFCondition createUint8Array( 00111 const Uint32 numBytes, 00112 Uint8 * & bytes); 00113 00114 // create an empty Uint16 array of given number of words and set it 00115 virtual OFCondition createUint16Array( 00116 const Uint32 numWords, 00117 Uint16 * & words); 00118 }; 00119 #endif 00120 00121 /* 00122 ** CVS/RCS Log: 00123 ** $Log: dcvrpobw.h,v $ 00124 ** Revision 1.13 2005/12/08 16:29:06 meichel 00125 ** Changed include path schema for all DCMTK header files 00126 ** 00127 ** Revision 1.12 2004/07/01 12:28:25 meichel 00128 ** Introduced virtual clone method for DcmObject and derived classes. 00129 ** 00130 ** Revision 1.11 2002/09/12 14:07:16 joergr 00131 ** Added method "createUint8Array" which works similar to the 16 bit variant. 00132 ** 00133 ** Revision 1.10 2002/08/27 16:55:40 meichel 00134 ** Initial release of new DICOM I/O stream classes that add support for stream 00135 ** compression (deflated little endian explicit VR transfer syntax) 00136 ** 00137 ** Revision 1.9 2001/09/25 17:19:33 meichel 00138 ** Adapted dcmdata to class OFCondition 00139 ** 00140 ** Revision 1.8 2001/06/01 15:48:52 meichel 00141 ** Updated copyright header 00142 ** 00143 ** Revision 1.7 2001/05/10 12:52:56 meichel 00144 ** Added public createUint16Array() method in class DcmPolymorphOBOW. 00145 ** 00146 ** Revision 1.6 2000/11/07 16:56:11 meichel 00147 ** Initial release of dcmsign module for DICOM Digital Signatures 00148 ** 00149 ** Revision 1.5 2000/03/08 16:26:25 meichel 00150 ** Updated copyright header. 00151 ** 00152 ** Revision 1.4 1999/03/31 09:25:05 meichel 00153 ** Updated copyright header in module dcmdata 00154 ** 00155 ** Revision 1.3 1998/11/12 16:47:53 meichel 00156 ** Implemented operator= for all classes derived from DcmObject. 00157 ** 00158 ** Revision 1.2 1997/07/31 06:59:00 andreas 00159 ** Error correction and additonal functionality for 00160 ** DcmPolymorphOBOW to support getting and putting of Uint8 and 00161 ** Uint16 data independent of the VR. 00162 ** 00163 ** Revision 1.1 1997/07/21 07:54:00 andreas 00164 ** - Support for CP 14. PixelData and OverlayData can have VR OW or OB 00165 ** (depending on the transfer syntax). New internal value 00166 ** representation (only for ident()) for OverlayData. 00167 ** 00168 */