00001 /* 00002 * 00003 * Copyright (C) 1996-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: dcmimgle 00019 * 00020 * Author: Joerg Riesmeier 00021 * 00022 * Purpose: DicomDocument (Header) 00023 * 00024 * Last Update: $Author: meichel $ 00025 * Update Date: $Date: 2005/12/08 16:47:38 $ 00026 * CVS/RCS Revision: $Revision: 1.19 $ 00027 * Status: $State: Exp $ 00028 * 00029 * CVS/RCS Log at end of file 00030 * 00031 */ 00032 00033 00034 #ifndef DIDOCU_H 00035 #define DIDOCU_H 00036 00037 #include "dcmtk/config/osconfig.h" 00038 #include "dcmtk/dcmdata/dctypes.h" 00039 #include "dcmtk/dcmdata/dcfilefo.h" 00040 #include "dcmtk/dcmdata/dcxfer.h" 00041 #include "dcmtk/dcmimgle/diobjcou.h" 00042 #include "dcmtk/ofstd/ofstring.h" /* for class OFString */ 00043 00044 #define INCLUDE_CSTDDEF 00045 #include "dcmtk/ofstd/ofstdinc.h" 00046 00047 00048 /*------------------------* 00049 * forward declarations * 00050 *------------------------*/ 00051 00052 class DcmStack; 00053 class DcmObject; 00054 class DcmTagKey; 00055 class DcmElement; 00056 class DcmSequenceOfItems; 00057 00058 00059 /*---------------------* 00060 * class declaration * 00061 *---------------------*/ 00062 00068 class DiDocument 00069 : public DiObjectCounter 00070 { 00071 00072 public: 00073 00081 DiDocument(const char *filename, 00082 const unsigned long flags = 0, 00083 const unsigned long fstart = 0, 00084 const unsigned long fcount = 0); 00085 00094 DiDocument(DcmObject *object, 00095 const E_TransferSyntax xfer, 00096 const unsigned long flags = 0, 00097 const unsigned long fstart = 0, 00098 const unsigned long fcount = 0); 00099 00102 virtual ~DiDocument(); 00103 00108 inline int good() const 00109 { 00110 return Object != NULL; 00111 } 00112 00117 inline DcmObject *getDicomObject() const 00118 { 00119 return Object; 00120 } 00121 00126 inline unsigned long getFrameStart() const 00127 { 00128 return FrameStart; 00129 } 00130 00135 inline unsigned long getFrameCount() const 00136 { 00137 return FrameCount; 00138 } 00139 00144 inline unsigned long getFlags() const 00145 { 00146 return Flags; 00147 } 00148 00153 inline E_TransferSyntax getTransferSyntax() const 00154 { 00155 return Xfer; 00156 } 00157 00165 DcmElement *search(const DcmTagKey &tag, 00166 DcmObject *obj = NULL) const; 00167 00175 int search(const DcmTagKey &tag, 00176 DcmStack &stack) const; 00177 00178 00185 unsigned long getVM(const DcmTagKey &tag) const; 00186 00196 unsigned long getValue(const DcmTagKey &tag, 00197 Uint16 &returnVal, 00198 const unsigned long pos = 0, 00199 DcmObject *item = NULL) const; 00200 00209 unsigned long getValue(const DcmTagKey &tag, 00210 Sint16 &returnVal, 00211 const unsigned long pos = 0) const; 00212 00221 unsigned long getValue(const DcmTagKey &tag, 00222 Uint32 &returnVal, 00223 const unsigned long pos = 0) const; 00224 00233 unsigned long getValue(const DcmTagKey &tag, 00234 Sint32 &returnVal, 00235 const unsigned long pos = 0) const; 00236 00245 unsigned long getValue(const DcmTagKey &tag, 00246 double &returnVal, 00247 const unsigned long pos = 0) const; 00248 00257 unsigned long getValue(const DcmTagKey &tag, 00258 const Uint16 *&returnVal, 00259 DcmObject *item = NULL) const; 00260 00269 unsigned long getValue(const DcmTagKey &tag, 00270 const char *&returnVal, 00271 DcmObject *item = NULL) const; 00272 00282 unsigned long getValue(const DcmTagKey &tag, 00283 OFString &returnVal, 00284 const unsigned long pos = 0, 00285 DcmObject *item = NULL) const; 00286 00294 unsigned long getSequence(const DcmTagKey &tag, 00295 DcmSequenceOfItems *&seq) const; 00296 00305 static unsigned long getElemValue(const DcmElement *elem, 00306 Uint16 &returnVal, 00307 const unsigned long pos = 0); 00308 00316 static unsigned long getElemValue(const DcmElement *elem, 00317 const Uint16 *&returnVal); 00318 00326 static unsigned long getElemValue(const DcmElement *elem, 00327 const char *&returnVal); 00328 00337 static unsigned long getElemValue(const DcmElement *elem, 00338 OFString &returnVal, 00339 const unsigned long pos = 0); 00340 00341 protected: 00342 00345 void convertPixelData(); 00346 00347 00348 private: 00349 00351 DcmObject *Object; 00353 DcmFileFormat *FileFormat; 00355 E_TransferSyntax Xfer; 00356 00358 unsigned long FrameStart; 00360 unsigned long FrameCount; 00361 00363 unsigned long Flags; 00364 00365 // --- declarations to avoid compiler warnings 00366 00367 DiDocument(const DiDocument &); 00368 DiDocument &operator=(const DiDocument &); 00369 }; 00370 00371 00372 #endif 00373 00374 00375 /* 00376 * 00377 * CVS/RCS Log: 00378 * $Log: didocu.h,v $ 00379 * Revision 1.19 2005/12/08 16:47:38 meichel 00380 * Changed include path schema for all DCMTK header files 00381 * 00382 * Revision 1.18 2003/12/08 18:20:13 joergr 00383 * Added comment that class DiDocument is meant for internal purposes only. 00384 * Removed leading underscore characters from preprocessor symbols (reserved 00385 * symbols). Updated CVS header. 00386 * 00387 * Revision 1.17 2003/07/04 13:25:54 meichel 00388 * Replaced forward declarations for OFString with explicit includes, 00389 * needed when compiling with HAVE_STD_STRING 00390 * 00391 * Revision 1.16 2003/06/12 15:08:34 joergr 00392 * Fixed inconsistent API documentation reported by Doxygen. 00393 * 00394 * Revision 1.15 2002/11/27 14:08:03 meichel 00395 * Adapted module dcmimgle to use of new header file ofstdinc.h 00396 * 00397 * Revision 1.14 2002/08/21 09:51:44 meichel 00398 * Removed DicomImage and DiDocument constructors that take a DcmStream 00399 * parameter 00400 * 00401 * Revision 1.13 2002/06/26 16:01:07 joergr 00402 * Added new methods to get the explanation string of stored VOI windows and 00403 * LUTs (not only of the currently selected VOI transformation). 00404 * 00405 * Revision 1.12 2001/11/29 16:56:51 joergr 00406 * Fixed bug in dcmimgle that caused incorrect decoding of some JPEG compressed 00407 * images (certain DICOM attributes, e.g. photometric interpretation, might 00408 * change during decompression process). 00409 * 00410 * Revision 1.11 2001/11/19 12:55:29 joergr 00411 * Adapted code to support new dcmjpeg module and JPEG compressed images. 00412 * 00413 * Revision 1.10 2001/06/01 15:49:41 meichel 00414 * Updated copyright header 00415 * 00416 * Revision 1.9 2000/09/12 10:04:43 joergr 00417 * Corrected bug: wrong parameter for attribute search routine led to crashes 00418 * when multiple pixel data attributes were contained in the dataset (e.g. 00419 * IconImageSequence). Added new checking routines to avoid crashes when 00420 * processing corrupted image data. 00421 * 00422 * Revision 1.8 2000/03/08 16:24:15 meichel 00423 * Updated copyright header. 00424 * 00425 * Revision 1.7 2000/02/02 11:02:37 joergr 00426 * Removed space characters before preprocessor directives. 00427 * 00428 * Revision 1.6 1999/09/17 12:09:20 joergr 00429 * Added/changed/completed DOC++ style comments in the header files. 00430 * 00431 * Revision 1.5 1999/03/24 17:19:59 joergr 00432 * Added/Modified comments and formatting. 00433 * 00434 * Revision 1.4 1999/02/03 17:00:33 joergr 00435 * Added BEGIN_EXTERN_C and END_EXTERN_C to some C includes. 00436 * 00437 * Revision 1.3 1998/12/16 16:26:52 joergr 00438 * Added methods to use getOFString from class DcmElement (incl. multi value 00439 * fields). 00440 * 00441 * Revision 1.2 1998/12/14 17:16:32 joergr 00442 * Added (simplified) methods to return values of a given DcmElement object. 00443 * 00444 * Revision 1.1 1998/11/27 14:53:59 joergr 00445 * Added copyright message. 00446 * Added static methods to return the value of a given element. 00447 * Added support of frame start and count for future use. 00448 * 00449 * Revision 1.7 1998/07/01 08:39:20 joergr 00450 * Minor changes to avoid compiler warnings (gcc 2.8.1 with additional 00451 * options), e.g. add copy constructors. 00452 * 00453 * Revision 1.6 1998/06/25 08:50:09 joergr 00454 * Added compatibility mode to support ACR-NEMA images and wrong 00455 * palette attribute tags. 00456 * 00457 * Revision 1.5 1998/05/11 14:53:15 joergr 00458 * Added CVS/RCS header to each file. 00459 * 00460 * 00461 */