X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FTestDicomDir.cxx;h=35d17d65cd367b942ed30cb8045aeb6f13246d32;hb=8fca7bc2830904113dbb5521c009775d964c5c98;hp=e47753c9243ac9cc43f94b0a113c42f80054d156;hpb=a7a9681c15a4469b76b878995df3529ba07228fb;p=gdcm.git diff --git a/Testing/TestDicomDir.cxx b/Testing/TestDicomDir.cxx index e47753c9..35d17d65 100644 --- a/Testing/TestDicomDir.cxx +++ b/Testing/TestDicomDir.cxx @@ -1,27 +1,13 @@ #include #include "gdcm.h" -#include "gdcmHeaderEntry.h" +#include "gdcmDocEntry.h" #include "gdcmDicomDir.h" #include -#ifdef GDCM_NO_ANSI_STRING_STREAM -# include -# define ostringstream ostrstream -# else -# include -#endif -#include -#include - -#define ostringstream ostrstream -//extern "C" -using namespace std; - -int main(int argc, char* argv[]) +int TestDicomDir(int argc, char* argv[]) { gdcmDicomDir *e1; - ListTag::iterator deb , fin; ListDicomDirPatient::iterator itPatient; ListDicomDirStudy::iterator itStudy; @@ -32,14 +18,16 @@ int main(int argc, char* argv[]) std::string file; if (argc > 1) file = argv[1]; - else - file = "../gdcmData/DICOMDIR"; - + else { + file += GDCM_DATA_ROOT; + file += "/DICOMDIR"; + } + e1 = new gdcmDicomDir(file.c_str()); - if (argc > 2) { - int level = atoi(argv[2]); - e1->SetPrintLevel(level); - } + if (argc > 2) { + int level = atoi(argv[2]); + e1->SetPrintLevel(level); + } if(e1->GetDicomDirPatients().begin() == e1->GetDicomDirPatients().end() ) { @@ -47,8 +35,8 @@ int main(int argc, char* argv[]) return(1); } -// Exemples exploitation de la structure -// DON'T REMOVE neither the folowing code, nor the commented out lines +// Simple examples of structure exploitation +// DON'T REMOVE neither the following code, nor the commented out lines /* cout << std::endl << std::endl @@ -80,7 +68,7 @@ int main(int argc, char* argv[]) } */ - cout << std::endl << std::endl + std::cout << std::endl << std::endl << " = Liste des PATIENT/STUDY/SERIE ==========================================" << std::endl<< std::endl; @@ -136,7 +124,7 @@ int main(int argc, char* argv[]) } */ - cout << std::endl << std::endl + std::cout << std::endl << std::endl << " = Contenu Complet du DICOMDIR ==========================================" << std::endl<< std::endl; e1->Print();