OFFIS DCMTK  Version 3.6.0
djcodecd.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, Marco Eichelberg
17  *
18  * Purpose: codec classes for JPEG-LS decoders.
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:17:19 $
22  * CVS/RCS Revision: $Revision: 1.6 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DCMJPLS_DJCODECD_H
30 #define DCMJPLS_DJCODECD_H
31 
32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/dcmdata/dccodec.h" /* for class DcmCodec */
34 #include "dcmtk/ofstd/ofstring.h"
35 
36 /* forward declaration */
37 class DJLSCodecParameter;
38 
46 {
47 public:
48 
51 
53  virtual ~DJLSDecoderBase();
54 
65  virtual OFCondition decode(
66  const DcmRepresentationParameter * fromRepParam,
67  DcmPixelSequence * pixSeq,
68  DcmPolymorphOBOW& uncompressedPixelData,
69  const DcmCodecParameter * cp,
70  const DcmStack& objStack) const;
71 
97  virtual OFCondition decodeFrame(
98  const DcmRepresentationParameter * fromParam,
99  DcmPixelSequence * fromPixSeq,
100  const DcmCodecParameter * cp,
101  DcmItem *dataset,
102  Uint32 frameNo,
103  Uint32& startFragment,
104  void *buffer,
105  Uint32 bufSize,
106  OFString& decompressedColorModel) const;
107 
122  virtual OFCondition encode(
123  const Uint16 * pixelData,
124  const Uint32 length,
125  const DcmRepresentationParameter * toRepParam,
126  DcmPixelSequence * & pixSeq,
127  const DcmCodecParameter *cp,
128  DcmStack & objStack) const;
129 
144  virtual OFCondition encode(
145  const E_TransferSyntax fromRepType,
146  const DcmRepresentationParameter * fromRepParam,
147  DcmPixelSequence * fromPixSeq,
148  const DcmRepresentationParameter * toRepParam,
149  DcmPixelSequence * & toPixSeq,
150  const DcmCodecParameter * cp,
151  DcmStack & objStack) const;
152 
160  virtual OFBool canChangeCoding(
161  const E_TransferSyntax oldRepType,
162  const E_TransferSyntax newRepType) const;
163 
178  const DcmRepresentationParameter *fromParam,
179  DcmPixelSequence *fromPixSeq,
180  const DcmCodecParameter *cp,
181  DcmItem *dataset,
182  OFString &decompressedColorModel) const;
183 
184 private:
185 
186  // static private helper methods
187 
213  static OFCondition decodeFrame(
214  DcmPixelSequence * fromPixSeq,
215  const DJLSCodecParameter *cp,
216  DcmItem *dataset,
217  Uint32 frameNo,
218  Uint32& startFragment,
219  void *buffer,
220  Uint32 bufSize,
221  Sint32 imageFrames,
222  Uint16 imageColumns,
223  Uint16 imageRows,
224  Uint16 imageSamplesPerPixel,
225  Uint16 bytesPerSample);
226 
235  static Uint16 determinePlanarConfiguration(
236  const OFString& sopClassUID,
237  const OFString& photometricInterpretation);
238 
251  static Uint32 computeNumberOfFragments(
252  Sint32 numberOfFrames,
253  Uint32 currentFrame,
254  Uint32 startItem,
255  OFBool ignoreOffsetTable,
256  DcmPixelSequence *pixSeq);
257 
264  static OFBool isJPEGLSStartOfImage(Uint8 *fragmentData);
265 
275  Uint8 *imageFrame,
276  Uint16 columns,
277  Uint16 rows);
278 
288  Uint16 *imageFrame,
289  Uint16 columns,
290  Uint16 rows);
291 
301  Uint8 *imageFrame,
302  Uint16 columns,
303  Uint16 rows);
304 
314  Uint16 *imageFrame,
315  Uint16 columns,
316  Uint16 rows);
317 };
318 
322 {
327  virtual E_TransferSyntax supportedTransferSyntax() const;
328 };
329 
333 {
338  virtual E_TransferSyntax supportedTransferSyntax() const;
339 };
340 
341 #endif
342 
343 /*
344  * CVS/RCS Log:
345  * $Log: djcodecd.h,v $
346  * Revision 1.6 2010-10-14 13:17:19 joergr
347  * Updated copyright header. Added reference to COPYRIGHT file.
348  *
349  * Revision 1.5 2010-10-12 12:32:22 uli
350  * Avoid redundant findAndGet*() calls.
351  *
352  * Revision 1.4 2010-03-01 10:35:28 uli
353  * Renamed include guards to avoid name clash with e.g. dcmjpeg.
354  *
355  * Revision 1.3 2009-11-17 16:57:14 joergr
356  * Added new method that allows for determining the color model of the
357  * decompressed image.
358  *
359  * Revision 1.2 2009-10-07 13:16:47 uli
360  * Switched to logging mechanism provided by the "new" oflog module.
361  *
362  * Revision 1.1 2009-07-29 14:46:46 meichel
363  * Initial release of module dcmjpls, a JPEG-LS codec for DCMTK based on CharLS
364  *
365  * Revision 1.2 2008-05-29 10:54:05 meichel
366  * Implemented new method DcmPixelData::getUncompressedFrame
367  * that permits frame-wise access to compressed and uncompressed
368  * objects without ever loading the complete object into main memory.
369  * For this new method to work with compressed images, all classes derived from
370  * DcmCodec need to implement a new method decodeFrame(). For now, only
371  * dummy implementations returning an error code have been defined.
372  *
373  * Revision 1.1 2007/06/15 14:35:45 meichel
374  * Renamed CMake project and include directory from dcmjpgls to dcmjpls
375  *
376  * Revision 1.4 2007/06/15 10:39:15 meichel
377  * Completed implementation of decoder, which now correctly processes all
378  * of the NEMA JPEG-LS sample images, including fragmented frames.
379  *
380  * Revision 1.3 2007/06/14 12:36:14 meichel
381  * Further code clean-up. Updated doxygen comments.
382  *
383  * Revision 1.2 2007/06/13 16:41:07 meichel
384  * Code clean-up and removal of dead code
385  *
386  *
387  */


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