Mercurial > hg > orthanc
comparison OrthancServer/Internals/DicomImageDecoder.cpp @ 1944:1a5e070a21c3
fix compilation against DCMTK 3.6.1
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 04 Apr 2016 13:33:19 +0200 |
parents | cda5b0ab4ce5 |
children | 88831c3edd8f |
comparison
equal
deleted
inserted
replaced
1943:bc949ea71fe6 | 1944:1a5e070a21c3 |
---|---|
93 #include <dcmtk/dcmdata/dcfilefo.h> | 93 #include <dcmtk/dcmdata/dcfilefo.h> |
94 #include <dcmtk/dcmdata/dcrleccd.h> | 94 #include <dcmtk/dcmdata/dcrleccd.h> |
95 #include <dcmtk/dcmdata/dcrlecp.h> | 95 #include <dcmtk/dcmdata/dcrlecp.h> |
96 | 96 |
97 #if ORTHANC_JPEG_LOSSLESS_ENABLED == 1 | 97 #if ORTHANC_JPEG_LOSSLESS_ENABLED == 1 |
98 #include <dcmtk/dcmjpls/djcodecd.h> | 98 # include <dcmtk/dcmjpls/djcodecd.h> |
99 #include <dcmtk/dcmjpls/djcparam.h> | 99 # include <dcmtk/dcmjpls/djcparam.h> |
100 #include <dcmtk/dcmjpeg/djrplol.h> | 100 # include <dcmtk/dcmjpeg/djrplol.h> |
101 #endif | 101 #endif |
102 | 102 |
103 #if ORTHANC_JPEG_ENABLED == 1 | 103 #if ORTHANC_JPEG_ENABLED == 1 |
104 #include <dcmtk/dcmjpeg/djcodecd.h> | 104 # include <dcmtk/dcmjpeg/djcodecd.h> |
105 #include <dcmtk/dcmjpeg/djcparam.h> | 105 # include <dcmtk/dcmjpeg/djcparam.h> |
106 #include <dcmtk/dcmjpeg/djdecbas.h> | 106 # include <dcmtk/dcmjpeg/djdecbas.h> |
107 #include <dcmtk/dcmjpeg/djdecext.h> | 107 # include <dcmtk/dcmjpeg/djdecext.h> |
108 #include <dcmtk/dcmjpeg/djdeclol.h> | 108 # include <dcmtk/dcmjpeg/djdeclol.h> |
109 #include <dcmtk/dcmjpeg/djdecpro.h> | 109 # include <dcmtk/dcmjpeg/djdecpro.h> |
110 #include <dcmtk/dcmjpeg/djdecsps.h> | 110 # include <dcmtk/dcmjpeg/djdecsps.h> |
111 #include <dcmtk/dcmjpeg/djdecsv1.h> | 111 # include <dcmtk/dcmjpeg/djdecsv1.h> |
112 #endif | 112 #endif |
113 | 113 |
114 #if DCMTK_VERSION_NUMBER <= 360 | |
115 # define EXS_JPEGProcess1 EXS_JPEGProcess1TransferSyntax | |
116 # define EXS_JPEGProcess2_4 EXS_JPEGProcess2_4TransferSyntax | |
117 # define EXS_JPEGProcess6_8 EXS_JPEGProcess6_8TransferSyntax | |
118 # define EXS_JPEGProcess10_12 EXS_JPEGProcess10_12TransferSyntax | |
119 # define EXS_JPEGProcess14 EXS_JPEGProcess14TransferSyntax | |
120 # define EXS_JPEGProcess14SV1 EXS_JPEGProcess14SV1TransferSyntax | |
121 #endif | |
114 | 122 |
115 namespace Orthanc | 123 namespace Orthanc |
116 { | 124 { |
117 static const DicomTag DICOM_TAG_CONTENT(0x07a1, 0x100a); | 125 static const DicomTag DICOM_TAG_CONTENT(0x07a1, 0x100a); |
118 static const DicomTag DICOM_TAG_COMPRESSION_TYPE(0x07a1, 0x1011); | 126 static const DicomTag DICOM_TAG_COMPRESSION_TYPE(0x07a1, 0x1011); |
546 #if ORTHANC_JPEG_ENABLED == 1 | 554 #if ORTHANC_JPEG_ENABLED == 1 |
547 /** | 555 /** |
548 * Deal with JPEG images. | 556 * Deal with JPEG images. |
549 **/ | 557 **/ |
550 | 558 |
551 if (syntax == EXS_JPEGProcess1TransferSyntax || // DJDecoderBaseline | 559 if (syntax == EXS_JPEGProcess1 || // DJDecoderBaseline |
552 syntax == EXS_JPEGProcess2_4TransferSyntax || // DJDecoderExtended | 560 syntax == EXS_JPEGProcess2_4 || // DJDecoderExtended |
553 syntax == EXS_JPEGProcess6_8TransferSyntax || // DJDecoderSpectralSelection (retired) | 561 syntax == EXS_JPEGProcess6_8 || // DJDecoderSpectralSelection (retired) |
554 syntax == EXS_JPEGProcess10_12TransferSyntax || // DJDecoderProgressive (retired) | 562 syntax == EXS_JPEGProcess10_12 || // DJDecoderProgressive (retired) |
555 syntax == EXS_JPEGProcess14TransferSyntax || // DJDecoderLossless | 563 syntax == EXS_JPEGProcess14 || // DJDecoderLossless |
556 syntax == EXS_JPEGProcess14SV1TransferSyntax) // DJDecoderP14SV1 | 564 syntax == EXS_JPEGProcess14SV1) // DJDecoderP14SV1 |
557 { | 565 { |
558 // http://support.dcmtk.org/docs-snapshot/djutils_8h.html#a2a9695e5b6b0f5c45a64c7f072c1eb9d | 566 // http://support.dcmtk.org/docs-snapshot/djutils_8h.html#a2a9695e5b6b0f5c45a64c7f072c1eb9d |
559 DJCodecParameter parameters( | 567 DJCodecParameter parameters( |
560 ECC_lossyYCbCr, // Mode for color conversion for compression, Unused for decompression | 568 ECC_lossyYCbCr, // Mode for color conversion for compression, Unused for decompression |
561 EDC_photometricInterpretation, // Perform color space conversion from YCbCr to RGB if DICOM photometric interpretation indicates YCbCr | 569 EDC_photometricInterpretation, // Perform color space conversion from YCbCr to RGB if DICOM photometric interpretation indicates YCbCr |
563 EPC_default); // Automatically determine whether color-by-plane is required from the SOP Class UID and decompressed photometric interpretation | 571 EPC_default); // Automatically determine whether color-by-plane is required from the SOP Class UID and decompressed photometric interpretation |
564 std::auto_ptr<DJCodecDecoder> decoder; | 572 std::auto_ptr<DJCodecDecoder> decoder; |
565 | 573 |
566 switch (syntax) | 574 switch (syntax) |
567 { | 575 { |
568 case EXS_JPEGProcess1TransferSyntax: | 576 case EXS_JPEGProcess1: |
569 LOG(INFO) << "Decoding a JPEG baseline (process 1) DICOM image"; | 577 LOG(INFO) << "Decoding a JPEG baseline (process 1) DICOM image"; |
570 decoder.reset(new DJDecoderBaseline); | 578 decoder.reset(new DJDecoderBaseline); |
571 break; | 579 break; |
572 | 580 |
573 case EXS_JPEGProcess2_4TransferSyntax : | 581 case EXS_JPEGProcess2_4 : |
574 LOG(INFO) << "Decoding a JPEG baseline (processes 2 and 4) DICOM image"; | 582 LOG(INFO) << "Decoding a JPEG baseline (processes 2 and 4) DICOM image"; |
575 decoder.reset(new DJDecoderExtended); | 583 decoder.reset(new DJDecoderExtended); |
576 break; | 584 break; |
577 | 585 |
578 case EXS_JPEGProcess6_8TransferSyntax: // Retired | 586 case EXS_JPEGProcess6_8: // Retired |
579 LOG(INFO) << "Decoding a JPEG spectral section, nonhierarchical (processes 6 and 8) DICOM image"; | 587 LOG(INFO) << "Decoding a JPEG spectral section, nonhierarchical (processes 6 and 8) DICOM image"; |
580 decoder.reset(new DJDecoderSpectralSelection); | 588 decoder.reset(new DJDecoderSpectralSelection); |
581 break; | 589 break; |
582 | 590 |
583 case EXS_JPEGProcess10_12TransferSyntax: // Retired | 591 case EXS_JPEGProcess10_12: // Retired |
584 LOG(INFO) << "Decoding a JPEG full progression, nonhierarchical (processes 10 and 12) DICOM image"; | 592 LOG(INFO) << "Decoding a JPEG full progression, nonhierarchical (processes 10 and 12) DICOM image"; |
585 decoder.reset(new DJDecoderProgressive); | 593 decoder.reset(new DJDecoderProgressive); |
586 break; | 594 break; |
587 | 595 |
588 case EXS_JPEGProcess14TransferSyntax: | 596 case EXS_JPEGProcess14: |
589 LOG(INFO) << "Decoding a JPEG lossless, nonhierarchical (process 14) DICOM image"; | 597 LOG(INFO) << "Decoding a JPEG lossless, nonhierarchical (process 14) DICOM image"; |
590 decoder.reset(new DJDecoderLossless); | 598 decoder.reset(new DJDecoderLossless); |
591 break; | 599 break; |
592 | 600 |
593 case EXS_JPEGProcess14SV1TransferSyntax: | 601 case EXS_JPEGProcess14SV1: |
594 LOG(INFO) << "Decoding a JPEG lossless, nonhierarchical, first-order prediction (process 14 selection value 1) DICOM image"; | 602 LOG(INFO) << "Decoding a JPEG lossless, nonhierarchical, first-order prediction (process 14 selection value 1) DICOM image"; |
595 decoder.reset(new DJDecoderP14SV1); | 603 decoder.reset(new DJDecoderP14SV1); |
596 break; | 604 break; |
597 | 605 |
598 default: | 606 default: |