OFFIS DCMTK  Version 3.6.0
dcvrobow.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
17  *
18  * Purpose: Interface of class DcmOtherByteOtherWord
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:15:43 $
22  * CVS/RCS Revision: $Revision: 1.35 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 
30 #ifndef DCVROBOW_H
31 #define DCVROBOW_H
32 
33 #include "dcmtk/config/osconfig.h" /* make sure OS specific configuration is included first */
34 #include "dcmtk/dcmdata/dcelem.h"
35 
36 
41  : public DcmElement
42 {
43 
44  public:
45 
51  DcmOtherByteOtherWord(const DcmTag &tag,
52  const Uint32 len = 0);
53 
58 
61  virtual ~DcmOtherByteOtherWord();
62 
68 
72  virtual DcmObject *clone() const
73  {
74  return new DcmOtherByteOtherWord(*this);
75  }
76 
89  virtual OFCondition copyFrom(const DcmObject& rhs);
90 
94  virtual DcmEVR ident() const;
95 
101  virtual OFCondition checkValue(const OFString &vm = "",
102  const OFBool oldFormat = OFFalse);
103 
107  virtual unsigned long getVM();
108 
115  virtual OFCondition setVR(DcmEVR vr);
116 
126  virtual void print(STD_NAMESPACE ostream&out,
127  const size_t flags = 0,
128  const int level = 0,
129  const char *pixelFileName = NULL,
130  size_t *pixelCounter = NULL);
131 
137  virtual OFBool canWriteXfer(const E_TransferSyntax newXfer,
138  const E_TransferSyntax oldXfer);
139 
147  virtual OFCondition write(
148  DcmOutputStream &outStream,
149  const E_TransferSyntax oxfer,
150  const E_EncodingType enctype,
151  DcmWriteCache *wcache);
152 
158  virtual OFCondition writeXML(STD_NAMESPACE ostream&out,
159  const size_t flags = 0);
160 
169  DcmOutputStream &outStream,
170  const E_TransferSyntax oxfer,
171  const E_EncodingType enctype,
172  DcmWriteCache *wcache);
173 
180  virtual OFCondition getUint8(Uint8 &byteVal,
181  const unsigned long pos = 0);
182 
189  virtual OFCondition getUint16(Uint16 &wordVal,
190  const unsigned long pos = 0);
191 
197  virtual OFCondition getUint8Array(Uint8 *&byteVals);
198 
204  virtual OFCondition getUint16Array(Uint16 *&wordVals);
205 
215  virtual OFCondition getOFString(OFString &stringVal,
216  const unsigned long pos,
217  OFBool normalize = OFTrue);
218 
228  virtual OFCondition getOFStringArray(OFString &stringVal,
229  OFBool normalize = OFTrue);
230 
237  virtual OFCondition putUint8Array(const Uint8 *byteValue,
238  const unsigned long numBytes);
239 
247  virtual OFCondition putUint16Array(const Uint16 *wordValue,
248  const unsigned long numWords);
249 
257  virtual OFCondition createUint8Array(const Uint32 numBytes,
258  Uint8 *&bytes);
259 
267  virtual OFCondition createUint16Array(const Uint32 numWords,
268  Uint16 *&words);
269 
277  virtual OFCondition putString(const char *stringVal);
278 
283  virtual OFCondition verify(const OFBool autocorrect = OFFalse);
284 
285 
286  protected:
287 
291  virtual void postLoadValue();
292 
297 
306  void printPixel(STD_NAMESPACE ostream&out,
307  const size_t flags,
308  const int level,
309  const char *pixelFileName,
310  size_t *pixelCounter);
311 
312 private:
313 
318 
319 };
320 
321 
322 #endif // DCVROBOW_H
323 
324 
325 /*
326 ** CVS/RCS Log:
327 ** $Log: dcvrobow.h,v $
328 ** Revision 1.35 2010-10-14 13:15:43 joergr
329 ** Updated copyright header. Added reference to COPYRIGHT file.
330 **
331 ** Revision 1.34 2010-04-23 15:26:13 joergr
332 ** Specify an appropriate default value for the "vm" parameter of checkValue().
333 **
334 ** Revision 1.33 2010-04-23 14:25:27 joergr
335 ** Added new method to all VR classes which checks whether the stored value
336 ** conforms to the VR definition and to the specified VM.
337 **
338 ** Revision 1.32 2008-08-15 09:26:31 meichel
339 ** Under certain conditions (odd length compressed pixel data fragments)
340 ** class DcmOtherByteOtherWord needs to load the attribute value into main
341 ** memory during a write() operation, in order to add a pad byte. A new flag
342 ** compactAfterTransfer now makes sure that the memory is released once the
343 ** write operation has finished, so that only a single fragment at a time
344 ** needs to fully reside in memory.
345 **
346 ** Revision 1.31 2008-07-17 11:19:49 onken
347 ** Updated copyFrom() documentation.
348 **
349 ** Revision 1.30 2008-07-17 10:30:23 onken
350 ** Implemented copyFrom() method for complete DcmObject class hierarchy, which
351 ** permits setting an instance's value from an existing object. Implemented
352 ** assignment operator where necessary.
353 **
354 ** Revision 1.29 2007-11-29 14:30:19 meichel
355 ** Write methods now handle large raw data elements (such as pixel data)
356 ** without loading everything into memory. This allows very large images to
357 ** be sent over a network connection, or to be copied without ever being
358 ** fully in memory.
359 **
360 ** Revision 1.28 2007/06/07 09:01:15 joergr
361 ** Added createUint8Array() and createUint16Array() methods.
362 **
363 ** Revision 1.27 2006/08/15 15:49:56 meichel
364 ** Updated all code in module dcmdata to correctly compile when
365 ** all standard C++ classes remain in namespace std.
366 **
367 ** Revision 1.26 2005/12/08 16:29:03 meichel
368 ** Changed include path schema for all DCMTK header files
369 **
370 ** Revision 1.25 2004/07/01 12:28:25 meichel
371 ** Introduced virtual clone method for DcmObject and derived classes.
372 **
373 ** Revision 1.24 2003/07/09 12:13:13 meichel
374 ** Included dcmodify in MSVC build system, updated headers
375 **
376 ** Revision 1.23 2003/06/12 13:29:28 joergr
377 ** Fixed inconsistent API documentation reported by Doxygen.
378 **
379 ** Revision 1.22 2002/12/06 12:49:17 joergr
380 ** Enhanced "print()" function by re-working the implementation and replacing
381 ** the boolean "showFullData" parameter by a more general integer flag.
382 ** Added doc++ documentation.
383 ** Made source code formatting more consistent with other modules/files.
384 **
385 ** Revision 1.21 2002/08/27 16:55:40 meichel
386 ** Initial release of new DICOM I/O stream classes that add support for stream
387 ** compression (deflated little endian explicit VR transfer syntax)
388 **
389 ** Revision 1.20 2002/04/25 10:03:45 joergr
390 ** Added getOFString() implementation.
391 ** Added/modified getOFStringArray() implementation.
392 ** Added support for XML output of DICOM objects.
393 **
394 ** Revision 1.19 2001/10/02 11:47:34 joergr
395 ** Added getUint8/16 routines to class DcmOtherByteOtherWord.
396 **
397 ** Revision 1.18 2001/09/25 17:19:32 meichel
398 ** Adapted dcmdata to class OFCondition
399 **
400 ** Revision 1.17 2001/06/01 15:48:51 meichel
401 ** Updated copyright header
402 **
403 ** Revision 1.16 2000/11/07 16:56:10 meichel
404 ** Initial release of dcmsign module for DICOM Digital Signatures
405 **
406 ** Revision 1.15 2000/04/14 15:31:34 meichel
407 ** Removed default value from output stream passed to print() method.
408 ** Required for use in multi-thread environments.
409 **
410 ** Revision 1.14 2000/03/08 16:26:24 meichel
411 ** Updated copyright header.
412 **
413 ** Revision 1.13 2000/03/03 14:05:27 meichel
414 ** Implemented library support for redirecting error messages into memory
415 ** instead of printing them to stdout/stderr for GUI applications.
416 **
417 ** Revision 1.12 2000/02/10 10:50:55 joergr
418 ** Added new feature to dcmdump (enhanced print method of dcmdata): write
419 ** pixel data/item value fields to raw files.
420 **
421 ** Revision 1.11 1999/03/31 09:25:03 meichel
422 ** Updated copyright header in module dcmdata
423 **
424 ** Revision 1.10 1998/11/12 16:47:51 meichel
425 ** Implemented operator= for all classes derived from DcmObject.
426 **
427 ** Revision 1.9 1997/07/21 08:25:15 andreas
428 ** - Replace all boolean types (BOOLEAN, CTNBOOLEAN, DICOM_BOOL, BOOL)
429 ** with one unique boolean type OFBool.
430 **
431 ** Revision 1.8 1997/05/27 13:48:30 andreas
432 ** - Add method canWriteXfer to class DcmObject and all derived classes.
433 ** This method checks whether it is possible to convert the original
434 ** transfer syntax to an new transfer syntax. The check is used in the
435 ** dcmconv utility to prohibit the change of a compressed transfer
436 ** syntax to a uncompressed.
437 **
438 ** Revision 1.7 1997/05/16 08:31:20 andreas
439 ** - Revised handling of GroupLength elements and support of
440 ** DataSetTrailingPadding elements. The enumeratio E_GrpLenEncoding
441 ** got additional enumeration values (for a description see dctypes.h).
442 ** addGroupLength and removeGroupLength methods are replaced by
443 ** computeGroupLengthAndPadding. To support Padding, the parameters of
444 ** element and sequence write functions changed.
445 **
446 ** Revision 1.6 1997/04/18 08:13:31 andreas
447 ** - The put/get-methods for all VRs did not conform to the C++-Standard
448 ** draft. Some Compilers (e.g. SUN-C++ Compiler, Metroworks
449 ** CodeWarrier, etc.) create many warnings concerning the hiding of
450 ** overloaded get methods in all derived classes of DcmElement.
451 ** So the interface of all value representation classes in the
452 ** library are changed rapidly, e.g.
453 ** OFCondition get(Uint16 & value, const unsigned long pos);
454 ** becomes
455 ** OFCondition getUint16(Uint16 & value, const unsigned long pos);
456 ** All (retired) "returntype get(...)" methods are deleted.
457 ** For more information see dcmdata/include/dcelem.h
458 **
459 ** Revision 1.5 1996/08/05 08:45:33 andreas
460 ** new print routine with additional parameters:
461 ** - print into files
462 ** - fix output length for elements
463 ** corrected error in search routine with parameter ESM_fromStackTop
464 **
465 ** Revision 1.4 1996/01/29 13:38:17 andreas
466 ** - new put method for every VR to put value as a string
467 ** - better and unique print methods
468 **
469 ** Revision 1.3 1996/01/05 13:23:07 andreas
470 ** - changed to support new streaming facilities
471 ** - more cleanups
472 ** - merged read / write methods for block and file transfer
473 **
474 */
virtual OFCondition putString(const char *stringVal)
set element value from the given character string.
abstract base class for all DICOM elements
Definition: dcelem.h:45
virtual void print(STD_NAMESPACE ostream &out, const size_t flags=0, const int level=0, const char *pixelFileName=NULL, size_t *pixelCounter=NULL)
print the current value to a stream.
virtual DcmObject * clone() const
clone method
Definition: dcvrobow.h:72
virtual OFCondition createUint16Array(const Uint32 numWords, Uint16 *&words)
create an empty Uint16 array of given number of words and set it.
DcmOtherByteOtherWord(const DcmTag &tag, const Uint32 len=0)
constructor.
virtual OFCondition getUint8(Uint8 &byteVal, const unsigned long pos=0)
get particular 8 bit value.
virtual OFCondition writeSignatureFormat(DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
special write method for creation of digital signatures
virtual OFCondition getUint16(Uint16 &wordVal, const unsigned long pos=0)
get particular 16 bit value.
virtual OFCondition getUint16Array(Uint16 *&wordVals)
get reference to stored 16 bit data.
this class encapsulates an attribute tag (group, element) and a VR.
Definition: dctag.h:50
This class implements a buffering mechanism that is used when writing large elements that reside in f...
Definition: dcwcache.h:50
base class for output streams.
Definition: dcostrma.h:119
virtual OFBool canWriteXfer(const E_TransferSyntax newXfer, const E_TransferSyntax oldXfer)
check whether the transfer syntax can be changed as specified
virtual OFCondition createUint8Array(const Uint32 numBytes, Uint8 *&bytes)
create an empty Uint8 array of given number of bytes and set it.
Abstract base class for most classes in module dcmdata.
Definition: dcobject.h:179
virtual OFCondition write(DcmOutputStream &outStream, const E_TransferSyntax oxfer, const E_EncodingType enctype, DcmWriteCache *wcache)
write object to a stream
virtual OFCondition getOFStringArray(OFString &stringVal, OFBool normalize=OFTrue)
get element value as a character string.
virtual unsigned long getVM()
get value multiplicity
virtual OFCondition verify(const OFBool autocorrect=OFFalse)
check the currently stored element value
virtual OFCondition putUint16Array(const Uint16 *wordValue, const unsigned long numWords)
set element value to given 16 bit data.
OFCondition alignValue()
align the element value to an even length (padding)
virtual void postLoadValue()
method is called after the element value has been loaded.
DcmOtherByteOtherWord & operator=(const DcmOtherByteOtherWord &obj)
assignment operator
OFBool compactAfterTransfer
this flag is used during write operations and indicates that compact() should be called once the writ...
Definition: dcvrobow.h:317
void printPixel(STD_NAMESPACE ostream &out, const size_t flags, const int level, const char *pixelFileName, size_t *pixelCounter)
print pixel data and optionally write it to a binary file.
virtual OFCondition writeXML(STD_NAMESPACE ostream &out, const size_t flags=0)
write object in XML format to a stream
virtual OFCondition checkValue(const OFString &vm="", const OFBool oldFormat=OFFalse)
check whether stored value conforms to the VR and to the specified VM
a class representing the DICOM value representations 'Other Byte String' (OB) and 'Other Word String'...
Definition: dcvrobow.h:40
virtual OFCondition getUint8Array(Uint8 *&byteVals)
get reference to stored 8 bit data.
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
virtual DcmEVR ident() const
get element type identifier
virtual OFCondition putUint8Array(const Uint8 *byteValue, const unsigned long numBytes)
set element value to given 8 bit data.
virtual ~DcmOtherByteOtherWord()
destructor
virtual OFCondition getOFString(OFString &stringVal, const unsigned long pos, OFBool normalize=OFTrue)
get a particular value as a character string.
virtual OFCondition copyFrom(const DcmObject &rhs)
Virtual object copying.
virtual OFCondition setVR(DcmEVR vr)
set/change the current value representation
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Wed Dec 28 2016 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.8