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 DcmOtherByteOtherWord 00019 * 00020 * Last Update: $Author: joergr $ 00021 * Update Date: $Date: 2010-10-14 13:15:43 $ 00022 * CVS/RCS Revision: $Revision: 1.35 $ 00023 * Status: $State: Exp $ 00024 * 00025 * CVS/RCS Log at end of file 00026 * 00027 */ 00028 00029 00030 #ifndef DCVROBOW_H 00031 #define DCVROBOW_H 00032 00033 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */ 00034 #include "dcmtk/dcmdata/dcelem.h" 00035 00036 00040 class DcmOtherByteOtherWord 00041 : public DcmElement 00042 { 00043 00044 public: 00045 00051 DcmOtherByteOtherWord(const DcmTag &tag, 00052 const Uint32 len = 0); 00053 00057 DcmOtherByteOtherWord(const DcmOtherByteOtherWord &old); 00058 00061 virtual ~DcmOtherByteOtherWord(); 00062 00067 DcmOtherByteOtherWord &operator=(const DcmOtherByteOtherWord &obj); 00068 00072 virtual DcmObject *clone() const 00073 { 00074 return new DcmOtherByteOtherWord(*this); 00075 } 00076 00089 virtual OFCondition copyFrom(const DcmObject& rhs); 00090 00094 virtual DcmEVR ident() const; 00095 00101 virtual OFCondition checkValue(const OFString &vm = "", 00102 const OFBool oldFormat = OFFalse); 00103 00107 virtual unsigned long getVM(); 00108 00115 virtual OFCondition setVR(DcmEVR vr); 00116 00126 virtual void print(STD_NAMESPACE ostream&out, 00127 const size_t flags = 0, 00128 const int level = 0, 00129 const char *pixelFileName = NULL, 00130 size_t *pixelCounter = NULL); 00131 00137 virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, 00138 const E_TransferSyntax oldXfer); 00139 00147 virtual OFCondition write( 00148 DcmOutputStream &outStream, 00149 const E_TransferSyntax oxfer, 00150 const E_EncodingType enctype, 00151 DcmWriteCache *wcache); 00152 00158 virtual OFCondition writeXML(STD_NAMESPACE ostream&out, 00159 const size_t flags = 0); 00160 00168 virtual OFCondition writeSignatureFormat( 00169 DcmOutputStream &outStream, 00170 const E_TransferSyntax oxfer, 00171 const E_EncodingType enctype, 00172 DcmWriteCache *wcache); 00173 00180 virtual OFCondition getUint8(Uint8 &byteVal, 00181 const unsigned long pos = 0); 00182 00189 virtual OFCondition getUint16(Uint16 &wordVal, 00190 const unsigned long pos = 0); 00191 00197 virtual OFCondition getUint8Array(Uint8 *&byteVals); 00198 00204 virtual OFCondition getUint16Array(Uint16 *&wordVals); 00205 00215 virtual OFCondition getOFString(OFString &stringVal, 00216 const unsigned long pos, 00217 OFBool normalize = OFTrue); 00218 00228 virtual OFCondition getOFStringArray(OFString &stringVal, 00229 OFBool normalize = OFTrue); 00230 00237 virtual OFCondition putUint8Array(const Uint8 *byteValue, 00238 const unsigned long numBytes); 00239 00247 virtual OFCondition putUint16Array(const Uint16 *wordValue, 00248 const unsigned long numWords); 00249 00257 virtual OFCondition createUint8Array(const Uint32 numBytes, 00258 Uint8 *&bytes); 00259 00267 virtual OFCondition createUint16Array(const Uint32 numWords, 00268 Uint16 *&words); 00269 00277 virtual OFCondition putString(const char *stringVal); 00278 00283 virtual OFCondition verify(const OFBool autocorrect = OFFalse); 00284 00285 00286 protected: 00287 00291 virtual void postLoadValue(); 00292 00296 OFCondition alignValue(); 00297 00306 void printPixel(STD_NAMESPACE ostream&out, 00307 const size_t flags, 00308 const int level, 00309 const char *pixelFileName, 00310 size_t *pixelCounter); 00311 00312 private: 00313 00317 OFBool compactAfterTransfer; 00318 00319 }; 00320 00321 00322 #endif // DCVROBOW_H 00323 00324 00325 /* 00326 ** CVS/RCS Log: 00327 ** $Log: dcvrobow.h,v $ 00328 ** Revision 1.35 2010-10-14 13:15:43 joergr 00329 ** Updated copyright header. Added reference to COPYRIGHT file. 00330 ** 00331 ** Revision 1.34 2010-04-23 15:26:13 joergr 00332 ** Specify an appropriate default value for the "vm" parameter of checkValue(). 00333 ** 00334 ** Revision 1.33 2010-04-23 14:25:27 joergr 00335 ** Added new method to all VR classes which checks whether the stored value 00336 ** conforms to the VR definition and to the specified VM. 00337 ** 00338 ** Revision 1.32 2008-08-15 09:26:31 meichel 00339 ** Under certain conditions (odd length compressed pixel data fragments) 00340 ** class DcmOtherByteOtherWord needs to load the attribute value into main 00341 ** memory during a write() operation, in order to add a pad byte. A new flag 00342 ** compactAfterTransfer now makes sure that the memory is released once the 00343 ** write operation has finished, so that only a single fragment at a time 00344 ** needs to fully reside in memory. 00345 ** 00346 ** Revision 1.31 2008-07-17 11:19:49 onken 00347 ** Updated copyFrom() documentation. 00348 ** 00349 ** Revision 1.30 2008-07-17 10:30:23 onken 00350 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which 00351 ** permits setting an instance's value from an existing object. Implemented 00352 ** assignment operator where necessary. 00353 ** 00354 ** Revision 1.29 2007-11-29 14:30:19 meichel 00355 ** Write methods now handle large raw data elements (such as pixel data) 00356 ** without loading everything into memory. This allows very large images to 00357 ** be sent over a network connection, or to be copied without ever being 00358 ** fully in memory. 00359 ** 00360 ** Revision 1.28 2007/06/07 09:01:15 joergr 00361 ** Added createUint8Array() and createUint16Array() methods. 00362 ** 00363 ** Revision 1.27 2006/08/15 15:49:56 meichel 00364 ** Updated all code in module dcmdata to correctly compile when 00365 ** all standard C++ classes remain in namespace std. 00366 ** 00367 ** Revision 1.26 2005/12/08 16:29:03 meichel 00368 ** Changed include path schema for all DCMTK header files 00369 ** 00370 ** Revision 1.25 2004/07/01 12:28:25 meichel 00371 ** Introduced virtual clone method for DcmObject and derived classes. 00372 ** 00373 ** Revision 1.24 2003/07/09 12:13:13 meichel 00374 ** Included dcmodify in MSVC build system, updated headers 00375 ** 00376 ** Revision 1.23 2003/06/12 13:29:28 joergr 00377 ** Fixed inconsistent API documentation reported by Doxygen. 00378 ** 00379 ** Revision 1.22 2002/12/06 12:49:17 joergr 00380 ** Enhanced "print()" function by re-working the implementation and replacing 00381 ** the boolean "showFullData" parameter by a more general integer flag. 00382 ** Added doc++ documentation. 00383 ** Made source code formatting more consistent with other modules/files. 00384 ** 00385 ** Revision 1.21 2002/08/27 16:55:40 meichel 00386 ** Initial release of new DICOM I/O stream classes that add support for stream 00387 ** compression (deflated little endian explicit VR transfer syntax) 00388 ** 00389 ** Revision 1.20 2002/04/25 10:03:45 joergr 00390 ** Added getOFString() implementation. 00391 ** Added/modified getOFStringArray() implementation. 00392 ** Added support for XML output of DICOM objects. 00393 ** 00394 ** Revision 1.19 2001/10/02 11:47:34 joergr 00395 ** Added getUint8/16 routines to class DcmOtherByteOtherWord. 00396 ** 00397 ** Revision 1.18 2001/09/25 17:19:32 meichel 00398 ** Adapted dcmdata to class OFCondition 00399 ** 00400 ** Revision 1.17 2001/06/01 15:48:51 meichel 00401 ** Updated copyright header 00402 ** 00403 ** Revision 1.16 2000/11/07 16:56:10 meichel 00404 ** Initial release of dcmsign module for DICOM Digital Signatures 00405 ** 00406 ** Revision 1.15 2000/04/14 15:31:34 meichel 00407 ** Removed default value from output stream passed to print() method. 00408 ** Required for use in multi-thread environments. 00409 ** 00410 ** Revision 1.14 2000/03/08 16:26:24 meichel 00411 ** Updated copyright header. 00412 ** 00413 ** Revision 1.13 2000/03/03 14:05:27 meichel 00414 ** Implemented library support for redirecting error messages into memory 00415 ** instead of printing them to stdout/stderr for GUI applications. 00416 ** 00417 ** Revision 1.12 2000/02/10 10:50:55 joergr 00418 ** Added new feature to dcmdump (enhanced print method of dcmdata): write 00419 ** pixel data/item value fields to raw files. 00420 ** 00421 ** Revision 1.11 1999/03/31 09:25:03 meichel 00422 ** Updated copyright header in module dcmdata 00423 ** 00424 ** Revision 1.10 1998/11/12 16:47:51 meichel 00425 ** Implemented operator= for all classes derived from DcmObject. 00426 ** 00427 ** Revision 1.9 1997/07/21 08:25:15 andreas 00428 ** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL) 00429 ** with one unique boolean type OFBool. 00430 ** 00431 ** Revision 1.8 1997/05/27 13:48:30 andreas 00432 ** - Add method canWriteXfer to class DcmObject and all derived classes. 00433 ** This method checks whether it is possible to convert the original 00434 ** transfer syntax to an new transfer syntax. The check is used in the 00435 ** dcmconv utility to prohibit the change of a compressed transfer 00436 ** syntax to a uncompressed. 00437 ** 00438 ** Revision 1.7 1997/05/16 08:31:20 andreas 00439 ** - Revised handling of GroupLength elements and support of 00440 ** DataSetTrailingPadding elements. The enumeratio E_GrpLenEncoding 00441 ** got additional enumeration values (for a description see dctypes.h). 00442 ** addGroupLength and removeGroupLength methods are replaced by 00443 ** computeGroupLengthAndPadding. To support Padding, the parameters of 00444 ** element and sequence write functions changed. 00445 ** 00446 ** Revision 1.6 1997/04/18 08:13:31 andreas 00447 ** - The put/get-methods for all VRs did not conform to the C++-Standard 00448 ** draft. Some Compilers (e.g. SUN-C++ Compiler, Metroworks 00449 ** CodeWarrier, etc.) create many warnings concerning the hiding of 00450 ** overloaded get methods in all derived classes of DcmElement. 00451 ** So the interface of all value representation classes in the 00452 ** library are changed rapidly, e.g. 00453 ** OFCondition get(Uint16 & value, const unsigned long pos); 00454 ** becomes 00455 ** OFCondition getUint16(Uint16 & value, const unsigned long pos); 00456 ** All (retired) "returntype get(...)" methods are deleted. 00457 ** For more information see dcmdata/include/dcelem.h 00458 ** 00459 ** Revision 1.5 1996/08/05 08:45:33 andreas 00460 ** new print routine with additional parameters: 00461 ** - print into files 00462 ** - fix output length for elements 00463 ** corrected error in search routine with parameter ESM_fromStackTop 00464 ** 00465 ** Revision 1.4 1996/01/29 13:38:17 andreas 00466 ** - new put method for every VR to put value as a string 00467 ** - better and unique print methods 00468 ** 00469 ** Revision 1.3 1996/01/05 13:23:07 andreas 00470 ** - changed to support new streaming facilities 00471 ** - more cleanups 00472 ** - merged read / write methods for block and file transfer 00473 ** 00474 */