changeset 41:c1097a676eca

better naming for preview images
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 31 Aug 2012 11:45:48 +0200
parents a08b085190e1
children ea48f38afe5f
files Core/DicomFormat/DicomMap.cpp PalantirExplorer/explorer.js PalantirServer/FromDcmtkBridge.cpp PalantirServer/FromDcmtkBridge.h PalantirServer/PalantirRestApi.cpp
diffstat 5 files changed, 16 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/Core/DicomFormat/DicomMap.cpp	Thu Aug 30 14:52:33 2012 +0200
+++ b/Core/DicomFormat/DicomMap.cpp	Fri Aug 31 11:45:48 2012 +0200
@@ -65,6 +65,7 @@
     DicomTag(0x0018, 0x1030), // ProtocolName
     DicomTag(0x0020, 0x000e), // SeriesInstanceUID
     DicomTag(0x0020, 0x0011), // SeriesNumber
+    DicomTag(0x0020, 0x1002), // ImagesInAcquisition
     DicomTag(0x0054, 0x0081)  // NumberOfSlices
   };
 
--- a/PalantirExplorer/explorer.js	Thu Aug 30 14:52:33 2012 +0200
+++ b/PalantirExplorer/explorer.js	Fri Aug 31 11:45:48 2012 +0200
@@ -272,7 +272,8 @@
    FormatMainDicomTags(series.MainDicomTags, [
      "SeriesDescription", 
      "SeriesTime", 
-     "Manufacturer", 
+     "Manufacturer",
+     "ImagesInAcquisition",
      "SeriesDate"
    ]),
    series.Instances.length
@@ -585,7 +586,7 @@
 
 
 $('#instance-preview').live('click', function(e) {
-  jQuery.slimbox('/instances/' + $.mobile.pageData.uuid + '/normalized-image', '', {
+  jQuery.slimbox('/instances/' + $.mobile.pageData.uuid + '/preview', '', {
                    overlayFadeDuration : 1,
                    resizeDuration : 1,
                    imageFadeDuration : 1
@@ -600,7 +601,7 @@
 
         var images = [];
         for (var i = 0; i < instances.length; i++) {
-          images.push([ '/instances/' + instances[i].ID + '/normalized-image',
+          images.push([ '/instances/' + instances[i].ID + '/preview',
                         '{0}/{1}'.format(i + 1, instances.length) ])
         }
 
--- a/PalantirServer/FromDcmtkBridge.cpp	Thu Aug 30 14:52:33 2012 +0200
+++ b/PalantirServer/FromDcmtkBridge.cpp	Fri Aug 31 11:45:48 2012 +0200
@@ -379,8 +379,8 @@
   }
 
 
-  void FromDcmtkBridge::ExtractNormalizedImage(std::string& result,
-                                               DcmDataset& dataset)
+  void FromDcmtkBridge::ExtractPreviewImage(std::string& result,
+                                            DcmDataset& dataset)
   {
     // See also: http://support.dcmtk.org/wiki/dcmtk/howto/accessing-compressed-data
 
@@ -432,8 +432,8 @@
   }
 
 
-  void FromDcmtkBridge::ExtractNormalizedImage(std::string& result,
-                                               const std::string& dicomContent)
+  void FromDcmtkBridge::ExtractPreviewImage(std::string& result,
+                                            const std::string& dicomContent)
   {
     DcmInputBufferStream is;
     if (dicomContent.size() > 0)
@@ -445,7 +445,7 @@
     DcmFileFormat dicom;
     if (dicom.read(is).good())
     {
-      ExtractNormalizedImage(result, *dicom.getDataset());
+      ExtractPreviewImage(result, *dicom.getDataset());
     }
     else
     {
--- a/PalantirServer/FromDcmtkBridge.h	Thu Aug 30 14:52:33 2012 +0200
+++ b/PalantirServer/FromDcmtkBridge.h	Fri Aug 31 11:45:48 2012 +0200
@@ -43,11 +43,11 @@
                        const std::string& path,
                        unsigned int maxStringLength = 256);
 
-    static void ExtractNormalizedImage(std::string& result,
-                                       DcmDataset& dataset);
+    static void ExtractPreviewImage(std::string& result,
+                                    DcmDataset& dataset);
 
-    static void ExtractNormalizedImage(std::string& result,
-                                       const std::string& dicomContent);
+    static void ExtractPreviewImage(std::string& result,
+                                    const std::string& dicomContent);
 
     static std::string GetName(const DicomTag& tag);
 
--- a/PalantirServer/PalantirRestApi.cpp	Thu Aug 30 14:52:33 2012 +0200
+++ b/PalantirServer/PalantirRestApi.cpp	Fri Aug 31 11:45:48 2012 +0200
@@ -568,7 +568,7 @@
 
     else if (uri.size() == 3 &&
              uri[0] == "instances" &&
-             uri[2] == "normalized-image")
+             uri[2] == "preview")
     {
       std::string uuid;
       existingResource = index_.GetDicomFile(uuid, uri[1]);
@@ -579,7 +579,7 @@
         storage_.ReadFile(dicomContent, uuid);
         try
         {
-          FromDcmtkBridge::ExtractNormalizedImage(png, dicomContent);
+          FromDcmtkBridge::ExtractPreviewImage(png, dicomContent);
           output.AnswerBufferWithContentType(png, "image/png");
           return;
         }