diff OrthancServer/DicomIntegerPixelAccessor.cpp @ 77:b8dfde8d64e8

new dicom tags
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 20 Sep 2012 13:41:18 +0200
parents a70bb32802ae
children
line wrap: on
line diff
--- a/OrthancServer/DicomIntegerPixelAccessor.cpp	Mon Sep 17 17:32:33 2012 +0200
+++ b/OrthancServer/DicomIntegerPixelAccessor.cpp	Thu Sep 20 13:41:18 2012 +0200
@@ -25,12 +25,19 @@
 #endif
 
 #include "../Core/OrthancException.h"
-#include "FromDcmtkBridge.h"
 #include <boost/lexical_cast.hpp>
 #include <limits>
 
 namespace Orthanc
 {
+  static const DicomTag COLUMNS(0x0028, 0x0011);
+  static const DicomTag ROWS(0x0028, 0x0010);
+  static const DicomTag SAMPLES_PER_PIXEL(0x0028, 0x0002);
+  static const DicomTag BITS_ALLOCATED(0x0028, 0x0100);
+  static const DicomTag BITS_STORED(0x0028, 0x0101);
+  static const DicomTag HIGH_BIT(0x0028, 0x0102);
+  static const DicomTag PIXEL_REPRESENTATION(0x0028, 0x0103);
+
   DicomIntegerPixelAccessor::DicomIntegerPixelAccessor(const DicomMap& values,
                                                        const void* pixelData,
                                                        size_t size) :
@@ -44,13 +51,13 @@
 
     try
     {
-      width_ = boost::lexical_cast<unsigned int>(FromDcmtkBridge::GetValue(values, "Columns").AsString());
-      height_ = boost::lexical_cast<unsigned int>(FromDcmtkBridge::GetValue(values, "Rows").AsString());
-      samplesPerPixel_ = boost::lexical_cast<unsigned int>(FromDcmtkBridge::GetValue(values, "SamplesPerPixel").AsString());
-      bitsAllocated = boost::lexical_cast<unsigned int>(FromDcmtkBridge::GetValue(values, "BitsAllocated").AsString());
-      bitsStored = boost::lexical_cast<unsigned int>(FromDcmtkBridge::GetValue(values, "BitsStored").AsString());
-      highBit = boost::lexical_cast<unsigned int>(FromDcmtkBridge::GetValue(values, "HighBit").AsString());
-      pixelRepresentation = boost::lexical_cast<unsigned int>(FromDcmtkBridge::GetValue(values, "PixelRepresentation").AsString());
+      width_ = boost::lexical_cast<unsigned int>(values.GetValue(COLUMNS).AsString());
+      height_ = boost::lexical_cast<unsigned int>(values.GetValue(ROWS).AsString());
+      samplesPerPixel_ = boost::lexical_cast<unsigned int>(values.GetValue(SAMPLES_PER_PIXEL).AsString());
+      bitsAllocated = boost::lexical_cast<unsigned int>(values.GetValue(BITS_ALLOCATED).AsString());
+      bitsStored = boost::lexical_cast<unsigned int>(values.GetValue(BITS_STORED).AsString());
+      highBit = boost::lexical_cast<unsigned int>(values.GetValue(HIGH_BIT).AsString());
+      pixelRepresentation = boost::lexical_cast<unsigned int>(values.GetValue(PIXEL_REPRESENTATION).AsString());
     }
     catch (boost::bad_lexical_cast)
     {
@@ -60,7 +67,7 @@
     frame_ = 0;
     try
     {
-      numberOfFrames_ = boost::lexical_cast<unsigned int>(FromDcmtkBridge::GetValue(values, "NumberOfFrames").AsString());
+      numberOfFrames_ = boost::lexical_cast<unsigned int>(values.GetValue(DicomTag::NUMBER_OF_FRAMES).AsString());
     }
     catch (OrthancException)
     {