3 #include "gdcmHeaderEntry.h"
4 #include "gdcmDICOMDIR.h"
7 #ifdef GDCM_NO_ANSI_STRING_STREAM
9 # define ostringstream ostrstream
14 #define ostringstream ostrstream
18 void aff (ListTag::iterator deb, ListTag::iterator fin);
20 // ===============================================================================
22 void aff (ListTag::iterator deb, ListTag::iterator fin, int nbFFFE) {
24 for (ListTag::iterator i= deb; i!= fin; i++) {
25 if( (*i)->GetGroup() == 0xfffe) {
27 if (count == nbFFFE) break;
29 (*i)->SetPrintLevel(0);
35 int main(int argc, char* argv[])
38 unsigned short int g, e;
48 e1 = new gdcmDICOMDIR(a);
50 if(e1->GetPatients().begin() == e1->GetPatients().end() )
51 std::cout << "Liste Vide" << std::endl;
53 // Exemples exploitation de la structure
55 ListTag::iterator deb , fin;
56 lPatient::iterator itPatient;
58 cout << std::endl << std::endl
59 << " = Liste des PATIENT =========================================="
60 << std::endl<< std::endl;
63 itPatient = e1->GetPatients().begin();
64 while ( itPatient != e1->GetPatients().end() ) { // on degouline la liste de PATIENT
65 //cout << " = PATIENT ==========================================" << std::endl;
66 //deb = (*itPatient)->beginObj;
67 //fin = (*((*itPatient)->GetStudies()).begin())->beginObj;
68 //e1->SetPrintLevel(2);
70 std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name
74 cout << std::endl << std::endl
75 << " = Liste des PATIENT/STUDY =========================================="
76 << std::endl<< std::endl;
78 itPatient = e1->GetPatients().begin();
79 while ( itPatient != e1->GetPatients().end() ) { // on degouline la liste de PATIENT
80 std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name
81 lStudy::iterator itStudy = ((*itPatient)->GetStudies()).begin();
82 while (itStudy != (*itPatient)->GetStudies().end() ) { // on degouline les STUDY de ce patient
83 std::cout << "--- "<< (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << std::endl; // Stdy Description
91 cout << std::endl << std::endl
92 << " = Liste des PATIENT/STUDY/SERIE =========================================="
93 << std::endl<< std::endl;
95 itPatient = e1->GetPatients().begin();
96 while ( itPatient != e1->GetPatients().end() ) { // on degouline la liste de PATIENT
97 std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name
98 lStudy::iterator itStudy = ((*itPatient)->GetStudies()).begin();
99 while (itStudy != (*itPatient)->GetStudies().end() ) { // on degouline les STUDY de ce patient
100 std::cout << "--- "<< (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << std::endl; // Study Description
101 lSerie::iterator itSerie = ((*itStudy)->GetSeries()).begin();
102 while (itSerie != (*itStudy)->GetSeries().end() ) { // on degouline les SERIES de cette study
103 std::cout << "--- --- "<< (*itSerie)->GetEntryByNumber(0x0008, 0x103e) << std::endl; // Serie Description
111 cout << std::endl << std::endl
112 << " = Contenu Complet du DICOMDIR =========================================="
113 << std::endl<< std::endl;
116 itPatient = e1->GetPatients().begin();
117 while ( itPatient != e1->GetPatients().end() ) { // on degouline la liste de PATIENT
118 cout << " = PATIENT ==========================================" << std::endl;
119 deb = (*itPatient)->beginObj;
120 fin = (*((*itPatient)->GetStudies()).begin())->beginObj;
121 e1->SetPrintLevel(2);
124 lStudy::iterator itStudy = ((*itPatient)->GetStudies()).begin();
125 while (itStudy != (*itPatient)->GetStudies().end() ) { // on degouline les STUDY de ce patient
126 std::cout << " ==== STUDY ==========================================" <<std::endl;
127 deb = (*itStudy)->beginObj;
128 fin = (*((*itStudy)->GetSeries()).begin())->beginObj;
129 //e1->SetPrintLevel(2);
132 lSerie::iterator itSerie = ((*itStudy)->GetSeries()).begin();
133 while (itSerie != (*itStudy)->GetSeries().end() ) { // on degouline les SERIES de cette study
134 cout << " ======= SERIES ==========================================" << std::endl;
135 deb = (*itSerie)->beginObj;
136 fin = (*((*itSerie)->GetImages()).begin())->beginObj;
137 //e1->SetPrintLevel(2);
140 lImage::iterator itImage = ((*itSerie)->GetImages()).begin();
141 while (itImage != (*itSerie)->GetImages().end() ) { // on degouline les IMAGE de cette serie
143 cout << " ========== IMAGE ==========================================" << std::endl;
144 std::cout << "--- --- --- File Name: "<< (*itImage)->GetEntryByNumber(0x0004, 0x1500) << std::endl; // Referenced File