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, Andreas Barth 00017 * 00018 * Purpose: Interface of class DcmPixelItem 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:15:41 $ 00022 * CVS/RCS Revision: $Revision: 1.30 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 00030 #ifndef DCPXITEM_H 00031 #define DCPXITEM_H 00032 00033 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00034 #include "dcmtk/dcmdata/dcvrobow.h" 00035 #include "dcmtk/dcmdata/dcofsetl.h" /* for class DcmOffsetList */ 00036 00037 00045 class DcmPixelItem : public DcmOtherByteOtherWord 00046 { 00047 public: 00048 00053 DcmPixelItem(const DcmTag &tag, const Uint32 len = 0); 00054 00058 DcmPixelItem(const DcmPixelItem &old); 00059 00061 virtual ~DcmPixelItem(); 00062 00066 DcmPixelItem &operator=(const DcmPixelItem &obj) { DcmOtherByteOtherWord::operator=(obj); return *this; } 00067 00071 virtual DcmObject *clone() const 00072 { 00073 return new DcmPixelItem(*this); 00074 } 00075 00079 virtual DcmEVR ident(void) const { return EVR_pixelItem; } 00080 00093 virtual OFCondition copyFrom(const DcmObject &rhs); 00094 00102 virtual void print(STD_NAMESPACE ostream &out, 00103 const size_t flags = 0, 00104 const int level = 0, 00105 const char *pixelFileName = NULL, 00106 size_t *pixelCounter = NULL); 00107 00114 virtual OFCondition createOffsetTable(const DcmOffsetList &offsetList); 00115 00121 virtual OFCondition writeXML(STD_NAMESPACE ostream &out, 00122 const size_t flags = 0); 00123 00131 virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, 00132 const E_TransferSyntax oxfer, 00133 const E_EncodingType enctype, 00134 DcmWriteCache *wcache); 00135 00136 protected: 00137 00144 virtual OFCondition writeTagAndLength(DcmOutputStream &outStream, 00145 const E_TransferSyntax oxfer, 00146 Uint32 &writtenBytes) const; 00147 00148 }; 00149 00150 00151 #endif // DCPXITEM_H 00152 00153 /* 00154 ** CVS/RCS Log: 00155 ** $Log: dcpxitem.h,v $ 00156 ** Revision 1.30 2010-10-14 13:15:41 joergr 00157 ** Updated copyright header. Added reference to COPYRIGHT file. 00158 ** 00159 ** Revision 1.29 2010-03-01 09:08:44 uli 00160 ** Removed some unnecessary include directives in the headers. 00161 ** 00162 ** Revision 1.28 2010-02-22 11:39:54 uli 00163 ** Remove some unneeded includes. 00164 ** 00165 ** Revision 1.27 2009-02-04 17:54:31 joergr 00166 ** Fixed various layout and formatting issues. 00167 ** 00168 ** Revision 1.26 2009-02-04 10:18:19 joergr 00169 ** Fixed issue with compressed frames of odd length (possibly wrong values in 00170 ** basic offset table). 00171 ** 00172 ** Revision 1.25 2008-07-17 11:19:49 onken 00173 ** Updated copyFrom() documentation. 00174 ** 00175 ** Revision 1.24 2008-07-17 10:30:23 onken 00176 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which 00177 ** permits setting an instance's value from an existing object. Implemented 00178 ** assignment operator where necessary. 00179 ** 00180 ** Revision 1.23 2007-11-29 14:30:19 meichel 00181 ** Write methods now handle large raw data elements (such as pixel data) 00182 ** without loading everything into memory. This allows very large images to 00183 ** be sent over a network connection, or to be copied without ever being 00184 ** fully in memory. 00185 ** 00186 ** Revision 1.22 2006/08/15 15:49:56 meichel 00187 ** Updated all code in module dcmdata to correctly compile when 00188 ** all standard C++ classes remain in namespace std. 00189 ** 00190 ** Revision 1.21 2005/12/08 16:28:32 meichel 00191 ** Changed include path schema for all DCMTK header files 00192 ** 00193 ** Revision 1.20 2005/11/24 12:50:57 meichel 00194 ** Fixed bug in code that prepares a byte stream that is fed into the MAC 00195 ** algorithm when creating or verifying a digital signature. The previous 00196 ** implementation was non-conformant when signatures included compressed 00197 ** (encapsulated) pixel data because the item length was included in the byte 00198 ** stream, while it should not. The global variable dcmEnableOldSignatureFormat 00199 ** and a corresponding command line option in dcmsign allow to re-enable the old 00200 ** implementation. 00201 ** 00202 ** Revision 1.19 2004/07/01 12:28:25 meichel 00203 ** Introduced virtual clone method for DcmObject and derived classes. 00204 ** 00205 ** Revision 1.18 2002/12/06 12:49:12 joergr 00206 ** Enhanced "print()" function by re-working the implementation and replacing 00207 ** the boolean "showFullData" parameter by a more general integer flag. 00208 ** Added doc++ documentation. 00209 ** Made source code formatting more consistent with other modules/files. 00210 ** 00211 ** Revision 1.17 2002/08/27 16:55:38 meichel 00212 ** Initial release of new DICOM I/O stream classes that add support for stream 00213 ** compression (deflated little endian explicit VR transfer syntax) 00214 ** 00215 ** Revision 1.16 2002/05/24 14:51:42 meichel 00216 ** Moved helper methods that are useful for different compression techniques 00217 ** from module dcmjpeg to module dcmdata 00218 ** 00219 ** Revision 1.15 2002/04/25 09:41:46 joergr 00220 ** Added support for XML output of DICOM objects. 00221 ** 00222 ** Revision 1.14 2001/11/16 15:54:39 meichel 00223 ** Adapted digital signature code to final text of supplement 41. 00224 ** 00225 ** Revision 1.13 2001/09/25 17:19:28 meichel 00226 ** Adapted dcmdata to class OFCondition 00227 ** 00228 ** Revision 1.12 2001/06/01 15:48:43 meichel 00229 ** Updated copyright header 00230 ** 00231 ** Revision 1.11 2000/04/14 15:31:33 meichel 00232 ** Removed default value from output stream passed to print() method. 00233 ** Required for use in multi-thread environments. 00234 ** 00235 ** Revision 1.10 2000/03/08 16:26:17 meichel 00236 ** Updated copyright header. 00237 ** 00238 ** Revision 1.9 2000/03/03 14:05:25 meichel 00239 ** Implemented library support for redirecting error messages into memory 00240 ** instead of printing them to stdout/stderr for GUI applications. 00241 ** 00242 ** Revision 1.8 2000/02/10 10:50:53 joergr 00243 ** Added new feature to dcmdump (enhanced print method of dcmdata): write 00244 ** pixel data/item value fields to raw files. 00245 ** 00246 ** Revision 1.7 1999/03/31 09:24:45 meichel 00247 ** Updated copyright header in module dcmdata 00248 ** 00249 ** Revision 1.6 1998/11/12 16:47:43 meichel 00250 ** Implemented operator= for all classes derived from DcmObject. 00251 ** 00252 ** Revision 1.5 1997/05/22 16:57:10 andreas 00253 ** - Corrected errors for writing of pixel sequences for encapsulated 00254 ** transfer syntaxes. 00255 ** 00256 ** Revision 1.4 1996/01/29 13:38:13 andreas 00257 ** - new put method for every VR to put value as a string 00258 ** - better and unique print methods 00259 ** 00260 ** Revision 1.3 1996/01/05 13:22:58 andreas 00261 ** - changed to support new streaming facilities 00262 ** - more cleanups 00263 ** - merged read / write methods for block and file transfer 00264 ** 00265 */