]> Creatis software - gdcm.git/commitdiff
Now DicomDir::IsReadable() works
authorjpr <jpr>
Thu, 13 Jan 2005 12:19:58 +0000 (12:19 +0000)
committerjpr <jpr>
Thu, 13 Jan 2005 12:19:58 +0000 (12:19 +0000)
src/gdcmDicomDir.cxx
src/gdcmDocument.cxx

index 6f15a2f769bfe06347f4a91ae1c81986a447910b..cbaa1367c19faa72266857ca40c538b3fa3486f0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/13 09:46:54 $
-  Version:   $Revision: 1.99 $
+  Date:      $Date: 2005/01/13 12:19:58 $
+  Version:   $Revision: 1.100 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -191,16 +191,19 @@ void DicomDir::Print(std::ostream &os)
  */
 bool DicomDir::IsReadable()
 {
-   if( !Document::IsReadable() )
+   if( Filetype == Unknown)
    {
+      gdcmVerboseMacro( "Wrong filetype");
       return false;
    }
    if( !MetaElems )
    {
+      gdcmVerboseMacro( "Meta Elements missing in DicomDir");
       return false;
    }
    if( Patients.size() <= 0 )
    {
+      gdcmVerboseMacro( "NO Patient in DicomDir");
       return false;
    }
 
index 23a0051201fb0329e673e4d04884f410a1faf48d..1543981db19d37cd41083bd639b75620da689dd6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDocument.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/13 09:53:42 $
-  Version:   $Revision: 1.188 $
+  Date:      $Date: 2005/01/13 12:19:58 $
+  Version:   $Revision: 1.189 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -85,7 +85,7 @@ Document::Document( std::string const &filename ) : ElementSet(-1)
    long beg = Fp->tellg();
    lgt -= beg;
    
-   ParseDES( this, beg, lgt, false); // le Load sera fait a la volee
+   ParseDES( this, beg, lgt, false); // Loading is done during parsing
 
    Fp->seekg( 0,  std::ios::beg);
    
@@ -256,7 +256,7 @@ bool Document::IsReadable()
    }
 
    if( TagHT.empty() )
-   {
+   { 
       gdcmVerboseMacro( "No tags in internal hash table.");
       return false;
    }
@@ -1269,7 +1269,7 @@ void Document::ParseSQ( SeqEntry *seqEntry,
 
    while (true)
    {
-      DocEntry *newDocEntry = ReadNextDocEntry();   
+      DocEntry *newDocEntry = ReadNextDocEntry();
       if ( !newDocEntry )
       {
          // FIXME Should warn user
@@ -1308,8 +1308,8 @@ void Document::ParseSQ( SeqEntry *seqEntry,
       }
    
       ParseDES(itemSQ, newDocEntry->GetOffset(), l, dlm_mod);
-      delete newDocEntry;
-      
+      delete newDocEntry; // FIXME Why deleting fffe 000e ?!?
       seqEntry->AddEntry( itemSQ, SQItemNumber ); 
       SQItemNumber++;
       if ( !delim_mode && ((long)(Fp->tellg())-offset ) >= l_max )
@@ -2488,7 +2488,7 @@ DocEntry *Document::ReadNextDocEntry()
          if ( newEntry->GetGroup() != 0xfffe )
          { 
             std::string msg;
-            msg = Util::Format("Falsely explicit vr file (%04x,%04x)\n", 
+            msg = Util::Format("Entry (%04x,%04x) should be Explicit VR\n", 
                           newEntry->GetGroup(), newEntry->GetElement());
             gdcmVerboseMacro( msg.c_str() );
           }