X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FPrintDicomDir.cxx;h=145d33dd01f948dee8abb25f42dbeecb370baafb;hb=3b1f653b219f72d841e3b52ef2ae20d2c7c91220;hp=28f0a1abde25f2c6cc4f8b76aa6ee2bc6c5a21ad;hpb=2773148911a69268d1f939671b1ff6067b0059eb;p=gdcm.git diff --git a/Example/PrintDicomDir.cxx b/Example/PrintDicomDir.cxx index 28f0a1ab..145d33dd 100644 --- a/Example/PrintDicomDir.cxx +++ b/Example/PrintDicomDir.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintDicomDir.cxx,v $ Language: C++ - Date: $Date: 2006/01/17 15:36:26 $ - Version: $Revision: 1.31 $ + Date: $Date: 2007/05/23 14:18:04 $ + Version: $Revision: 1.36 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -22,6 +22,7 @@ #include "gdcmDicomDirVisit.h" #include "gdcmDicomDirSerie.h" #include "gdcmDicomDirImage.h" +#include "gdcmDicomDirPrivate.h" #include "gdcmTS.h" #include "gdcmDebug.h" @@ -33,17 +34,18 @@ int main(int argc, char* argv[]) { START_USAGE(usage) - " \n PrintDicomDir :\n", - " Display the tree-like structure of a DICOMDIR File", - " usage: PrintDicomDir filein=fileName [level=n] [debug] ", - " detail = 1 : Patients, 2 : Studies, 3 : Series, 4 : Images ", - " 5 : Full Content ", - " level = 0,1,2 : depending on user (what he wants to see)", - " debug : user wants to run the program in 'debug mode' ", + " \n PrintDicomDir :\n ", + " Display the tree-like structure of a DICOMDIR File ", + " usage: PrintDicomDir filein=fileName [level=n][detail=m][debug] ", + " detail = 1 : Patients, 2 : Studies, 3 : Series, 4 : Images ", + " 5 : Full Content ", + " level = 0,1,2 : depending on user (what he wants to see) ", + " warning : user wants to run the program in 'warning mode' ", + " debug : developper wants to run the program in 'debug mode' ", FINISH_USAGE // Initialize Arguments Manager - gdcm::ArgMgr *am= new gdcm::ArgMgr(argc, argv); + GDCM_NAME_SPACE::ArgMgr *am= new GDCM_NAME_SPACE::ArgMgr(argc, argv); if (argc == 1 || am->ArgMgrDefined("usage") ) { @@ -52,15 +54,15 @@ int main(int argc, char* argv[]) return 0; } - gdcm::DicomDir *f; - gdcm::TSKey v; - - gdcm::DicomDirPatient *pa; - gdcm::DicomDirStudy *st; - gdcm::DicomDirSerie *se; - gdcm::DicomDirVisit *vs; - gdcm::DicomDirImage *im; - + GDCM_NAME_SPACE::DicomDir *f; + GDCM_NAME_SPACE::TSKey v; + + GDCM_NAME_SPACE::DicomDirPatient *pa; + GDCM_NAME_SPACE::DicomDirStudy *st; + GDCM_NAME_SPACE::DicomDirSerie *se; + GDCM_NAME_SPACE::DicomDirVisit *vs; + GDCM_NAME_SPACE::DicomDirImage *im; + GDCM_NAME_SPACE::DicomDirPrivate *pr; char *fileName; fileName = am->ArgMgrWantString("filein",usage); @@ -69,8 +71,11 @@ int main(int argc, char* argv[]) int detailLevel = am->ArgMgrGetInt("detail", 2); if (am->ArgMgrDefined("debug")) - gdcm::Debug::DebugOn(); + GDCM_NAME_SPACE::Debug::DebugOn(); + if (am->ArgMgrDefined("warning")) + GDCM_NAME_SPACE::Debug::WarningOn(); + /* if unused Param we give up */ if ( am->ArgMgrPrintUnusedLabels() ) { @@ -81,7 +86,7 @@ int main(int argc, char* argv[]) // new gdcm2 style - f = gdcm::DicomDir::New(); + f = GDCM_NAME_SPACE::DicomDir::New(); f->SetFileName ( fileName ); f->Load( ); @@ -145,6 +150,7 @@ int main(int argc, char* argv[]) { // on degouline les STUDY de ce patient std::cout << "--- Stud.descr:[" << st->GetEntryString(0x0008, 0x1030) << "]"; // Study Description std::cout << " Stud.ID:[" << st->GetEntryString(0x0020, 0x0010) << "]"; // Study ID + std::cout << " Stud.Inst.UID:[" << st->GetEntryString(0x0020, 0x000d) << "]"; // Study Instance UID std::cout << std::endl; st = pa->GetNextStudy(); } @@ -170,6 +176,7 @@ int main(int argc, char* argv[]) { // on degouline les STUDY de ce patient std::cout << "--- Stud.descr:[" << st->GetEntryString(0x0008, 0x1030) << "]"; // Study Description std::cout << " Stud.ID:[" << st->GetEntryString(0x0020, 0x0010) << "]"; // Study ID + std::cout << " Stud.Inst.UID:[" << st->GetEntryString(0x0020, 0x000d) << "]"; // Study Instance UID std::cout << std::endl; se = st->GetFirstSerie(); @@ -178,6 +185,7 @@ int main(int argc, char* argv[]) std::cout << "--- --- Ser.Descr:["<< se->GetEntryString(0x0008, 0x103e)<< "]"; // Series Description std::cout << " Ser.nb:[" << se->GetEntryString(0x0020, 0x0011); // Series number std::cout << "] Mod.:[" << se->GetEntryString(0x0008, 0x0060) << "]"; // Modality + std::cout << " Serie Inst.UID.:[" << se->GetEntryString(0x0020, 0x000e) << "]"; // Series Instance UID std::cout << std::endl; se = st->GetNextSerie(); } @@ -249,6 +257,15 @@ int main(int argc, char* argv[]) << "]" << std::endl; // File name (Referenced File ID) im = se->GetNextImage(); } + + pr = se->GetFirstPrivate(); + while ( pr ) + { // on degouline les 'Privates' de cette serie + std::cout << "--- --- --- "<< " PRIVATE Ref. File ID :[" << pr->GetEntryString(0x0004, 0x1500) + << "]" << std::endl; // File name (Referenced File ID) + pr = se->GetNextPrivate(); + } + se = st->GetNextSerie(); } st = pa->GetNextStudy(); @@ -271,10 +288,10 @@ int main(int argc, char* argv[]) // Previous code. // Kept as an example. Please don't remove - gdcm::ListDicomDirPatient::const_iterator itPatient; - gdcm::ListDicomDirStudy::const_iterator itStudy; - gdcm::ListDicomDirSerie::const_iterator itSerie; - gdcm::ListDicomDirImage::const_iterator itImage; + GDCM_NAME_SPACE::ListDicomDirPatient::const_iterator itPatient; + GDCM_NAME_SPACE::ListDicomDirStudy::const_iterator itStudy; + GDCM_NAME_SPACE::ListDicomDirSerie::const_iterator itSerie; + GDCM_NAME_SPACE::ListDicomDirImage::const_iterator itImage; cout << std::endl << std::endl << " = Liste des PATIENT/STUDY/SERIE/IMAGE ===================================" << std::endl<< std::endl;