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  */
a class representing a list of DICOM elements in which each element has a different tag and elements ...
Definition: dcitem.h:51
static OFCondition createPlanarConfiguration1Word(Uint16 *imageFrame, Uint16 columns, Uint16 rows)
converts an RGB or YBR frame with 16 bits/sample from color-by-pixel to color-by-plane planar configu...
virtual OFCondition determineDecompressedColorModel(const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, const DcmCodecParameter *cp, DcmItem *dataset, OFString &decompressedColorModel) const
determine color model of the decompressed image
DJLSDecoderBase()
default constructor
abstract base class for codec representation parameter sets.
Definition: dcpixel.h:50
virtual E_TransferSyntax supportedTransferSyntax() const
returns the transfer syntax that this particular codec is able to Decode
static OFCondition createPlanarConfiguration1Byte(Uint8 *imageFrame, Uint16 columns, Uint16 rows)
converts an RGB or YBR frame with 8 bits/sample from color-by-pixel to color-by-plane planar configur...
this class implements a sequence of pixel items, i.e.
Definition: dcpixseq.h:45
abstract codec class for JPEG-LS decoders.
Definition: djcodecd.h:45
static OFCondition createPlanarConfiguration0Word(Uint16 *imageFrame, Uint16 columns, Uint16 rows)
converts an RGB or YBR frame with 16 bits/sample from color-by-plane to color-by-pixel planar configu...
virtual OFCondition encode(const Uint16 *pixelData, const Uint32 length, const DcmRepresentationParameter *toRepParam, DcmPixelSequence *&pixSeq, const DcmCodecParameter *cp, DcmStack &objStack) const
compresses the given uncompressed DICOM image and stores the result in the given pixSeq element...
static OFBool isJPEGLSStartOfImage(Uint8 *fragmentData)
check whether the given buffer contains a JPEG-LS start-of-image code
abstract base class for a codec parameter object that describes the settings (modes of operations) fo...
Definition: dccodec.h:49
this class manages a stack of pointers to DcmObject instances.
Definition: dcstack.h:77
virtual E_TransferSyntax supportedTransferSyntax() const
returns the transfer syntax that this particular codec is able to encode
static Uint32 computeNumberOfFragments(Sint32 numberOfFrames, Uint32 currentFrame, Uint32 startItem, OFBool ignoreOffsetTable, DcmPixelSequence *pixSeq)
computes the number of fragments (pixel items) that comprise the current frame in the compressed pixe...
codec class for JPEG-LS lossless only TS decoding
Definition: djcodecd.h:321
virtual OFCondition decodeFrame(const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, const DcmCodecParameter *cp, DcmItem *dataset, Uint32 frameNo, Uint32 &startFragment, void *buffer, Uint32 bufSize, OFString &decompressedColorModel) const
decompresses a single frame from the given pixel sequence and stores the result in the given buffer...
codec parameter for JPEG-LS codecs
Definition: djcparam.h:38
virtual ~DJLSDecoderBase()
destructor
static Uint16 determinePlanarConfiguration(const OFString &sopClassUID, const OFString &photometricInterpretation)
determines if a given image requires color-by-plane planar configuration depending on SOP Class UID (...
abstract base class for a codec object that can be registered in dcmdata and performs transfer syntax...
Definition: dccodec.h:85
a simple string class that implements a subset of std::string.
Definition: ofstring.h:86
a class representing DICOM elements (such as uncompressed pixel data) that can be interpreted either ...
Definition: dcvrpobw.h:41
static OFCondition createPlanarConfiguration0Byte(Uint8 *imageFrame, Uint16 columns, Uint16 rows)
converts an RGB or YBR frame with 8 bits/sample from color-by-plane to color-by-pixel planar configur...
virtual OFCondition decode(const DcmRepresentationParameter *fromRepParam, DcmPixelSequence *pixSeq, DcmPolymorphOBOW &uncompressedPixelData, const DcmCodecParameter *cp, const DcmStack &objStack) const
decompresses the given pixel sequence and stores the result in the given uncompressedPixelData elemen...
virtual OFBool canChangeCoding(const E_TransferSyntax oldRepType, const E_TransferSyntax newRepType) const
checks if this codec is able to convert from the given current transfer syntax to the given new trans...
codec class for JPEG-LS lossy and lossless TS decoding
Definition: djcodecd.h:332
General purpose class for condition codes.
Definition: ofcond.h:305


Generated on Thu Aug 27 2015 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.9.1