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 DcmPixelSequence 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:15:41 $ 00022 * CVS/RCS Revision: $Revision: 1.37 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 00030 #ifndef DCPIXSEQ_H 00031 #define DCPIXSEQ_H 00032 00033 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00034 #include "dcmtk/dcmdata/dcsequen.h" 00035 #include "dcmtk/dcmdata/dcofsetl.h" /* for class DcmOffsetList */ 00036 00037 class DcmPixelItem; 00038 00045 class DcmPixelSequence : public DcmSequenceOfItems 00046 { 00047 public: 00048 00053 DcmPixelSequence(const DcmTag &tag, const Uint32 len = 0); 00054 00058 DcmPixelSequence(const DcmPixelSequence &old); 00059 00061 virtual ~DcmPixelSequence(); 00062 00066 DcmPixelSequence &operator=(const DcmPixelSequence &obj); 00067 00071 virtual DcmObject *clone() const 00072 { 00073 return new DcmPixelSequence(*this); 00074 } 00075 00088 virtual OFCondition copyFrom(const DcmObject& rhs); 00089 00093 virtual DcmEVR ident(void) const { return EVR_pixelSQ; } 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 00118 virtual Uint32 calcElementLength(const E_TransferSyntax xfer, 00119 const E_EncodingType enctype); 00120 00127 virtual OFCondition insert(DcmPixelItem *item, 00128 unsigned long where = DCM_EndOfListIndex); 00129 00136 virtual OFCondition getItem(DcmPixelItem * &item, 00137 const unsigned long num); 00138 00146 virtual OFCondition remove(DcmPixelItem * &item, 00147 const unsigned long num); 00148 00154 virtual OFCondition remove(DcmPixelItem* item); 00155 00162 OFCondition changeXfer(const E_TransferSyntax newXfer); 00163 00169 virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, 00170 const E_TransferSyntax oldXfer); 00171 00185 virtual OFCondition read(DcmInputStream & inStream, 00186 const E_TransferSyntax ixfer, 00187 const E_GrpLenEncoding glenc = EGL_noChange, 00188 const Uint32 maxReadLength = DCM_MaxReadLength); 00189 00197 virtual OFCondition write(DcmOutputStream &outStream, 00198 const E_TransferSyntax oxfer, 00199 const E_EncodingType enctype, 00200 DcmWriteCache *wcache); 00201 00209 virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, 00210 const E_TransferSyntax oxfer, 00211 const E_EncodingType enctype, 00212 DcmWriteCache *wcache); 00213 00223 virtual OFCondition storeCompressedFrame(DcmOffsetList &offsetList, 00224 Uint8 *compressedData, 00225 Uint32 compressedLen, 00226 Uint32 fragmentSize); 00227 00228 protected: 00229 00237 virtual OFCondition makeSubObject(DcmObject * &newObject, // out 00238 const DcmTag &newTag, 00239 const Uint32 newLength); // in 00240 00241 private: 00246 E_TransferSyntax Xfer; 00247 00249 virtual OFCondition insert(DcmItem* /*item*/, 00250 unsigned long /*where*/ = DCM_EndOfListIndex, 00251 OFBool /*before*/ = OFFalse) 00252 { 00253 return EC_IllegalCall; 00254 } 00255 00257 virtual DcmItem* getItem(const unsigned long /*num*/) 00258 { 00259 return NULL; 00260 } 00261 00263 virtual DcmItem* remove(const unsigned long /*num*/) 00264 { 00265 return NULL; 00266 } 00267 00269 virtual DcmItem* remove(DcmItem* /*item*/) 00270 { 00271 return NULL; 00272 } 00273 00274 }; 00275 00276 #endif // DCPIXSEQ_H 00277 00278 00279 /* 00280 ** CVS/RCS Log: 00281 ** $Log: dcpixseq.h,v $ 00282 ** Revision 1.37 2010-10-14 13:15:41 joergr 00283 ** Updated copyright header. Added reference to COPYRIGHT file. 00284 ** 00285 ** Revision 1.36 2010-03-01 09:08:44 uli 00286 ** Removed some unnecessary include directives in the headers. 00287 ** 00288 ** Revision 1.35 2010-02-22 11:39:54 uli 00289 ** Remove some unneeded includes. 00290 ** 00291 ** Revision 1.34 2009-02-04 17:54:30 joergr 00292 ** Fixed various layout and formatting issues. 00293 ** 00294 ** Revision 1.33 2009-02-04 10:18:19 joergr 00295 ** Fixed issue with compressed frames of odd length (possibly wrong values in 00296 ** basic offset table). 00297 ** 00298 ** Revision 1.32 2008-07-17 11:19:49 onken 00299 ** Updated copyFrom() documentation. 00300 ** 00301 ** Revision 1.31 2008-07-17 10:30:23 onken 00302 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which 00303 ** permits setting an instance's value from an existing object. Implemented 00304 ** assignment operator where necessary. 00305 ** 00306 ** Revision 1.30 2008-06-23 12:09:13 joergr 00307 ** Fixed inconsistencies in Doxygen API documentation. 00308 ** 00309 ** Revision 1.29 2007/11/29 14:30:19 meichel 00310 ** Write methods now handle large raw data elements (such as pixel data) 00311 ** without loading everything into memory. This allows very large images to 00312 ** be sent over a network connection, or to be copied without ever being 00313 ** fully in memory. 00314 ** 00315 ** Revision 1.28 2006/08/15 15:49:56 meichel 00316 ** Updated all code in module dcmdata to correctly compile when 00317 ** all standard C++ classes remain in namespace std. 00318 ** 00319 ** Revision 1.27 2005/12/08 16:28:31 meichel 00320 ** Changed include path schema for all DCMTK header files 00321 ** 00322 ** Revision 1.26 2004/07/01 12:28:25 meichel 00323 ** Introduced virtual clone method for DcmObject and derived classes. 00324 ** 00325 ** Revision 1.25 2002/12/06 12:49:12 joergr 00326 ** Enhanced "print()" function by re-working the implementation and replacing 00327 ** the boolean "showFullData" parameter by a more general integer flag. 00328 ** Added doc++ documentation. 00329 ** Made source code formatting more consistent with other modules/files. 00330 ** 00331 ** Revision 1.24 2002/08/27 16:55:38 meichel 00332 ** Initial release of new DICOM I/O stream classes that add support for stream 00333 ** compression (deflated little endian explicit VR transfer syntax) 00334 ** 00335 ** Revision 1.23 2002/05/24 14:51:42 meichel 00336 ** Moved helper methods that are useful for different compression techniques 00337 ** from module dcmjpeg to module dcmdata 00338 ** 00339 ** Revision 1.22 2001/09/25 17:19:28 meichel 00340 ** Adapted dcmdata to class OFCondition 00341 ** 00342 ** Revision 1.21 2001/06/01 15:48:42 meichel 00343 ** Updated copyright header 00344 ** 00345 ** Revision 1.20 2000/11/07 16:56:08 meichel 00346 ** Initial release of dcmsign module for DICOM Digital Signatures 00347 ** 00348 ** Revision 1.19 2000/04/14 16:02:23 meichel 00349 ** Removed default value from output stream passed to print() method. 00350 ** Required for use in multi-thread environments. 00351 ** 00352 ** Revision 1.18 2000/03/08 16:26:17 meichel 00353 ** Updated copyright header. 00354 ** 00355 ** Revision 1.17 2000/03/06 18:11:30 joergr 00356 ** Local variable hided member variable (reported by Sun CC 4.2). 00357 ** 00358 ** Revision 1.16 2000/03/03 14:41:56 joergr 00359 ** Corrected bug related to padding of file and item size. 00360 ** 00361 ** Revision 1.15 2000/03/03 14:05:25 meichel 00362 ** Implemented library support for redirecting error messages into memory 00363 ** instead of printing them to stdout/stderr for GUI applications. 00364 ** 00365 ** Revision 1.14 2000/02/10 10:50:53 joergr 00366 ** Added new feature to dcmdump (enhanced print method of dcmdata): write 00367 ** pixel data/item value fields to raw files. 00368 ** 00369 ** Revision 1.13 1999/03/31 09:24:44 meichel 00370 ** Updated copyright header in module dcmdata 00371 ** 00372 ** Revision 1.12 1998/11/12 16:47:42 meichel 00373 ** Implemented operator= for all classes derived from DcmObject. 00374 ** 00375 ** Revision 1.11 1998/07/15 15:48:51 joergr 00376 ** Removed several compiler warnings reported by gcc 2.8.1 with 00377 ** additional options, e.g. missing copy constructors and assignment 00378 ** operators, initialization of member variables in the body of a 00379 ** constructor instead of the member initialization list, hiding of 00380 ** methods by use of identical names, uninitialized member variables, 00381 ** missing const declaration of char pointers. Replaced tabs by spaces. 00382 ** 00383 ** Revision 1.10 1997/07/21 08:25:10 andreas 00384 ** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL) 00385 ** with one unique boolean type OFBool. 00386 ** 00387 ** Revision 1.9 1997/05/27 13:48:29 andreas 00388 ** - Add method canWriteXfer to class DcmObject and all derived classes. 00389 ** This method checks whether it is possible to convert the original 00390 ** transfer syntax to an new transfer syntax. The check is used in the 00391 ** dcmconv utility to prohibit the change of a compressed transfer 00392 ** syntax to a uncompressed. 00393 ** 00394 ** Revision 1.8 1997/05/22 16:57:10 andreas 00395 ** - Corrected errors for writing of pixel sequences for encapsulated 00396 ** transfer syntaxes. 00397 ** 00398 ** Revision 1.7 1997/05/06 09:22:37 hewett 00399 ** Added a "before" flag to the insertion of items for compatibility with 00400 ** insertion in normal Sequences. 00401 ** 00402 ** Revision 1.6 1996/08/05 08:45:27 andreas 00403 ** new print routine with additional parameters: 00404 ** - print into files 00405 ** - fix output length for elements 00406 ** corrected error in search routine with parameter ESM_fromStackTop 00407 ** 00408 ** Revision 1.5 1996/01/29 13:38:13 andreas 00409 ** - new put method for every VR to put value as a string 00410 ** - better and unique print methods 00411 ** 00412 ** Revision 1.4 1996/01/24 09:34:55 andreas 00413 ** Support for 64 bit long 00414 ** 00415 ** Revision 1.3 1996/01/05 13:22:58 andreas 00416 ** - changed to support new streaming facilities 00417 ** - more cleanups 00418 ** - merged read / write methods for block and file transfer 00419 ** 00420 */