OFFIS DCMTK  Version 3.6.0
dcdatset.h
1 /*
2  *
3  * Copyright (C) 1994-2010, OFFIS e.V.
4  * All rights reserved. See COPYRIGHT file for details.
5  *
6  * This software and supporting documentation were developed by
7  *
8  * OFFIS e.V.
9  * R&D Division Health
10  * Escherweg 2
11  * D-26121 Oldenburg, Germany
12  *
13  *
14  * Module: dcmdata
15  *
16  * Author: Gerd Ehlers, Andreas Barth
17  *
18  * Purpose: Interface of the class DcmDataset
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:15:40 $
22  * CVS/RCS Revision: $Revision: 1.36 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DCDATSET_H
31 #define DCDATSET_H
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 
35 #include "dcmtk/dcmdata/dcitem.h"
36 
37 
38 // forward declarations
39 class DcmInputStream;
40 class DcmOutputStream;
42 
43 
47  : public DcmItem
48 {
49 
50  public:
51 
54  DcmDataset();
55 
59  DcmDataset(const DcmDataset &old);
60 
63  virtual ~DcmDataset();
64 
68  DcmDataset& operator=(const DcmDataset& obj);
69 
73  virtual DcmObject *clone() const
74  {
75  return new DcmDataset(*this);
76  }
77 
90  virtual OFCondition copyFrom(const DcmObject& rhs);
91 
95  virtual DcmEVR ident() const;
96 
100  virtual OFCondition clear();
101 
105  virtual void removeInvalidGroups();
106 
110  E_TransferSyntax getOriginalXfer() const;
111 
119  virtual void print(STD_NAMESPACE ostream&out,
120  const size_t flags = 0,
121  const int level = 0,
122  const char *pixelFileName = NULL,
123  size_t *pixelCounter = NULL);
124 
135  Uint32 calcElementLength(const E_TransferSyntax xfer,
136  const E_EncodingType enctype);
137 
143  virtual OFBool canWriteXfer(const E_TransferSyntax newXfer,
144  const E_TransferSyntax oldXfer = EXS_Unknown);
145 
161  virtual OFCondition read(DcmInputStream &inStream,
162  const E_TransferSyntax xfer = EXS_Unknown,
163  const E_GrpLenEncoding glenc = EGL_noChange,
164  const Uint32 maxReadLength = DCM_MaxReadLength);
165 
173  virtual OFCondition write(DcmOutputStream &outStream,
174  const E_TransferSyntax oxfer,
175  const E_EncodingType enctype,
176  DcmWriteCache *wcache);
177 
206  virtual OFCondition write(DcmOutputStream &outStream,
207  const E_TransferSyntax oxfer,
208  const E_EncodingType enctype,
209  DcmWriteCache *wcache,
210  const E_GrpLenEncoding glenc,
211  const E_PaddingEncoding padenc = EPD_noChange,
212  const Uint32 padlen = 0,
213  const Uint32 subPadlen = 0,
214  Uint32 instanceLength = 0);
215 
224  DcmOutputStream &outStream,
225  const E_TransferSyntax oxfer,
226  const E_EncodingType enctype,
227  DcmWriteCache *wcache);
228 
235  virtual OFCondition writeXML(STD_NAMESPACE ostream&out,
236  const size_t flags = 0);
237 
249  virtual OFCondition loadFile(const char *fileName,
250  const E_TransferSyntax readXfer = EXS_Unknown,
251  const E_GrpLenEncoding groupLength = EGL_noChange,
252  const Uint32 maxReadLength = DCM_MaxReadLength);
253 
266  virtual OFCondition saveFile(const char *fileName,
267  const E_TransferSyntax writeXfer = EXS_Unknown,
268  const E_EncodingType encodingType = EET_UndefinedLength,
269  const E_GrpLenEncoding groupLength = EGL_recalcGL,
270  const E_PaddingEncoding padEncoding = EPD_noChange,
271  const Uint32 padLength = 0,
272  const Uint32 subPadLength = 0);
273 
274  // methods for different pixel representations
275 
283  OFCondition chooseRepresentation(const E_TransferSyntax repType,
284  const DcmRepresentationParameter *repParam);
285 
293  OFBool hasRepresentation(const E_TransferSyntax repType,
294  const DcmRepresentationParameter *repParam);
295 
299 
304 
305 
306  private:
307 
309  E_TransferSyntax Xfer;
310 };
311 
312 
313 #endif // DCDATSET_H
314 
315 
316 /*
317 ** CVS/RCS Log:
318 ** $Log: dcdatset.h,v $
319 ** Revision 1.36 2010-10-14 13:15:40 joergr
320 ** Updated copyright header. Added reference to COPYRIGHT file.
321 **
322 ** Revision 1.35 2010-10-08 08:37:00 joergr
323 ** Enhanced documentation on pixel-related parameters.
324 **
325 ** Revision 1.34 2010-10-05 16:20:47 joergr
326 ** Fixed various Doxygen API documentation issues.
327 **
328 ** Revision 1.33 2010-03-01 09:08:44 uli
329 ** Removed some unnecessary include directives in the headers.
330 **
331 ** Revision 1.32 2010-02-22 11:39:53 uli
332 ** Remove some unneeded includes.
333 **
334 ** Revision 1.31 2009-08-25 13:00:52 joergr
335 ** Added new methods which remove all data elements with an invalid group number
336 ** from the meta information header, dataset and/or fileformat.
337 **
338 ** Revision 1.30 2008-07-17 11:19:48 onken
339 ** Updated copyFrom() documentation.
340 **
341 ** Revision 1.29 2008-07-17 10:30:22 onken
342 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which
343 ** permits setting an instance's value from an existing object. Implemented
344 ** assignment operator where necessary.
345 **
346 ** Revision 1.28 2008-06-23 12:09:13 joergr
347 ** Fixed inconsistencies in Doxygen API documentation.
348 **
349 ** Revision 1.27 2007/11/29 14:30:19 meichel
350 ** Write methods now handle large raw data elements (such as pixel data)
351 ** without loading everything into memory. This allows very large images to
352 ** be sent over a network connection, or to be copied without ever being
353 ** fully in memory.
354 **
355 ** Revision 1.26 2006/08/15 15:49:56 meichel
356 ** Updated all code in module dcmdata to correctly compile when
357 ** all standard C++ classes remain in namespace std.
358 **
359 ** Revision 1.25 2005/12/08 16:28:02 meichel
360 ** Changed include path schema for all DCMTK header files
361 **
362 ** Revision 1.24 2005/11/11 10:31:57 meichel
363 ** Added explicit DcmDataset::clear() implementation.
364 **
365 ** Revision 1.23 2004/07/01 12:28:25 meichel
366 ** Introduced virtual clone method for DcmObject and derived classes.
367 **
368 ** Revision 1.22 2003/03/21 13:06:46 meichel
369 ** Minor code purifications for warnings reported by MSVC in Level 4
370 **
371 ** Revision 1.21 2002/12/09 09:31:13 wilkens
372 ** Modified/Added doc++ documentation.
373 **
374 ** Revision 1.20 2002/12/06 12:49:08 joergr
375 ** Enhanced "print()" function by re-working the implementation and replacing
376 ** the boolean "showFullData" parameter by a more general integer flag.
377 ** Added doc++ documentation.
378 ** Made source code formatting more consistent with other modules/files.
379 **
380 ** Revision 1.19 2002/08/27 16:55:30 meichel
381 ** Initial release of new DICOM I/O stream classes that add support for stream
382 ** compression (deflated little endian explicit VR transfer syntax)
383 **
384 ** Revision 1.18 2002/04/25 09:40:13 joergr
385 ** Added support for XML output of DICOM objects.
386 **
387 ** Revision 1.17 2002/04/11 12:22:52 joergr
388 ** Added new methods for loading and saving DICOM files.
389 **
390 ** Revision 1.16 2001/09/25 17:19:24 meichel
391 ** Adapted dcmdata to class OFCondition
392 **
393 ** Revision 1.15 2001/06/01 15:48:34 meichel
394 ** Updated copyright header
395 **
396 ** Revision 1.14 2000/11/07 16:56:05 meichel
397 ** Initial release of dcmsign module for DICOM Digital Signatures
398 **
399 ** Revision 1.13 2000/04/14 15:31:31 meichel
400 ** Removed default value from output stream passed to print() method.
401 ** Required for use in multi-thread environments.
402 **
403 ** Revision 1.12 2000/03/08 16:26:12 meichel
404 ** Updated copyright header.
405 **
406 ** Revision 1.11 2000/03/03 14:05:22 meichel
407 ** Implemented library support for redirecting error messages into memory
408 ** instead of printing them to stdout/stderr for GUI applications.
409 **
410 ** Revision 1.10 2000/02/10 10:50:50 joergr
411 ** Added new feature to dcmdump (enhanced print method of dcmdata): write
412 ** pixel data/item value fields to raw files.
413 **
414 ** Revision 1.9 1999/03/31 09:24:32 meichel
415 ** Updated copyright header in module dcmdata
416 **
417 ** Revision 1.8 1997/07/21 08:14:38 andreas
418 ** - New environment for encapsulated pixel representations. DcmPixelData
419 ** can contain different representations and uses codecs to convert
420 ** between them. Codecs are derived from the DcmCodec class. New error
421 ** codes are introduced for handling of representations. New internal
422 ** value representation (only for ident()) for PixelData
423 ** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL)
424 ** with one unique boolean type OFBool.
425 **
426 ** Revision 1.7 1997/05/27 13:48:26 andreas
427 ** - Add method canWriteXfer to class DcmObject and all derived classes.
428 ** This method checks whether it is possible to convert the original
429 ** transfer syntax to an new transfer syntax. The check is used in the
430 ** dcmconv utility to prohibit the change of a compressed transfer
431 ** syntax to a uncompressed.
432 **
433 ** Revision 1.6 1997/05/16 08:23:45 andreas
434 ** - Revised handling of GroupLength elements and support of
435 ** DataSetTrailingPadding elements. The enumeratio E_GrpLenEncoding
436 ** got additional enumeration values (for a description see dctypes.h).
437 ** addGroupLength and removeGroupLength methods are replaced by
438 ** computeGroupLengthAndPadding. To support Padding, the parameters of
439 ** element and sequence write functions changed.
440 ** - Added a new method calcElementLength to calculate the length of an
441 ** element, item or sequence. For elements it returns the length of
442 ** tag, length field, vr field, and value length, for item and
443 ** sequences it returns the length of the whole item. sequence including
444 ** the Delimitation tag (if appropriate). It can never return
445 ** UndefinedLength.
446 **
447 ** Revision 1.5 1996/08/05 08:45:17 andreas
448 ** new print routine with additional parameters:
449 ** - print into files
450 ** - fix output length for elements
451 ** corrected error in search routine with parameter ESM_fromStackTop
452 **
453 ** Revision 1.4 1996/01/09 11:06:14 andreas
454 ** New Support for Visual C++
455 ** Correct problems with inconsistent const declarations
456 **
457 ** Revision 1.3 1996/01/05 13:22:52 andreas
458 ** - changed to support new streaming facilities
459 ** - more cleanups
460 ** - merged read / write methods for block and file transfer
461 **
462 */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2