]> Creatis software - gdcm.git/commitdiff
Port Mathieu'a modif in gdcm1.2
authorjpr <jpr>
Tue, 4 Jul 2006 07:58:50 +0000 (07:58 +0000)
committerjpr <jpr>
Tue, 4 Jul 2006 07:58:50 +0000 (07:58 +0000)
ENH: More work toward JPEG support

src/gdcmDocEntry.cxx
src/gdcmFileHelper.cxx

index 1760277ab7fb3d789c8633dfdbe8da32d93df929..dac8355c49667d19ac514493952b464d29a35eaa 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocEntry.cxx,v $
   Language:  C++
-  Date:      $Date: 2006/04/11 16:03:26 $
-  Version:   $Revision: 1.83 $
+  Date:      $Date: 2006/07/04 07:58:50 $
+  Version:   $Revision: 1.84 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -139,7 +139,12 @@ void DocEntry::WriteContent(std::ofstream *fp, FileType filetype)
           ||  (vr == "UN") || (vr == "UT") )
          {
             binary_write(*fp, zero);
-            if (vr == "SQ")
+            if (filetype == JPEG && GetGroup() == 0x7fe0 && GetElement() == 0x0010)
+            {
+               gdcmAssertMacro( GetVR() == "OW" );
+               binary_write(*fp, ffff);
+            }  
+            else if (vr == "SQ")
             {
                // we set SQ length to ffffffff
                // and  we shall write a Sequence Delimitor Item 
index 40d1a83c2caa082b15bf50de1fa4ee411a057e93..c47cee38c268513bdc23be7cf36d5d8f03e94164 100644 (file)
@@ -4,8 +4,8 @@
   Module:    $RCSfile: gdcmFileHelper.cxx,v $
   Language:  C++
 
-  Date:      $Date: 2006/06/29 13:27:28 $
-  Version:   $Revision: 1.105 $
+  Date:      $Date: 2006/07/04 07:58:51 $
+  Version:   $Revision: 1.106 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -874,6 +874,11 @@ void FileHelper::SetWriteToRaw()
          vr = "OW";
       if ( FileInternal->GetBitsAllocated()==24 ) // For RGB ACR files 
          vr = "OB";
+       // For non RAW data. Mainly JPEG
+      if( WriteType == JPEG )
+      {
+         vr = "OW";
+      }
       DataEntry *pixel = 
          CopyDataEntry(GetFile()->GetGrPixel(),GetFile()->GetNumPixel(),vr);
       pixel->SetFlag(DataEntry::FLAG_PIXELDATA);