]> Creatis software - gdcm.git/blobdiff - Testing/TestMakeDicomDir.cxx
exXCoherentFileSet can be used to check splitting on a given Tag value.
[gdcm.git] / Testing / TestMakeDicomDir.cxx
index 586e8692be6f8363a1f4af32e088d7efc189bb61..0aa1ecc91b126aeecf313d12bb64841d06bcf97e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestMakeDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/07/08 10:15:08 $
-  Version:   $Revision: 1.4 $
+  Date:      $Date: 2005/10/25 14:52:31 $
+  Version:   $Revision: 1.10 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -62,15 +62,15 @@ int TestMakeDicomDir(int argc, char *argv[])
    gdcm::DicomDir *dcmdir;
 
    // new style (user is allowed no to load Sequences an/or Shadow Groups)
-   dcmdir = new gdcm::DicomDir( );
+   dcmdir = gdcm::DicomDir::New( );
  
-   // dcmdir->SetLoadMode(NO_SEQ | NO_SHADOW);
+   // dcmdir->SetLoadMode(gdcm::LD_NOSEQ | gdcm::LD_NOSHADOW);
    // some images have a wrong length for element 0x0000 of private groups
-   dcmdir->SetLoadMode(NO_SEQ);
+   dcmdir->SetLoadMode(gdcm::LD_NOSEQ);
    dcmdir->SetDirectoryName(dirName);
    dcmdir->Load( );
 
-   dcmdir->SetStartMethod(StartMethod, (void *) NULL);
+   dcmdir->SetStartMethod(StartMethod);
    dcmdir->SetEndMethod(EndMethod);
    
    if ( !dcmdir->GetFirstPatient() ) 
@@ -78,23 +78,26 @@ int TestMakeDicomDir(int argc, char *argv[])
       std::cout << "makeDicomDir: no patient found. Exiting."
                 << std::endl;
 
-      delete dcmdir;
+      dcmdir->Delete();
       return 1;
    }
     
    // Create the corresponding DicomDir
-   dcmdir->WriteDicomDir("NewDICOMDIR");
-   delete dcmdir;
+   dcmdir->Write("NewDICOMDIR");
+   dcmdir->Delete();
 
    // Read from disc the just written DicomDir
-   gdcm::DicomDir *newDicomDir = new gdcm::DicomDir("NewDICOMDIR");
+   gdcm::DicomDir *newDicomDir = gdcm::DicomDir::New();
+   newDicomDir->SetFileName("NewDICOMDIR");
+   newDicomDir->Load();
+
    if( !newDicomDir->IsReadable() )
    {
       std::cout<<"          Written DicomDir 'NewDICOMDIR'"
                <<" is not readable"<<std::endl
                <<"          ...Failed"<<std::endl;
 
-      delete newDicomDir;
+      newDicomDir->Delete();
       return 1;
    }
 
@@ -104,11 +107,11 @@ int TestMakeDicomDir(int argc, char *argv[])
                <<" has no patient"<<std::endl
                <<"          ...Failed"<<std::endl;
 
-      delete newDicomDir;
+      newDicomDir->Delete();
       return(1);
    }
 
    std::cout<<std::flush;
-   delete newDicomDir;
+   newDicomDir->Delete();
    return 0;
 }