- itPatient = e1->GetPatients().begin();
- while ( itPatient != e1->GetPatients().end() ) { // on degouline la liste de PATIENT
- std::cout << (*itPatient)->GetEntryByNumber(0x0010, 0x0010) << std::endl; // Patient's Name
- itStudy = ((*itPatient)->GetStudies()).begin();
- while (itStudy != (*itPatient)->GetStudies().end() ) { // on degouline les STUDY de ce patient
- std::cout << "--- "<< (*itStudy)->GetEntryByNumber(0x0008, 0x1030) << std::endl; // Study Description
- itSerie = ((*itStudy)->GetSeries()).begin();
- while (itSerie != (*itStudy)->GetSeries().end() ) { // on degouline les SERIES de cette study
- std::cout << "--- --- "<< (*itSerie)->GetEntryByNumber(0x0008, 0x103e) << std::endl; // Serie Description
- itImage = ((*itSerie)->GetImages()).begin();
- while (itImage != (*itSerie)->GetImages().end() ) { // on degouline les SERIES de cette study
- std::cout << "--- --- --- "<< (*itImage)->GetEntryByNumber(0x0004, 0x1500) << std::endl; // File name
- ++itImage;
+ st1 = pa1->GetFirstStudy();
+ st2 = pa2->GetFirstStudy();
+
+ while ( st1 && st2 )
+ {
+ if ( CompareSQItem(st2,st1) == 1 )
+ {
+ delete dicomdir;
+ delete d2;
+ return 1;
+ }
+
+ // just to allow human reader to be sure ...
+ std::cout << "--- "<< st2->GetEntryValue(0x0008, 0x1030);
+ // << std::endl; // Study Description
+ std::cout << " Stud.ID:["
+ << st2->GetEntryValue(0x0020, 0x0010)
+ << "]" << std::endl; // Study ID
+
+ se1 = st1->GetFirstSerie();
+ se2 = st2->GetFirstSerie();
+
+ while ( se1 && se2 )
+ { // we process all the SERIE of this study
+ if ( CompareSQItem(se2,se1) == 1 )
+ return 1;
+ std::cout << "--- --- " << se2->GetEntryValue(0x0008, 0x103e); // Serie Description
+ std::cout << " Ser.nb:["<< se2->GetEntryValue(0x0020, 0x0011); // Series number
+ std::cout << "] Mod.:[" << se2->GetEntryValue(0x0008, 0x0060) << "]" << std::endl; // Modality
+ im1 = se1->GetFirstImage();
+ im2 = se2->GetFirstImage();
+
+ while ( im1 && im2 ) // we process all the IMAGE of this serie
+ {
+ if ( CompareSQItem(im2,im1) == 1 )
+ {
+ delete dicomdir;
+ delete d2;
+ return 1;
+ }
+
+ im1 = se1->GetNextImage();
+ im2 = se2->GetNextImage();