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

dcdatset.h

00001 /*
00002  *
00003  *  Copyright (C) 1994-2002, 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 the class DcmDataset
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/dcdatset.h,v $
00027  *  CVS/RCS Revision: $Revision: 1.22 $
00028  *  Status:           $State: Exp $
00029  *
00030  *  CVS/RCS Log at end of file
00031  *
00032  */
00033 
00034 
00035 #ifndef DCDATSET_H
00036 #define DCDATSET_H
00037 
00038 #include "osconfig.h"    /* make sure OS specific configuration is included first */
00039 
00040 #include "ofconsol.h"
00041 #include "dcerror.h"
00042 #include "dctypes.h"
00043 #include "dcitem.h"
00044 
00045 
00046 // forward declarations
00047 class DcmInputStream;
00048 class DcmOutputStream;
00049 class DcmRepresentationParameter;
00050 
00051 
00054 class DcmDataset
00055   : public DcmItem
00056 {
00057 
00058   public:
00059 
00062     DcmDataset();
00063 
00067     DcmDataset(const DcmDataset &old);
00068 
00071     virtual ~DcmDataset();
00072 
00076     virtual DcmEVR ident() const;
00077 
00078     E_TransferSyntax getOriginalXfer() const;
00079 
00087     virtual void print(ostream &out,
00088                        const size_t flags = 0,
00089                        const int level = 0,
00090                        const char *pixelFileName = NULL,
00091                        size_t *pixelCounter = NULL);
00092 
00093     Uint32 calcElementLength(const E_TransferSyntax xfer,
00094                              const E_EncodingType enctype);
00095 
00096     virtual OFBool canWriteXfer(const E_TransferSyntax newXfer,
00097                                 const E_TransferSyntax oldXfer = EXS_Unknown);
00098 
00114     virtual OFCondition read(DcmInputStream &inStream,
00115                              const E_TransferSyntax xfer = EXS_Unknown,
00116                              const E_GrpLenEncoding glenc = EGL_noChange,
00117                              const Uint32 maxReadLength = DCM_MaxReadLength);
00118 
00125     virtual OFCondition write(DcmOutputStream &outStream,
00126                               const E_TransferSyntax oxfer,
00127                               const E_EncodingType enctype = EET_UndefinedLength);
00128 
00156     virtual OFCondition write(DcmOutputStream &outStream,
00157                               const E_TransferSyntax oxfer,
00158                               const E_EncodingType enctype,
00159                               const E_GrpLenEncoding glenc,
00160                               const E_PaddingEncoding padenc = EPD_noChange,
00161                               const Uint32 padlen = 0,
00162                               const Uint32 subPadlen = 0,
00163                               Uint32 instanceLength = 0);
00164 
00171     virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream,
00172                                              const E_TransferSyntax oxfer,
00173                                              const E_EncodingType enctype = EET_UndefinedLength);
00174 
00181     virtual OFCondition writeXML(ostream &out,
00182                                  const size_t flags = 0);
00183 
00195     virtual OFCondition loadFile(const char *fileName,
00196                                  const E_TransferSyntax readXfer = EXS_Unknown,
00197                                  const E_GrpLenEncoding groupLength = EGL_noChange,
00198                                  const Uint32 maxReadLength = DCM_MaxReadLength);
00199 
00212     virtual OFCondition saveFile(const char *fileName,
00213                                  const E_TransferSyntax writeXfer = EXS_Unknown,
00214                                  const E_EncodingType encodingType = EET_UndefinedLength,
00215                                  const E_GrpLenEncoding groupLength = EGL_recalcGL,
00216                                  const E_PaddingEncoding padEncoding = EPD_noChange,
00217                                  const Uint32 padLength = 0,
00218                                  const Uint32 subPadLength = 0);
00219 
00220     // methods for different pixel representations
00221 
00222     // choose Representation changes the representation of
00223     // PixelData Elements in the data set to the given representation
00224     // If the representation does not exists it creates one.
00225     OFCondition chooseRepresentation(const E_TransferSyntax repType,
00226                                      const DcmRepresentationParameter *repParam);
00227 
00228     // checks if all PixelData elements have a conforming representation
00229     // (for definition of conforming representation see dcpixel.h).
00230     // if one PixelData element has no conforming representation
00231     // OFFalse is returned.
00232     OFBool hasRepresentation(const E_TransferSyntax repType,
00233                              const DcmRepresentationParameter *repParam);
00234 
00237     void removeAllButOriginalRepresentations();
00238 
00242     void removeAllButCurrentRepresentations();
00243 
00244 
00245   private:
00246 
00248     DcmDataset& operator=(const DcmDataset&);
00249 
00251     E_TransferSyntax Xfer;
00252 };
00253 
00254 
00255 #endif // DCDATSET_H
00256 
00257 
00258 /*
00259 ** CVS/RCS Log:
00260 ** $Log: dcdatset.h,v $
00261 ** Revision 1.22  2003/03/21 13:06:46  meichel
00262 ** Minor code purifications for warnings reported by MSVC in Level 4
00263 **
00264 ** Revision 1.21  2002/12/09 09:31:13  wilkens
00265 ** Modified/Added doc++ documentation.
00266 **
00267 ** Revision 1.20  2002/12/06 12:49:08  joergr
00268 ** Enhanced "print()" function by re-working the implementation and replacing
00269 ** the boolean "showFullData" parameter by a more general integer flag.
00270 ** Added doc++ documentation.
00271 ** Made source code formatting more consistent with other modules/files.
00272 **
00273 ** Revision 1.19  2002/08/27 16:55:30  meichel
00274 ** Initial release of new DICOM I/O stream classes that add support for stream
00275 **   compression (deflated little endian explicit VR transfer syntax)
00276 **
00277 ** Revision 1.18  2002/04/25 09:40:13  joergr
00278 ** Added support for XML output of DICOM objects.
00279 **
00280 ** Revision 1.17  2002/04/11 12:22:52  joergr
00281 ** Added new methods for loading and saving DICOM files.
00282 **
00283 ** Revision 1.16  2001/09/25 17:19:24  meichel
00284 ** Adapted dcmdata to class OFCondition
00285 **
00286 ** Revision 1.15  2001/06/01 15:48:34  meichel
00287 ** Updated copyright header
00288 **
00289 ** Revision 1.14  2000/11/07 16:56:05  meichel
00290 ** Initial release of dcmsign module for DICOM Digital Signatures
00291 **
00292 ** Revision 1.13  2000/04/14 15:31:31  meichel
00293 ** Removed default value from output stream passed to print() method.
00294 **   Required for use in multi-thread environments.
00295 **
00296 ** Revision 1.12  2000/03/08 16:26:12  meichel
00297 ** Updated copyright header.
00298 **
00299 ** Revision 1.11  2000/03/03 14:05:22  meichel
00300 ** Implemented library support for redirecting error messages into memory
00301 **   instead of printing them to stdout/stderr for GUI applications.
00302 **
00303 ** Revision 1.10  2000/02/10 10:50:50  joergr
00304 ** Added new feature to dcmdump (enhanced print method of dcmdata): write
00305 ** pixel data/item value fields to raw files.
00306 **
00307 ** Revision 1.9  1999/03/31 09:24:32  meichel
00308 ** Updated copyright header in module dcmdata
00309 **
00310 ** Revision 1.8  1997/07/21 08:14:38  andreas
00311 ** - New environment for encapsulated pixel representations. DcmPixelData
00312 **   can contain different representations and uses codecs to convert
00313 **   between them. Codecs are derived from the DcmCodec class. New error
00314 **   codes are introduced for handling of representations. New internal
00315 **   value representation (only for ident()) for PixelData
00316 ** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL)
00317 **   with one unique boolean type OFBool.
00318 **
00319 ** Revision 1.7  1997/05/27 13:48:26  andreas
00320 ** - Add method canWriteXfer to class DcmObject and all derived classes.
00321 **   This method checks whether it is possible to convert the original
00322 **   transfer syntax to an new transfer syntax. The check is used in the
00323 **   dcmconv utility to prohibit the change of a compressed transfer
00324 **   syntax to a uncompressed.
00325 **
00326 ** Revision 1.6  1997/05/16 08:23:45  andreas
00327 ** - Revised handling of GroupLength elements and support of
00328 **   DataSetTrailingPadding elements. The enumeratio E_GrpLenEncoding
00329 **   got additional enumeration values (for a description see dctypes.h).
00330 **   addGroupLength and removeGroupLength methods are replaced by
00331 **   computeGroupLengthAndPadding. To support Padding, the parameters of
00332 **   element and sequence write functions changed.
00333 ** - Added a new method calcElementLength to calculate the length of an
00334 **   element, item or sequence. For elements it returns the length of
00335 **   tag, length field, vr field, and value length, for item and
00336 **   sequences it returns the length of the whole item. sequence including
00337 **   the Delimitation tag (if appropriate).  It can never return
00338 **   UndefinedLength.
00339 **
00340 ** Revision 1.5  1996/08/05 08:45:17  andreas
00341 ** new print routine with additional parameters:
00342 **         - print into files
00343 **         - fix output length for elements
00344 ** corrected error in search routine with parameter ESM_fromStackTop
00345 **
00346 ** Revision 1.4  1996/01/09 11:06:14  andreas
00347 ** New Support for Visual C++
00348 ** Correct problems with inconsistent const declarations
00349 **
00350 ** Revision 1.3  1996/01/05 13:22:52  andreas
00351 ** - changed to support new streaming facilities
00352 ** - more cleanups
00353 ** - merged read / write methods for block and file transfer
00354 **
00355 */


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