]> Creatis software - gdcm.git/blobdiff - src/gdcmPixelConvert.cxx
ENH: Adding support for GE Private Transfer Syntax where file is in little endian...
[gdcm.git] / src / gdcmPixelConvert.cxx
index c23cbe8ffbd2f832cf681e15c818ebf134ce9036..9da6c400fc5a9fce11be3ed5903ee4ac73da8f0d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/11/10 16:13:18 $
-  Version:   $Revision: 1.27 $
+  Date:      $Date: 2004/11/17 19:49:13 $
+  Version:   $Revision: 1.31 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -66,14 +66,19 @@ void PixelConvert::Squeeze()
    {
       delete [] RGB;
    } 
+   RGB = 0;
+
    if ( Decompressed )
    {
       delete [] Decompressed;
    }
+   Decompressed = 0;
+
    if ( LutRGBA )
    {
       delete [] LutRGBA;
    }
+   LutRGBA = 0;
 }
 
 PixelConvert::~PixelConvert() 
@@ -609,6 +614,10 @@ bool PixelConvert::ReadAndDecompressPixelData( std::ifstream* fp )
    }
    else if ( IsDecompressed )
    {
+      // This problem can be found when some obvious informations are found
+      // after the field containing the image datas. In this case, these
+      // bad datas are added to the size of the image (in the PixelDataLength
+      // variable). But DecompressedSize is the right size of the image !
       if( PixelDataLength != DecompressedSize)
       {
          dbg.Verbose( 0, "PixelConvert::ReadAndDecompressPixelData: "
@@ -804,6 +813,7 @@ void PixelConvert::GrabInformationsFromHeader( Header* header )
    IsDecompressed =
         ( ! header->IsDicomV3() )
      || ts == ImplicitVRLittleEndian
+     || ts == ImplicitVRLittleEndianDLXGE
      || ts == ExplicitVRLittleEndian
      || ts == ExplicitVRBigEndian
      || ts == DeflatedExplicitVRLittleEndian;
@@ -898,7 +908,7 @@ void PixelConvert::GrabInformationsFromHeader( Header* header )
       }
    }
                                                                                 
-   header->CloseFile();
+   if(fp) header->CloseFile();
 }
 
 /**