]> Creatis software - gdcm.git/blobdiff - src/gdcmDicomDir.cxx
Typo.
[gdcm.git] / src / gdcmDicomDir.cxx
index 27b840f24c2b20d3bcabb7935ba0f3812827fafb..2af9aaf2b5825d8b469ea27fb8c5420f4dbef67d 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/04/14 14:26:19 $
-  Version:   $Revision: 1.137 $
+  Date:      $Date: 2005/06/03 16:08:16 $
+  Version:   $Revision: 1.140 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 //  Directory Record Type      Directory Record Types which may be included
 //                                in the next lower-level directory Entity
 //
-// (Root directory Entity)     PATIENT
+// (Root directory Entity)     PATIENT, TOPIC, PRIVATE
 //
-// PATIENT                     STUDY
+// PATIENT                     STUDY, PRIVATE
 //
-// STUDY                       SERIES, VISIT, RESULTS, STUDY COMPONENT
+// STUDY                       SERIES, VISIT, RESULTS, STUDY COMPONENT, PRIVATE
 //
 // SERIES                      IMAGE, OVERLAYS, MODALITY LUT, VOI LUT,
 //                             CURVE, STORED PRINT, RT DOSE, RT STRUCTURE SET
 //                             RT PLAN, RT TREAT RECORD, PRESENTATION, WAVEFORM,
 //                             SR DOCUMENT, KEY OBJECT DOC, SPECTROSCOPY,
-//                             RAW DATA, REGISTRATION, FIDUCIAL
+//                             RAW DATA, REGISTRATION, FIDUCIAL, PRIVATE,
+//                             ENCAP DOC
 // IMAGE
 // OVERLAY
 // MODALITY LUT
@@ -89,6 +90,8 @@
 // RAW DATA
 // REGISTRATION
 // FIDUCIAL
+// PRIVATE
+// ENCAP DOC
 // 
 // ----------------------
 // The current gdcm version only deals with :
@@ -133,7 +136,7 @@ DicomDir::DicomDir(std::string const &fileName, bool parseDir ):
    Document( )
 {
    // At this step, Document constructor is already executed,
-   // whatever user passed (a root directory or a DICOMDIR)
+   // whatever user passed (either a root directory or a DICOMDIR)
    // and whatever the value of parseDir was.
    // (nothing is cheked in Document constructor, to avoid overhead)
 
@@ -161,7 +164,7 @@ DicomDir::~DicomDir()
 //-----------------------------------------------------------------------------
 // Public
 
-void DicomDir::Load(std::string const &fileName ) 
+bool DicomDir::Load(std::string const &fileName ) 
 {
    Filename = fileName;
    // We should clean out anything that already exists.
@@ -175,13 +178,13 @@ void DicomDir::Load(std::string const &fileName )
       Fp = 0;
       if ( !OpenFile() )
       {
-         return;
+         return false;
       }
       Document::Load(fileName);
       if ( GetFirstEntry() == 0 ) // when user passed a Directory to parse
       {
          gdcmWarningMacro( "Entry HT empty for file: "<< fileName);
-         return;
+         return false;
       }
       // Directory record sequence
       DocEntry *e = GetDocEntry(0x0004, 0x1220);
@@ -189,6 +192,7 @@ void DicomDir::Load(std::string const &fileName )
       {
          gdcmWarningMacro( "NO 'Directory record sequence' (0x0004,0x1220)"
                           << " in file " << fileName);
+         return false;
       }
       else
          CreateDicomDir();
@@ -207,8 +211,10 @@ void DicomDir::Load(std::string const &fileName )
       }
       NewMeta();
       gdcmWarningMacro( "Parse directory and create the DicomDir : " << Filename );
+
       ParseDirectory();
    }
+   return true;
 }
 
 /**
@@ -524,14 +530,6 @@ bool DicomDir::AnonymizeDicomDir()
    return true;
 }
 
-
-
-
-
-
-
-
-
 //-----------------------------------------------------------------------------
 // Protected
 /**