dcmdata/include/dcmtk/dcmdata/dcxfer.h

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: Handling of transfer syntaxes
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:15:43 $
00022  *  CVS/RCS Revision: $Revision: 1.24 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 #ifndef DCXFER_H
00030 #define DCXFER_H
00031 
00032 #include "dcmtk/config/osconfig.h"    /* make sure OS specific configuration is included first */
00033 #include "dcmtk/dcmdata/dctypes.h"
00034 #include "dcmtk/dcmdata/dcvr.h"
00035 
00038 typedef enum {
00040     EXS_Unknown = -1,
00042     EXS_LittleEndianImplicit = 0,
00044     EXS_BigEndianImplicit = 1,
00046     EXS_LittleEndianExplicit = 2,
00048     EXS_BigEndianExplicit = 3,
00050     EXS_JPEGProcess1TransferSyntax = 4,
00052     EXS_JPEGProcess2_4TransferSyntax = 5,
00054     EXS_JPEGProcess3_5TransferSyntax = 6,
00056     EXS_JPEGProcess6_8TransferSyntax = 7,
00058     EXS_JPEGProcess7_9TransferSyntax = 8,
00060     EXS_JPEGProcess10_12TransferSyntax = 9,
00062     EXS_JPEGProcess11_13TransferSyntax = 10,
00064     EXS_JPEGProcess14TransferSyntax = 11,
00066     EXS_JPEGProcess15TransferSyntax = 12,
00068     EXS_JPEGProcess16_18TransferSyntax = 13,
00070     EXS_JPEGProcess17_19TransferSyntax = 14,
00072     EXS_JPEGProcess20_22TransferSyntax = 15,
00074     EXS_JPEGProcess21_23TransferSyntax = 16,
00076     EXS_JPEGProcess24_26TransferSyntax = 17,
00078     EXS_JPEGProcess25_27TransferSyntax = 18,
00080     EXS_JPEGProcess28TransferSyntax = 19,
00082     EXS_JPEGProcess29TransferSyntax = 20,
00084     EXS_JPEGProcess14SV1TransferSyntax = 21,
00086     EXS_RLELossless = 22,
00088     EXS_JPEGLSLossless = 23,
00090     EXS_JPEGLSLossy = 24,
00092     EXS_DeflatedLittleEndianExplicit = 25,
00094     EXS_JPEG2000LosslessOnly = 26,
00096     EXS_JPEG2000 = 27,
00098     EXS_MPEG2MainProfileAtMainLevel = 28,
00100     EXS_MPEG2MainProfileAtHighLevel = 29,
00102     EXS_JPEG2000MulticomponentLosslessOnly = 30,
00104     EXS_JPEG2000Multicomponent = 31,
00106     EXS_JPIPReferenced = 32,
00108     EXS_JPIPReferencedDeflate = 33
00109 } E_TransferSyntax;
00110 
00113 typedef enum {
00115     EBO_unknown = 0,
00116 
00118     EBO_LittleEndian = 1,
00119 
00121     EBO_BigEndian = 2
00122 } E_ByteOrder;
00123 
00126 typedef enum {
00128     EVT_Implicit = 0,
00129 
00131     EVT_Explicit = 1
00132 } E_VRType;
00133 
00136 typedef enum {
00138     EJE_NotEncapsulated = 0,
00139 
00141     EJE_Encapsulated = 1
00142 } E_JPEGEncapsulated;
00143 
00146 typedef enum
00147 {
00149     ESC_none = 0
00151   , ESC_unsupported = 1
00152 #ifdef WITH_ZLIB
00154   , ESC_zlib = 2
00155 #endif
00156 } E_StreamCompression;
00157 
00158 
00161 class DcmXfer
00162 {
00163 public:
00167     DcmXfer( E_TransferSyntax xfer );
00168 
00172     DcmXfer( const char *xferName_xferID );
00173 
00175     DcmXfer( const DcmXfer &newXfer );
00176 
00178     ~DcmXfer();
00179 
00181     DcmXfer & operator = ( const E_TransferSyntax xfer );
00182 
00184     DcmXfer & operator = ( const DcmXfer &newtag );
00185 
00187     inline E_TransferSyntax getXfer() const  { return xferSyn; }
00188 
00190     inline E_ByteOrder getByteOrder() const { return byteOrder; }
00191 
00193     inline const char* getXferName() const { return xferName; }
00194 
00196     inline const char* getXferID() const { return xferID; }
00197 
00199     inline OFBool isLittleEndian() const
00200     {
00201         return byteOrder == EBO_LittleEndian;
00202     }
00203 
00205     inline OFBool isBigEndian() const { return byteOrder == EBO_BigEndian; }
00206 
00208     inline OFBool isImplicitVR() const { return vrType == EVT_Implicit; }
00209 
00211     inline OFBool isExplicitVR() const { return vrType == EVT_Explicit; }
00212 
00214     inline OFBool isEncapsulated() const
00215     {
00216         return encapsulated == EJE_Encapsulated;
00217     }
00218 
00220     inline OFBool isNotEncapsulated() const
00221     {
00222         return encapsulated == EJE_NotEncapsulated;
00223     }
00224 
00230     inline Uint32 getJPEGProcess8Bit() const { return JPEGProcess8; }
00231 
00237     inline Uint32 getJPEGProcess12Bit() const { return JPEGProcess12;}
00238 
00240     inline OFBool isRetired() const
00241     {
00242         return retired;
00243     }
00244 
00246     inline E_StreamCompression getStreamCompression() const { return streamCompression;}
00247 
00254     Uint32 sizeofTagHeader(DcmEVR evr) const;
00255 
00256 private:
00258     const char          *xferID;
00259 
00261     const char          *xferName;
00262 
00264     E_TransferSyntax    xferSyn;
00265 
00267     E_ByteOrder         byteOrder;
00268 
00270     E_VRType            vrType;
00271 
00273     E_JPEGEncapsulated  encapsulated;
00274 
00276     Uint32              JPEGProcess8;
00277 
00279     Uint32              JPEGProcess12;
00280 
00282     OFBool              retired;
00283 
00285     E_StreamCompression streamCompression;
00286 
00287 };
00288 
00293 extern const E_ByteOrder gLocalByteOrder;
00294 
00295 #endif // DCXFER_H
00296 
00297 /*
00298  * CVS/RCS Log:
00299  * $Log: dcxfer.h,v $
00300  * Revision 1.24  2010-10-14 13:15:43  joergr
00301  * Updated copyright header. Added reference to COPYRIGHT file.
00302  *
00303  * Revision 1.23  2010-09-15 08:46:16  joergr
00304  * Added definition of XML encoding transfer syntax (Supplement 114) and JPIP
00305  * referenced transfer syntaxes (Supplement 106).
00306  *
00307  * Revision 1.22  2010-09-02 12:12:43  joergr
00308  * Added support for "MPEG2 Main Profile @ High Level" transfer syntax.
00309  *
00310  * Revision 1.21  2008-06-23 12:09:13  joergr
00311  * Fixed inconsistencies in Doxygen API documentation.
00312  *
00313  * Revision 1.20  2008-04-23 06:39:37  meichel
00314  * Added new method DcmXfer::isRetired that returns true for
00315  *   retired transfer syntaxes.
00316  *
00317  * Revision 1.19  2007/11/29 14:30:19  meichel
00318  * Write methods now handle large raw data elements (such as pixel data)
00319  *   without loading everything into memory. This allows very large images to
00320  *   be sent over a network connection, or to be copied without ever being
00321  *   fully in memory.
00322  *
00323  * Revision 1.18  2005/12/08 16:29:17  meichel
00324  * Changed include path schema for all DCMTK header files
00325  *
00326  * Revision 1.17  2005/10/25 08:55:32  meichel
00327  * Updated list of UIDs and added support for new transfer syntaxes
00328  *   and storage SOP classes.
00329  *
00330  * Revision 1.16  2004/04/06 18:01:50  joergr
00331  * Updated data dictionary, UIDs and transfer syntaxes for the latest Final Text
00332  * Supplements (42 and 47) and Correction Proposals (CP 25).
00333  *
00334  * Revision 1.15  2002/08/27 16:55:41  meichel
00335  * Initial release of new DICOM I/O stream classes that add support for stream
00336  *   compression (deflated little endian explicit VR transfer syntax)
00337  *
00338  * Revision 1.14  2001/11/08 16:17:30  meichel
00339  * Updated data dictionary, UIDs and transfer syntaxes for DICOM 2001 edition.
00340  *
00341  * Revision 1.13  2001/06/01 15:48:55  meichel
00342  * Updated copyright header
00343  *
00344  * Revision 1.12  2001/01/17 10:20:36  meichel
00345  * Added toolkit support for JPEG-LS transfer syntaxes
00346  *
00347  * Revision 1.11  2000/04/14 16:01:23  meichel
00348  * Minor changes for thread safety.
00349  *
00350  * Revision 1.10  2000/03/08 16:26:28  meichel
00351  * Updated copyright header.
00352  *
00353  * Revision 1.9  1999/03/31 09:25:13  meichel
00354  * Updated copyright header in module dcmdata
00355  *
00356  *
00357  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1