Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

dcmetinf.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-2003, 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:  Gerd Ehlers, Andreas Barth
00021  *
00022  *  Purpose: Interface of class DcmMetaInfo
00023  *
00024  *  Last Update:      $Author: meichel $
00025  *  Update Date:      $Date: 2003/03/21 13:06:46 $
00026  *  Source File:      $Source: /share/dicom/cvs-depot/dcmtk/dcmdata/include/dcmetinf.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.19 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 
00035 #ifndef DCMETINF_H
00036 #define DCMETINF_H
00037 
00038 #include "osconfig.h"    /* make sure OS specific configuration is included first */
00039 
00040 #include "ofconsol.h"
00041 #include "dctypes.h"
00042 #include "dcitem.h"
00043 
00044 
00045 #define DCM_Magic                       "DICM"
00046 #define DCM_MagicLen                    4
00047 #define DCM_PreambleLen                 128
00048 #define META_HEADER_DEFAULT_TRANSFERSYNTAX EXS_LittleEndianExplicit
00049 
00050 
00053 class DcmMetaInfo
00054   : public DcmItem
00055 {
00056 
00057   public:
00058 
00061     DcmMetaInfo();
00062 
00066     DcmMetaInfo(const DcmMetaInfo &old);
00067 
00070     virtual ~DcmMetaInfo();
00071 
00075     virtual DcmEVR ident() const;
00076 
00077     E_TransferSyntax getOriginalXfer() const;
00078 
00086     virtual void print(ostream &out,
00087                        const size_t flags = 0,
00088                        const int level = 0,
00089                        const char *pixelFileName = NULL,
00090                        size_t *pixelCounter = NULL);
00091 
00092     virtual void transferInit();
00093     virtual void transferEnd();
00094 
00095     virtual Uint32 calcElementLength(const E_TransferSyntax xfer,
00096                                      const E_EncodingType enctype);
00097 
00098     virtual OFCondition read(DcmInputStream &inStream,
00099                              const E_TransferSyntax xfer = EXS_Unknown,
00100                              const E_GrpLenEncoding glenc = EGL_noChange,
00101                              const Uint32 maxReadLength = DCM_MaxReadLength);
00102 
00109     virtual OFCondition write(DcmOutputStream &outStream,
00110                               const E_TransferSyntax oxfer,
00111                               const E_EncodingType enctype = EET_UndefinedLength);
00112 
00118     virtual OFCondition writeXML(ostream &out,
00119                                  const size_t flags = 0);
00120 
00121 
00122   private:
00123 
00125     DcmMetaInfo& operator=(const DcmMetaInfo&);
00126 
00127     void setPreamble();
00128 
00129     OFBool checkAndReadPreamble(DcmInputStream &inStream,
00130                                 E_TransferSyntax &newxfer);  // out
00131 
00132     OFBool nextTagIsMeta(DcmInputStream &inStream);
00133 
00134     OFCondition readGroupLength(DcmInputStream &inStream,       // inout
00135                                 const E_TransferSyntax xfer,    // in
00136                                 const DcmTagKey &xtag,          // in
00137                                 const E_GrpLenEncoding glenc,   // in
00138                                 Uint32 &headerLen,              // out
00139                                 Uint32 &bytesRead,              // out
00140                                 const Uint32 maxReadLength = DCM_MaxReadLength);   // in
00141 
00143     char filePreamble[DCM_PreambleLen + DCM_MagicLen];
00144 
00145     OFBool preambleUsed;
00146     E_TransferState fPreambleTransferState;
00147     E_TransferSyntax Xfer;
00148 
00149 };
00150 
00151 #endif // DCMETINF_H
00152 
00153 /*
00154 ** CVS/RCS Log:
00155 ** $Log: dcmetinf.h,v $
00156 ** Revision 1.19  2003/03/21 13:06:46  meichel
00157 ** Minor code purifications for warnings reported by MSVC in Level 4
00158 **
00159 ** Revision 1.18  2002/12/06 12:49:11  joergr
00160 ** Enhanced "print()" function by re-working the implementation and replacing
00161 ** the boolean "showFullData" parameter by a more general integer flag.
00162 ** Added doc++ documentation.
00163 ** Made source code formatting more consistent with other modules/files.
00164 **
00165 ** Revision 1.17  2002/08/27 16:55:35  meichel
00166 ** Initial release of new DICOM I/O stream classes that add support for stream
00167 **   compression (deflated little endian explicit VR transfer syntax)
00168 **
00169 ** Revision 1.16  2002/04/25 09:40:56  joergr
00170 ** Added support for XML output of DICOM objects.
00171 **
00172 ** Revision 1.15  2001/09/25 17:19:27  meichel
00173 ** Adapted dcmdata to class OFCondition
00174 **
00175 ** Revision 1.14  2001/06/01 15:48:41  meichel
00176 ** Updated copyright header
00177 **
00178 ** Revision 1.13  2000/04/14 15:31:32  meichel
00179 ** Removed default value from output stream passed to print() method.
00180 **   Required for use in multi-thread environments.
00181 **
00182 ** Revision 1.12  2000/03/08 16:26:16  meichel
00183 ** Updated copyright header.
00184 **
00185 ** Revision 1.11  2000/03/03 14:05:24  meichel
00186 ** Implemented library support for redirecting error messages into memory
00187 **   instead of printing them to stdout/stderr for GUI applications.
00188 **
00189 ** Revision 1.10  2000/02/10 10:50:51  joergr
00190 ** Added new feature to dcmdump (enhanced print method of dcmdata): write
00191 ** pixel data/item value fields to raw files.
00192 **
00193 ** Revision 1.9  1999/03/31 09:24:41  meichel
00194 ** Updated copyright header in module dcmdata
00195 **
00196 ** Revision 1.8  1997/09/22 14:56:12  hewett
00197 ** Added a method to retreive the original transfer syntax of a read
00198 ** meta-header (getOriginalXfer).  This functionality is needed by
00199 ** the DCMCHECK package.
00200 **
00201 ** Revision 1.7  1997/07/21 08:25:09  andreas
00202 ** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL)
00203 **   with one unique boolean type OFBool.
00204 **
00205 ** Revision 1.6  1997/05/16 08:23:47  andreas
00206 ** - Revised handling of GroupLength elements and support of
00207 **   DataSetTrailingPadding elements. The enumeratio E_GrpLenEncoding
00208 **   got additional enumeration values (for a description see dctypes.h).
00209 **   addGroupLength and removeGroupLength methods are replaced by
00210 **   computeGroupLengthAndPadding. To support Padding, the parameters of
00211 **   element and sequence write functions changed.
00212 ** - Added a new method calcElementLength to calculate the length of an
00213 **   element, item or sequence. For elements it returns the length of
00214 **   tag, length field, vr field, and value length, for item and
00215 **   sequences it returns the length of the whole item. sequence including
00216 **   the Delimitation tag (if appropriate).  It can never return
00217 **   UndefinedLength.
00218 **
00219 ** Revision 1.5  1996/08/05 08:45:24  andreas
00220 ** new print routine with additional parameters:
00221 **         - print into files
00222 **         - fix output length for elements
00223 ** corrected error in search routine with parameter ESM_fromStackTop
00224 **
00225 ** Revision 1.4  1996/01/09 11:06:16  andreas
00226 ** New Support for Visual C++
00227 ** Correct problems with inconsistent const declarations
00228 **
00229 ** Revision 1.3  1996/01/05 13:22:57  andreas
00230 ** - changed to support new streaming facilities
00231 ** - more cleanups
00232 ** - merged read / write methods for block and file transfer
00233 **
00234 */
00235 


Generated on 8 Dec 2004 for OFFIS DCMTK Version 3.5.3 by Doxygen 1.3.9.1