X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FMakeDicomDir.cxx;h=bb97ae6b2a66609fcaaf2e15a40d0174c430e892;hb=329b5524e57929ecf64495be9fe757b69ba64613;hp=9f87f5dfaab071a577579a93b0e10ba8fe89b237;hpb=ac2e8ecc8319069451f1fe5a4413915d56f9cbdc;p=gdcm.git diff --git a/Example/MakeDicomDir.cxx b/Example/MakeDicomDir.cxx index 9f87f5df..bb97ae6b 100644 --- a/Example/MakeDicomDir.cxx +++ b/Example/MakeDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: MakeDicomDir.cxx,v $ Language: C++ - Date: $Date: 2005/07/21 04:55:50 $ - Version: $Revision: 1.10 $ + Date: $Date: 2005/10/25 14:52:26 $ + Version: $Revision: 1.16 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,7 +20,6 @@ #include "gdcmDicomDirPatient.h" #include "gdcmDirList.h" #include "gdcmDebug.h" - #include "gdcmArgMgr.h" #include @@ -74,15 +73,15 @@ int main(int argc, char *argv[]) char *dirName; dirName = am->ArgMgrGetString("dirName",(char *)"."); - int loadMode = 0x00000000; + int loadMode = gdcm::LD_ALL; if ( am->ArgMgrDefined("noshadowseq") ) - loadMode |= NO_SHADOWSEQ; + loadMode |= gdcm::LD_NOSHADOWSEQ; else { if ( am->ArgMgrDefined("noshadow") ) - loadMode |= NO_SHADOW; + loadMode |= gdcm::LD_NOSHADOW; if ( am->ArgMgrDefined("noseq") ) - loadMode |= NO_SEQ; + loadMode |= gdcm::LD_NOSEQ; } if (am->ArgMgrDefined("debug")) @@ -104,9 +103,9 @@ int main(int argc, char *argv[]) // we ask for Directory parsing - dcmdir = new gdcm::DicomDir( ); + dcmdir = gdcm::DicomDir::New( ); - dcmdir->SetStartMethod(StartMethod, (void *) NULL); + dcmdir->SetStartMethod(StartMethod); dcmdir->SetEndMethod(EndMethod); dcmdir->SetLoadMode(loadMode); @@ -120,24 +119,26 @@ int main(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"<Delete(); return 1; } @@ -147,12 +148,12 @@ int main(int argc, char *argv[]) <<" has no patient"<Delete(); return(1); } std::cout<Delete(); return 0; }