Program: gdcm
Module: $RCSfile: MakeDicomDir.cxx,v $
Language: C++
- Date: $Date: 2005/08/30 15:13:05 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2005/11/28 17:09:22 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <iostream>
-// ---
-void StartMethod(void *toto) {
- (void)toto;
- std::cout<<"Start parsing"<<std::endl;
-}
-
-void EndMethod(void *toto) {
- (void)toto;
- std::cout<<"End parsing"<<std::endl;
-}
-// ---
-
/**
* \brief Explores recursively the given directory
* orders the gdcm-readable found Files
// we ask for Directory parsing
- dcmdir = new gdcm::DicomDir( );
-
- dcmdir->SetStartMethod(StartMethod);
- dcmdir->SetEndMethod(EndMethod);
+ dcmdir = gdcm::DicomDir::New( );
dcmdir->SetLoadMode(loadMode);
dcmdir->SetDirectoryName(dirName);
{
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();
+ gdcm::DicomDir *newDicomDir = gdcm::DicomDir::New();
newDicomDir->SetFileName( "NewDICOMDIR" );
newDicomDir->Load();
if( !newDicomDir->IsReadable() )
<<" is not readable"<<std::endl
<<" ...Failed"<<std::endl;
- delete newDicomDir;
+ newDicomDir->Delete();
return 1;
}
<<" has no patient"<<std::endl
<<" ...Failed"<<std::endl;
- delete newDicomDir;
+ newDicomDir->Delete();
return(1);
}
std::cout<<std::flush;
- delete newDicomDir;
+ newDicomDir->Delete();
return 0;
}