00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef DCMJPLS_DJCODECD_H
00030 #define DCMJPLS_DJCODECD_H
00031
00032 #include "dcmtk/config/osconfig.h"
00033 #include "dcmtk/dcmdata/dccodec.h"
00034 #include "dcmtk/ofstd/ofstring.h"
00035
00036
00037 class DJLSCodecParameter;
00038
00045 class DJLSDecoderBase: public DcmCodec
00046 {
00047 public:
00048
00050 DJLSDecoderBase();
00051
00053 virtual ~DJLSDecoderBase();
00054
00065 virtual OFCondition decode(
00066 const DcmRepresentationParameter * fromRepParam,
00067 DcmPixelSequence * pixSeq,
00068 DcmPolymorphOBOW& uncompressedPixelData,
00069 const DcmCodecParameter * cp,
00070 const DcmStack& objStack) const;
00071
00097 virtual OFCondition decodeFrame(
00098 const DcmRepresentationParameter * fromParam,
00099 DcmPixelSequence * fromPixSeq,
00100 const DcmCodecParameter * cp,
00101 DcmItem *dataset,
00102 Uint32 frameNo,
00103 Uint32& startFragment,
00104 void *buffer,
00105 Uint32 bufSize,
00106 OFString& decompressedColorModel) const;
00107
00122 virtual OFCondition encode(
00123 const Uint16 * pixelData,
00124 const Uint32 length,
00125 const DcmRepresentationParameter * toRepParam,
00126 DcmPixelSequence * & pixSeq,
00127 const DcmCodecParameter *cp,
00128 DcmStack & objStack) const;
00129
00144 virtual OFCondition encode(
00145 const E_TransferSyntax fromRepType,
00146 const DcmRepresentationParameter * fromRepParam,
00147 DcmPixelSequence * fromPixSeq,
00148 const DcmRepresentationParameter * toRepParam,
00149 DcmPixelSequence * & toPixSeq,
00150 const DcmCodecParameter * cp,
00151 DcmStack & objStack) const;
00152
00160 virtual OFBool canChangeCoding(
00161 const E_TransferSyntax oldRepType,
00162 const E_TransferSyntax newRepType) const;
00163
00177 virtual OFCondition determineDecompressedColorModel(
00178 const DcmRepresentationParameter *fromParam,
00179 DcmPixelSequence *fromPixSeq,
00180 const DcmCodecParameter *cp,
00181 DcmItem *dataset,
00182 OFString &decompressedColorModel) const;
00183
00184 private:
00185
00186
00187
00213 static OFCondition decodeFrame(
00214 DcmPixelSequence * fromPixSeq,
00215 const DJLSCodecParameter *cp,
00216 DcmItem *dataset,
00217 Uint32 frameNo,
00218 Uint32& startFragment,
00219 void *buffer,
00220 Uint32 bufSize,
00221 Sint32 imageFrames,
00222 Uint16 imageColumns,
00223 Uint16 imageRows,
00224 Uint16 imageSamplesPerPixel,
00225 Uint16 bytesPerSample);
00226
00235 static Uint16 determinePlanarConfiguration(
00236 const OFString& sopClassUID,
00237 const OFString& photometricInterpretation);
00238
00251 static Uint32 computeNumberOfFragments(
00252 Sint32 numberOfFrames,
00253 Uint32 currentFrame,
00254 Uint32 startItem,
00255 OFBool ignoreOffsetTable,
00256 DcmPixelSequence *pixSeq);
00257
00264 static OFBool isJPEGLSStartOfImage(Uint8 *fragmentData);
00265
00274 static OFCondition createPlanarConfiguration1Byte(
00275 Uint8 *imageFrame,
00276 Uint16 columns,
00277 Uint16 rows);
00278
00287 static OFCondition createPlanarConfiguration1Word(
00288 Uint16 *imageFrame,
00289 Uint16 columns,
00290 Uint16 rows);
00291
00300 static OFCondition createPlanarConfiguration0Byte(
00301 Uint8 *imageFrame,
00302 Uint16 columns,
00303 Uint16 rows);
00304
00313 static OFCondition createPlanarConfiguration0Word(
00314 Uint16 *imageFrame,
00315 Uint16 columns,
00316 Uint16 rows);
00317 };
00318
00321 class DJLSLosslessDecoder : public DJLSDecoderBase
00322 {
00327 virtual E_TransferSyntax supportedTransferSyntax() const;
00328 };
00329
00332 class DJLSNearLosslessDecoder : public DJLSDecoderBase
00333 {
00338 virtual E_TransferSyntax supportedTransferSyntax() const;
00339 };
00340
00341 #endif
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387