Mercurial > hg > orthanc
comparison Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp @ 1840:859224214616
simplification of the sample plugin
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 30 Nov 2015 10:34:04 +0100 |
parents | 2faa2abbf311 |
children | 697ae8d0e287 |
comparison
equal
deleted
inserted
replaced
1839:7f68b04c79e8 | 1840:859224214616 |
---|---|
26 { | 26 { |
27 OrthancImageWrapper::OrthancImageWrapper(OrthancPluginContext* context, | 27 OrthancImageWrapper::OrthancImageWrapper(OrthancPluginContext* context, |
28 OrthancPluginPixelFormat format, | 28 OrthancPluginPixelFormat format, |
29 uint32_t width, | 29 uint32_t width, |
30 uint32_t height) : | 30 uint32_t height) : |
31 context_(context), | 31 context_(context) |
32 slope_(1), | |
33 intercept_(0), | |
34 rowPixelSpacing_(1), | |
35 columnPixelSpacing_(1) | |
36 { | 32 { |
37 image_ = OrthancPluginCreateImage(context_, format, width, height); | 33 image_ = OrthancPluginCreateImage(context_, format, width, height); |
38 if (image_ == NULL) | 34 if (image_ == NULL) |
39 { | 35 { |
40 throw std::runtime_error("Cannot create an image"); | 36 throw std::runtime_error("Cannot create an image"); |
41 } | 37 } |
42 } | 38 } |
43 | 39 |
44 | 40 |
45 OrthancImageWrapper::OrthancImageWrapper(OrthancPluginContext* context, | 41 OrthancImageWrapper::OrthancImageWrapper(OrthancPluginContext* context, |
46 GdcmImageDecoder& decoder, | 42 OrthancPluginImage* image) : |
47 unsigned int frameIndex) : | |
48 context_(context), | 43 context_(context), |
49 image_(decoder.Decode(context, frameIndex)), | 44 image_(image) |
50 slope_(decoder.GetSlope()), | |
51 intercept_(decoder.GetIntercept()), | |
52 rowPixelSpacing_(decoder.GetRowPixelSpacing()), | |
53 columnPixelSpacing_(decoder.GetColumnPixelSpacing()) | |
54 { | 45 { |
55 } | 46 } |
56 | 47 |
57 | 48 |
58 | 49 |