diff Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp @ 1836:2faa2abbf311

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 27 Nov 2015 17:40:25 +0100
parents b1a6f49b21dd
children 859224214616
line wrap: on
line diff
--- a/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp	Fri Nov 27 12:54:54 2015 +0100
+++ b/Plugins/Samples/GdcmDecoder/OrthancImageWrapper.cpp	Fri Nov 27 17:40:25 2015 +0100
@@ -28,7 +28,11 @@
                                            OrthancPluginPixelFormat format,
                                            uint32_t width,
                                            uint32_t height) :
-    context_(context)
+    context_(context),
+    slope_(1),
+    intercept_(0),
+    rowPixelSpacing_(1),
+    columnPixelSpacing_(1)
   {
     image_ = OrthancPluginCreateImage(context_, format, width, height);
     if (image_ == NULL)
@@ -38,6 +42,20 @@
   }
 
 
+  OrthancImageWrapper::OrthancImageWrapper(OrthancPluginContext* context,
+                                           GdcmImageDecoder& decoder,
+                                           unsigned int frameIndex) :
+    context_(context),
+    image_(decoder.Decode(context, frameIndex)),
+    slope_(decoder.GetSlope()),
+    intercept_(decoder.GetIntercept()),
+    rowPixelSpacing_(decoder.GetRowPixelSpacing()),
+    columnPixelSpacing_(decoder.GetColumnPixelSpacing())
+  {
+  }
+
+
+
   OrthancImageWrapper::~OrthancImageWrapper()
   {
     if (image_ != NULL)