]> Creatis software - gdcm.git/commitdiff
COMP: Backport from gdcm1.2
authormalaterre <malaterre>
Fri, 18 Aug 2006 16:08:16 +0000 (16:08 +0000)
committermalaterre <malaterre>
Fri, 18 Aug 2006 16:08:16 +0000 (16:08 +0000)
Example/WriteDicomAsJPEG.cxx

index 1a2e3c0d182612f0ebd143481937cc2b93b03dec..1681047023b12e10a8bd6bdb41668dcbe3d7c3e5 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: WriteDicomAsJPEG.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/07/26 17:47:39 $
-  Version:   $Revision: 1.12 $
+  Date:      $Date: 2006/08/18 16:08:16 $
+  Version:   $Revision: 1.13 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -107,8 +107,9 @@ void UpdateBasicOffsetTable(std::ostream *fp, JpegVector const &v, size_t pos)
     {
     const JpegPair &jp = *i;
     if(i == v.begin() ){ assert( jp.first - first.first == 0); }
-    gdcm::binary_write(*fp, jp.first - first.first);
-    std::cerr << "Updating Table:" << jp.first - first.first << std::endl;
+    uint32_t offset = jp.first - first.first;
+    gdcm::binary_write(*fp, offset);
+    //std::cerr << "Updating Table:" << jp.first - first.first << std::endl;
     }
 }
 
@@ -119,8 +120,9 @@ void UpdateJpegFragmentSize(std::ostream *fp, JpegVector const &v)
     {
     const JpegPair &jp = *i;
     fp->seekp( jp.first );
-    gdcm::binary_write(*fp, jp.second );
-    std::cerr << "Updating:" << jp.first << "," << jp.second << std::endl;
+    uint32_t length = jp.second;
+    gdcm::binary_write(*fp, length );
+    //std::cerr << "Updating:" << jp.first << "," << jp.second << std::endl;
     }
 }