comparison Orthanc/Plugins/Samples/GdcmDecoder/GdcmImageDecoder.cpp @ 172:330ecfd96aec

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Oct 2017 12:53:46 +0200
parents 5dc54316d68b
children 4f0f4f64cff3
comparison
equal deleted inserted replaced
171:b6c55352818c 172:330ecfd96aec
28 #include <gdcmImageChangePlanarConfiguration.h> 28 #include <gdcmImageChangePlanarConfiguration.h>
29 #include <gdcmImageChangePhotometricInterpretation.h> 29 #include <gdcmImageChangePhotometricInterpretation.h>
30 #include <stdexcept> 30 #include <stdexcept>
31 #include <boost/iostreams/stream.hpp> 31 #include <boost/iostreams/stream.hpp>
32 #include <boost/iostreams/device/array.hpp> 32 #include <boost/iostreams/device/array.hpp>
33
34
35 // This is for compatibility with Orthanc SDK <= 1.3.0
36 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
37 #define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision) \
38 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major || \
39 (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major && \
40 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor || \
41 (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor && \
42 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
43 #endif
33 44
34 45
35 namespace OrthancPlugins 46 namespace OrthancPlugins
36 { 47 {
37 struct GdcmImageDecoder::PImpl 48 struct GdcmImageDecoder::PImpl
197 switch (image.GetPixelFormat()) 208 switch (image.GetPixelFormat())
198 { 209 {
199 case gdcm::PixelFormat::UINT8: 210 case gdcm::PixelFormat::UINT8:
200 return OrthancPluginPixelFormat_RGB24; 211 return OrthancPluginPixelFormat_RGB24;
201 212
213 case gdcm::PixelFormat::UINT16:
214 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 3, 1)
215 return OrthancPluginPixelFormat_RGB48;
216 #else
217 throw std::runtime_error("RGB48 pixel format is only supported by Orthanc >= 1.3.1");
218 #endif
219
202 default: 220 default:
203 break; 221 break;
204 } 222 }
205 } 223 }
206 224