OFFIS DCMTK  Version 3.6.0
djcodece.h
1 /*
2  *
3  * Copyright (C) 2007-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: dcmjpls
15  *
16  * Author: Martin Willkomm, Uli Schlachter
17  *
18  * Purpose: codec classes for JPEG-LS encoders.
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:17:19 $
22  * CVS/RCS Revision: $Revision: 1.8 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DCMJPLS_DJCODEC_H
30 #define DCMJPLS_DJCODEC_H
31 
32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */
34 #include "dcmtk/dcmdata/dcofsetl.h" /* for struct DcmOffsetList */
35 #include "dcmtk/ofstd/ofstring.h" /* for class OFString */
36 
38 class DJLSCodecParameter;
39 class DicomImage;
40 
47 class DJLSEncoderBase : public DcmCodec
48 {
49 public:
50 
53 
55  virtual ~DJLSEncoderBase();
56 
67  virtual OFCondition decode(
68  const DcmRepresentationParameter * fromRepParam,
69  DcmPixelSequence * pixSeq,
70  DcmPolymorphOBOW& uncompressedPixelData,
71  const DcmCodecParameter * cp,
72  const DcmStack& objStack) const;
73 
99  virtual OFCondition decodeFrame(
100  const DcmRepresentationParameter * fromParam,
101  DcmPixelSequence * fromPixSeq,
102  const DcmCodecParameter * cp,
103  DcmItem *dataset,
104  Uint32 frameNo,
105  Uint32& startFragment,
106  void *buffer,
107  Uint32 bufSize,
108  OFString& decompressedColorModel) const;
109 
124  virtual OFCondition encode(
125  const Uint16 * pixelData,
126  const Uint32 length,
127  const DcmRepresentationParameter * toRepParam,
128  DcmPixelSequence * & pixSeq,
129  const DcmCodecParameter *cp,
130  DcmStack & objStack) const;
131 
146  virtual OFCondition encode(
147  const E_TransferSyntax fromRepType,
148  const DcmRepresentationParameter * fromRepParam,
149  DcmPixelSequence * fromPixSeq,
150  const DcmRepresentationParameter * toRepParam,
151  DcmPixelSequence * & toPixSeq,
152  const DcmCodecParameter * cp,
153  DcmStack & objStack) const;
154 
162  virtual OFBool canChangeCoding(
163  const E_TransferSyntax oldRepType,
164  const E_TransferSyntax newRepType) const;
165 
180  const DcmRepresentationParameter *fromParam,
181  DcmPixelSequence *fromPixSeq,
182  const DcmCodecParameter *cp,
183  DcmItem *dataset,
184  OFString &decompressedColorModel) const;
185 
186 private:
187 
192  virtual E_TransferSyntax supportedTransferSyntax() const = 0;
193 
207  const Uint16 *pixelData,
208  const Uint32 length,
209  DcmItem *dataset,
210  const DJLSRepresentationParameter *djrp,
211  DcmPixelSequence * & pixSeq,
212  const DJLSCodecParameter *djcp,
213  double& compressionRatio) const;
214 
229  const Uint16 * pixelData,
230  const Uint32 length,
231  DcmItem *dataset,
232  const DJLSRepresentationParameter *djrp,
233  DcmPixelSequence * & pixSeq,
234  const DJLSCodecParameter *djcp,
235  double& compressionRatio,
236  Uint16 nearLosslessDeviation) const;
237 
244  DcmItem *dataset,
245  DicomImage& image) const;
246 
255  DcmItem *dataset,
256  double ratio) const;
257 
267  DcmItem *dataset,
268  const DJLSRepresentationParameter *djrp,
269  double ratio) const;
270 
286  const Uint8 *framePointer,
287  Uint16 bitsAllocated,
288  Uint16 columns,
289  Uint16 rows,
290  Uint16 samplesPerPixel,
291  Uint16 planarConfiguration,
292  const OFString& photometricInterpretation,
293  DcmPixelSequence *pixelSequence,
294  DcmOffsetList &offsetList,
295  unsigned long &compressedSize,
296  const DJLSCodecParameter *djcp) const;
297 
310  DcmPixelSequence *pixelSequence,
311  DicomImage *dimage,
312  const OFString& photometricInterpretation,
313  DcmOffsetList &offsetList,
314  unsigned long &compressedSize,
315  const DJLSCodecParameter *djcp,
316  Uint32 frame,
317  Uint16 nearLosslessDeviation) const;
318 
329  Uint8 *target,
330  const Uint8 *source,
331  Uint16 components,
332  Uint32 width,
333  Uint32 height,
334  Uint16 bitsAllocated) const;
335 
346  Uint8 *target,
347  const Uint8 *source,
348  Uint16 components,
349  Uint32 width,
350  Uint32 height,
351  Uint16 bitsAllocated) const;
352 };
353 
354 
358 {
363  virtual E_TransferSyntax supportedTransferSyntax() const;
364 };
365 
369 {
374  virtual E_TransferSyntax supportedTransferSyntax() const;
375 };
376 
377 #endif
378 
379 /*
380  * CVS/RCS Log:
381  * $Log: djcodece.h,v $
382  * Revision 1.8 2010-10-14 13:17:19 joergr
383  * Updated copyright header. Added reference to COPYRIGHT file.
384  *
385  * Revision 1.7 2010-03-01 10:35:28 uli
386  * Renamed include guards to avoid name clash with e.g. dcmjpeg.
387  *
388  * Revision 1.6 2010-02-26 10:54:41 uli
389  * Fixed a compiler warning with MSVC about unsafe casts.
390  *
391  * Revision 1.5 2010-02-25 10:17:14 uli
392  * Fix doxygen comments in a couple of places.
393  *
394  * Revision 1.4 2009-11-17 16:57:14 joergr
395  * Added new method that allows for determining the color model of the
396  * decompressed image.
397  *
398  * Revision 1.3 2009-10-07 13:16:47 uli
399  * Switched to logging mechanism provided by the "new" oflog module.
400  *
401  * Revision 1.2 2009-07-31 09:14:52 meichel
402  * Added codec parameter and command line options that allow to control
403  * the interleave mode used in the JPEG-LS bitstream when compressing
404  * color images.
405  *
406  * Revision 1.1 2009-07-29 14:46:46 meichel
407  * Initial release of module dcmjpls, a JPEG-LS codec for DCMTK based on CharLS
408  *
409  * Revision 1.3 2008-05-29 10:54:05 meichel
410  * Implemented new method DcmPixelData::getUncompressedFrame
411  * that permits frame-wise access to compressed and uncompressed
412  * objects without ever loading the complete object into main memory.
413  * For this new method to work with compressed images, all classes derived from
414  * DcmCodec need to implement a new method decodeFrame(). For now, only
415  * dummy implementations returning an error code have been defined.
416  *
417  * Revision 1.2 2007/06/20 12:37:37 meichel
418  * Completed implementation of encoder, which now supports lossless
419  * "raw" and "cooked" and near-lossless "cooked" modes.
420  *
421  * Revision 1.1 2007/06/15 14:35:45 meichel
422  * Renamed CMake project and include directory from dcmjpgls to dcmjpls
423  *
424  * Revision 1.4 2007/06/15 10:38:43 meichel
425  * Further code clean-up. Encoder now produces valid offset tables if
426  * a JPEG-LS frame size an odd number of bytes.
427  *
428  * Revision 1.3 2007/06/14 12:36:14 meichel
429  * Further code clean-up. Updated doxygen comments.
430  *
431  * Revision 1.2 2007/06/13 16:41:07 meichel
432  * Code clean-up and removal of dead code
433  *
434  *
435  */


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