]> Creatis software - gdcm.git/commitdiff
Use new style for DicomDir loading
authorjpr <jpr>
Fri, 8 Jul 2005 10:15:04 +0000 (10:15 +0000)
committerjpr <jpr>
Fri, 8 Jul 2005 10:15:04 +0000 (10:15 +0000)
Example/MakeDicomDir.cxx
Example/PrintDicomDir.cxx
Testing/TestMakeDicomDir.cxx

index 5723db7de90643b7adcdf408533312f5e000a87b..597020a8471ae43b427c9a4bd7281361b0edaa58 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: MakeDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/07/07 17:31:53 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2005/07/08 10:15:04 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -102,14 +102,13 @@ int main(int argc, char *argv[])
    // we ask for Directory parsing
 
    dcmdir = new gdcm::DicomDir( );
-   dcmdir->SetParseDir(true);
 
    dcmdir->SetStartMethod(StartMethod, (void *) NULL);
    dcmdir->SetEndMethod(EndMethod);
 
    dcmdir->SetLoadMode(loadMode);
-   dcmdir->SetFileName(dirName);
-
+   dcmdir->SetDirectoryName(dirName);
+dcmdir->SetParseDir(true);
    dcmdir->Load();
 
     // ----- Check the result
index adbc4c18ef1b343f772444ae9e1e13c454a8edbe..3fd8d415a72e0895e7309ce048f8a2a2de07fac0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: PrintDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/07/07 17:31:53 $
-  Version:   $Revision: 1.24 $
+  Date:      $Date: 2005/07/08 10:15:04 $
+  Version:   $Revision: 1.25 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -78,14 +78,11 @@ int main(int argc, char* argv[])
       return 0;
    } 
 
-   // new style is useless, since it has no effect for *reading* a DICOMDIR
-   // (only meaningfull when *creating* a DICOMDIR)
+   // new gdcm2 style 
 
-   f = new gdcm::DicomDir( fileName );
-
-   //f = new gdcm::DicomDir();
-   //f->SetParseDir(false);
-   //f->Load(  fileName );
+   f = new gdcm::DicomDir();
+   f->SetFileName ( fileName );
+   f->Load( );
 
    // Test if the DicomDir is readable
    if( !f->IsReadable() )
@@ -102,7 +99,7 @@ int main(int argc, char* argv[])
 
    // Test if the DicomDir contains any Patient
    pa = f->GetFirstPatient();
-   if ( pa  == 0)
+   if ( pa == 0)
    {
       std::cout<<"          DicomDir '"<<fileName
                <<" has no patient"<<std::endl
index 861b755348c1ed16ece531dc2009f6afc66c9bde..586e8692be6f8363a1f4af32e088d7efc189bb61 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestMakeDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/06/02 09:37:50 $
-  Version:   $Revision: 1.3 $
+  Date:      $Date: 2005/07/08 10:15:08 $
+  Version:   $Revision: 1.4 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -60,19 +60,15 @@ int TestMakeDicomDir(int argc, char *argv[])
    }
  
    gdcm::DicomDir *dcmdir;
-    // Old style (still available)
-    //
-    // true : we ask for Directory parsing
-    // dcmdir = new gdcm::DicomDir(dirName, true);
 
    // new style (user is allowed no to load Sequences an/or Shadow Groups)
    dcmdir = new gdcm::DicomDir( );
-   dcmdir->SetParseDir(true);
    // dcmdir->SetLoadMode(NO_SEQ | NO_SHADOW);
    // some images have a wrong length for element 0x0000 of private groups
    dcmdir->SetLoadMode(NO_SEQ);
-   dcmdir->Load(dirName);
+   dcmdir->SetDirectoryName(dirName);
+   dcmdir->Load( );
 
    dcmdir->SetStartMethod(StartMethod, (void *) NULL);
    dcmdir->SetEndMethod(EndMethod);